ro.isdc.wro.model.resource.locator.wildcard
Class DefaultWildcardStreamLocator
java.lang.Object
ro.isdc.wro.model.resource.locator.wildcard.DefaultWildcardStreamLocator
- All Implemented Interfaces:
- WildcardExpanderHandlerAware, WildcardStreamLocator
- Direct Known Subclasses:
- JarWildcardStreamLocator
public class DefaultWildcardStreamLocator
- extends Object
- implements WildcardStreamLocator, WildcardExpanderHandlerAware
Default implementation of WildcardStreamLocator
.
- Author:
- Alex Objelean
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RECURSIVE_WILDCARD
public static final String RECURSIVE_WILDCARD
- Character to distinguish wildcard inside the uri.
- See Also:
- Constant Field Values
DefaultWildcardStreamLocator
public DefaultWildcardStreamLocator()
hasWildcard
public boolean hasWildcard(String uri)
-
- Specified by:
hasWildcard
in interface WildcardStreamLocator
- Parameters:
uri
- to check
- Returns:
- true if the uri contains a wildcard.
locateStream
public InputStream locateStream(String uri,
File folder)
throws IOException
- Locates the stream based on the fileName containing the wildcard and the folder where to search.
- Specified by:
locateStream
in interface WildcardStreamLocator
- Parameters:
uri
- the resource of the uri to locate. This uri should be exactly the same as defined in Resource
.folder
- parent from where the search of fileNameWithWildcard should start.
- Returns:
InputStream
to the resources collection matching the wildcard.
- Throws:
IOException
- if folder is invalid or when I/O error occurs while locating the stream.
setWildcardExpanderHandler
public void setWildcardExpanderHandler(Function<Collection<File>,Void> handler)
- Sets the handler to be used by the implementing class.
- Specified by:
setWildcardExpanderHandler
in interface WildcardExpanderHandlerAware
- Parameters:
handler
- a Function
which does the handler job.
Copyright © 2008-2013. All Rights Reserved.