|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectro.isdc.wro.model.resource.locator.wildcard.DefaultWildcardStreamLocator
public class DefaultWildcardStreamLocator
Default implementation of WildcardStreamLocator.
| Field Summary | |
|---|---|
static String |
RECURSIVE_WILDCARD
Character to distinguish wildcard inside the uri. |
| Constructor Summary | |
|---|---|
DefaultWildcardStreamLocator()
Creates a WildcardStream locator which doesn't care about detecting duplicate resources. |
|
| Method Summary | |
|---|---|
protected void |
handleFoundResources(Collection<File> files)
The default implementation does nothing. |
boolean |
hasWildcard(String uri)
|
InputStream |
locateStream(String uri,
File folder)
Locates the stream based on the fileName containing the wildcard and the folder where to search. |
void |
setWildcardExpanderHandler(Transformer<Collection<File>> handler)
Sets the handler to be used by the implementing class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String RECURSIVE_WILDCARD
| Constructor Detail |
|---|
public DefaultWildcardStreamLocator()
| Method Detail |
|---|
public boolean hasWildcard(String uri)
hasWildcard in interface WildcardStreamLocatoruri - to check
public InputStream locateStream(String uri,
File folder)
throws IOException
locateStream in interface WildcardStreamLocatoruri - 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.
InputStream to the resources collection matching the wildcard.
IOException - if folder is invalid or when I/O error occurs while locating the stream.
protected void handleFoundResources(Collection<File> files)
throws IOException
files - a collection of found resources after the wildcard has beed applied on the searched folder.
IOExceptionpublic void setWildcardExpanderHandler(Transformer<Collection<File>> handler)
setWildcardExpanderHandler in interface WildcardExpandedHandlerAwarehandler - a Transformer which does the handler job. The Transformer is not the ideal interface
to be used, but it can be a temporary solution until a better one is found.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||