public abstract class ListableResourceFinder extends ResourceFinder
ResourceFinder class with a list(String, boolean) method.EMPTY_RESOURCE_FINDER| Constructor and Description |
|---|
ListableResourceFinder() |
| Modifier and Type | Method and Description |
|---|---|
abstract Iterable<Resource> |
list(String resourceNamePrefix,
boolean recurse)
Returns all resources who's names start with a given string.
|
findResource, findResourceAsStream@Nullable public abstract Iterable<Resource> list(String resourceNamePrefix, boolean recurse) throws IOException
If the prefix string ends with "/", you will get a proper directory listing (recurse=false)
or directory tree (recurse=true). Example:
resourceFinder.list("dir/", true) =>
dir/
dir/afile
dir/bfile
dir/adir/
dir/adir/file
dir/bdir/
dir/bdir/file
Otherwise, you will get a strange subset of a directory listing, resp. directory tree, as follows:
resourceFinder.list("dir/a", true) =>
dir/afile
dir/adir/
dir/adir/file
resourceNamePrefix - E.g. "" or "java/lang/"null iff
a location designated by the resourceNamePrefix does not existIOExceptionCopyright © 2022. All rights reserved.