ro.isdc.wro.model.resource.locator
Class UrlUriLocator
java.lang.Object
ro.isdc.wro.model.resource.locator.wildcard.WildcardUriLocatorSupport
ro.isdc.wro.model.resource.locator.UrlUriLocator
- All Implemented Interfaces:
- UriLocator
public class UrlUriLocator
- extends WildcardUriLocatorSupport
UriLocator capable to read the resources from some URL. Usually, this uriLocator will be the last in the chain of
uriLocators.
- Author:
- Alex Objelean
Method Summary |
boolean |
accept(String uri)
Check if this uri can be located by concrete implementation. |
static boolean |
isValid(String uri)
Check if a uri is a URL resource. |
InputStream |
locate(String uri)
Locates the uri by retrieving the InputStream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ALIAS
public static final String ALIAS
- Alias used to register this locator with
LocatorProvider
.
- See Also:
- Constant Field Values
UrlUriLocator
public UrlUriLocator()
accept
public 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.
isValid
public static boolean isValid(String uri)
- Check if a uri is a URL resource.
- Parameters:
uri
- to check.
- Returns:
- true if the uri is a URL resource.
locate
public 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.
Copyright © 2008-2013. All Rights Reserved.