org.clapper.util.io
Class RecursiveFileFinder
- java.lang.Object
-
- org.clapper.util.io.RecursiveFileFinder
-
public class RecursiveFileFinder extends java.lang.ObjectA RecursiveFileFinder walks a directory tree and finds all files (or directories) that satisfy caller-supplied criteria. The match criteria are specified via either a FileFilter or FilenameFilter object.
-
-
Constructor Summary
Constructors Constructor and Description RecursiveFileFinder()Construct a new RecursiveFileFinder object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intfindFiles(java.io.File directory, java.util.Collection<java.io.File> collection)Find all files beneath a given directory.intfindFiles(java.io.File directory, java.io.FileFilter filter, java.util.Collection<java.io.File> collection)Find all files beneath a given directory, filtered by the specified FilenameFilter.intfindFiles(java.io.File directory, java.io.FilenameFilter filter, java.util.Collection<java.io.File> collection)Find all files beneath a given directory, filtered by the specified FilenameFilter.
-
-
-
Constructor Detail
-
RecursiveFileFinder
public RecursiveFileFinder()
Construct a new RecursiveFileFinder object. The various find() methods actually provide the searching capabilities.
-
-
Method Detail
-
findFiles
public int findFiles(java.io.File directory, java.util.Collection<java.io.File> collection)Find all files beneath a given directory. This version of find() takes no filter, so every file and directory is matched.- Parameters:
directory- the starting directorycollection- where to store the found File objects- Returns:
- the number of File objects found
-
findFiles
public int findFiles(java.io.File directory, java.io.FilenameFilter filter, java.util.Collection<java.io.File> collection)Find all files beneath a given directory, filtered by the specified FilenameFilter.- Parameters:
directory- the starting directoryfilter- the FilenameFilter to use to filter the file names, or null to accept all filescollection- where to store the found File objects- Returns:
- the number of File objects found
-
findFiles
public int findFiles(java.io.File directory, java.io.FileFilter filter, java.util.Collection<java.io.File> collection)Find all files beneath a given directory, filtered by the specified FilenameFilter.- Parameters:
directory- the starting directoryfilter- the FilenameFilter to use to filter the file names, or null to accept all filescollection- where to store the found File objects- Returns:
- the number of File objects found
-
-
DMelt 3.0 © DataMelt by jWork.ORG