FileResourceFinder that finds file resources in a directory. The name of
the file is constructed by concatenating a dirctory name with the resource name such that slashes in the resource
name map to file separators.
| Modifier and Type | Field and Description |
|---|---|
| private final File | |
| private final Map | subdirectoryNameToFiles
Keys don't have trailing file separators (like "dir\"). |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected final File | findResourceAsFile(String resourceName)
Implements abstract org. File.
|
| public Iterable | list(String
E.g. resourceNamePrefix, boolean recurse)"" or "java/lang/"Implements abstract org. |
| private Set | |
| public final String |
| directory | back to summary |
|---|---|
| private final File directory | |
| subdirectoryNameToFiles | back to summary |
|---|---|
| private final Map<String, Set<File>> subdirectoryNameToFiles Keys don't have trailing file separators (like "dir\"). The "root directory" is designated by key | |
| DirectoryResourceFinder | back to summary |
|---|---|
public DirectoryResourceFinder(File directory)
| |
| findResourceAsFile | back to summary |
|---|---|
| protected final File findResourceAsFile(String resourceName) Implements abstract org. Doc from org. Converts a given resource resource name into a | |
| list | back to summary |
|---|---|
| public Iterable Implements abstract org. Doc from org. Returns all resources who's names start with a given string. Only resources with a content are included, no "special entries" of any kind, e.g. directories.
If the prefix string ends with "/", you will get a proper directory listing (recurse
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
| |
| listFiles | back to summary |
|---|---|
| private Set | |
| toString | back to summary |
|---|---|
| public final String toString() Overrides java. Doc from java. Returns a string representation of the object. | |