ro.isdc.wro.model.resource.locator
Class UrlUriLocator

java.lang.Object
  extended by ro.isdc.wro.model.resource.locator.wildcard.WildcardUriLocatorSupport
      extended by 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

Field Summary
static String ALIAS
          Alias used to register this locator with LocatorProvider.
 
Constructor Summary
UrlUriLocator()
           
 
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 ro.isdc.wro.model.resource.locator.wildcard.WildcardUriLocatorSupport
getWildcardStreamLocator, isEnableWildcards, newWildcardStreamLocator, setEnableWildcards
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIAS

public static final String ALIAS
Alias used to register this locator with LocatorProvider.

See Also:
Constant Field Values
Constructor Detail

UrlUriLocator

public UrlUriLocator()
Method Detail

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.