public class DirectoryFileCollection extends java.lang.Object implements FileCollection
FileCollection
Modifier and Type | Class and Description |
---|---|
private static class |
DirectoryFileCollection.Walker |
Modifier and Type | Field and Description |
---|---|
private java.io.File |
directory
directory under inspection
|
Constructor and Description |
---|
DirectoryFileCollection(java.io.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(java.io.File dir,
java.lang.String extension,
java.util.List<java.io.File> files) |
DirectoryFileCollection.Walker |
createWalker(java.lang.String extension)
create a
FileCollection.Walker object that allows to iterate the file
collection. |
DirectoryFileCollection.Walker |
createWalker(java.lang.String[] extensions)
create a
FileCollection.Walker object that allows to iterate the file
collection. |
private static void |
sortFiles(java.util.List<java.io.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
|
java.lang.String |
toString() |
public DirectoryFileCollection(java.io.File directory)
directory
- directory to iterate through,private static void addAllFiles(java.io.File dir, java.lang.String extension, java.util.List<java.io.File> files)
private static void sortFiles(java.util.List<java.io.File> files)
public DirectoryFileCollection.Walker createWalker(java.lang.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(java.lang.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.public java.lang.String toString()
toString
in class java.lang.Object