Package edu.wisc.ssec.mcidasv.util
Class FileFinder
java.lang.Object
edu.wisc.ssec.mcidasv.util.FileFinder
Allows for easy searching of files matching "glob" patterns
(e.g.
*.py
) in a given directories and its subdirectories.
Note: the findFiles(...)
methods will block until the search
finishes! If this is a concern, for the time being, please consider using
findFiles(String, String, int)
with a reasonable depth value.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
Internal class used by thefindFiles(...)
methods to actually "walk" the directory tree. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFind files matching the specified "glob" pattern in the given directory (and all of its subdirectories).Find files matching the specified "glob" pattern in the given directory (and not exceeding the given "depth").
-
Field Details
-
logger
Logging object.
-
-
Constructor Details
-
FileFinder
public FileFinder()
-
-
Method Details
-
findFiles
Find files matching the specified "glob" pattern in the given directory (and all of its subdirectories).Note: "glob" patterns are simple DOS/UNIX style. Think "*.py".
- Parameters:
path
- Directory to search.globPattern
- Pattern to match against.- Returns:
List
ofString
versions of matching paths. The list will be empty (Collections.emptyList()
if there were no matches.
-
findFiles
Find files matching the specified "glob" pattern in the given directory (and not exceeding the given "depth").Note: "glob" patterns are simple DOS/UNIX style. Think "*.py".
- Parameters:
path
- Directory to search.globPattern
- Pattern to match against.depth
- Maximum number of directory levels to visit.- Returns:
List
ofString
versions of matching paths. The list will be empty (Collections.emptyList()
if there were no matches.
-