ro.isdc.wro.model.resource.locator
Interface UriLocator

All Known Implementing Classes:
ClasspathUriLocator, ServletContextUriLocator, UrlUriLocator, WildcardUriLocatorSupport

public interface UriLocator

Describes a way to locate the stream associated with some uri.
Defines a contract for classes which are able to read a uri, by returning the corresponding InputStream.

Author:
Alex Objelean

Method Summary
 boolean accept(String uri)
          Check if this uri can be located by concrete implementation.
 InputStream locate(String uri)
          Locates the uri by retrieving the InputStream.
 

Method Detail

locate

InputStream locate(String uri)
                   throws IOException
Locates the uri by retrieving the InputStream. The client is responsible for closing the InputStream.

Parameters:
uri - uri to read.
Returns:
InputStream for the provided uri.
Throws:
IOException - if the resource cannot be read for some reason.

accept

boolean accept(String uri)
Check if this uri can be located by concrete implementation.

Parameters:
uri - to read.
Returns:
true if UriLocator is able to return an InputStream of this uri.


Copyright © 2008-2013. All Rights Reserved.