public class DirectoryFileCollection extends Object implements FileCollection
FileCollection
Modifier and Type | Class and Description |
---|---|
private static class |
DirectoryFileCollection.Walker |
Modifier and Type | Field and Description |
---|---|
private File |
directory
directory under inspection
|
Constructor and Description |
---|
DirectoryFileCollection(File directory)
create a new File collection for a given directory
The argument may be a single file also.
|
Modifier and Type | Method and Description |
---|---|
private static void |
addAllFiles(File dir,
String extension,
List<File> files) |
DirectoryFileCollection.Walker |
createWalker(String extension)
create a
FileCollection.Walker object that allows to iterate the file
collection. |
DirectoryFileCollection.Walker |
createWalker(String[] extensions)
create a
FileCollection.Walker object that allows to iterate the file
collection. |
private static void |
sortFiles(List<File> files)
This method is to fix the bug: "0965: Creating arrays of primitive type fails when using \bootclasspath "
The method sorts the List of File that is given as parameter according to the following criteria:
- File paths that contain the subpath "java/lang" are stored before other file paths
|
String |
toString() |
private File directory
public DirectoryFileCollection(File directory)
directory
- directory to iterate through,private static void sortFiles(List<File> files)
public DirectoryFileCollection.Walker createWalker(String extension)
FileCollection
FileCollection.Walker
object that allows to iterate the file
collection.
The search can be restricted to files with a certain extension. If this
is not desired, one specifies null for the extension.createWalker
in interface FileCollection
extension
- file extension to be considered only. null if all files
are to be considered.public DirectoryFileCollection.Walker createWalker(String[] extensions)
FileCollection
FileCollection.Walker
object that allows to iterate the file
collection.
The search can be restricted to files with a certain extension. If this
is not desired, one specifies null for the extension.createWalker
in interface FileCollection
extensions
- file extensions to be considered only. null if all files
are to be considered.