javatools.filehandlers
Class DeepFileSet
java.lang.Object
javatools.datatypes.PeekIterator<java.io.File>
javatools.filehandlers.DeepFileSet
- All Implemented Interfaces:
- java.io.Closeable, java.lang.Iterable<java.io.File>, java.util.Iterator<java.io.File>
public class DeepFileSet
- extends PeekIterator<java.io.File>
This class is part of the Java Tools (see http://mpii.de/yago-naga/javatools).
It is licensed under the Creative Commons Attribution License
(see http://creativecommons.org/licenses/by/3.0) by
the YAGO-NAGA team (see http://mpii.de/yago-naga).
This class represents a set of files as given by a wildcard string.
It can also recurse into subfolders.
It does not return folders and is not case-sensitive.
The class can be used as an Iterator or Iterable (e.g. in a for-each-loop).
Example:
for(File f : new DeepFileSet("c:\\myfiles","*.jaVa"))
System.out.println(f);
-->
c:\myfiles\FileSet.java
c:\myfiles\HTMLReader.java
c:\myfiles\mysubfolder\OtherFile.java
...
Constructor Summary |
DeepFileSet(java.io.File folderPlusWildcard)
Constructs a DeepFileSet from a path that ends in a wildcard |
DeepFileSet(java.io.File folder,
java.lang.String wildcard)
Constructs a DeepFileSet from path and wildcard |
DeepFileSet(java.lang.String folderPlusWildcard)
Constructs a DeepFileSet from a path that ends in a wildcard |
Method Summary |
static void |
main(java.lang.String[] argv)
Test routine |
java.util.regex.Pattern |
patternForWildcard(java.lang.String wildcard)
|
java.lang.String |
toString()
Returns the current state of this DeepFileSet |
Methods inherited from class javatools.datatypes.PeekIterator |
asList, asList, asSet, asSet, asSet, close, emptyIterator, hasNext, iterator, list, list, next, nextOrNull, numElements, numElements, peek, remove, toString, toString |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DeepFileSet
public DeepFileSet(java.io.File folderPlusWildcard)
- Constructs a DeepFileSet from a path that ends in a wildcard
DeepFileSet
public DeepFileSet(java.lang.String folderPlusWildcard)
- Constructs a DeepFileSet from a path that ends in a wildcard
DeepFileSet
public DeepFileSet(java.io.File folder,
java.lang.String wildcard)
- Constructs a DeepFileSet from path and wildcard
patternForWildcard
public java.util.regex.Pattern patternForWildcard(java.lang.String wildcard)
toString
public java.lang.String toString()
- Returns the current state of this DeepFileSet
- Overrides:
toString
in class PeekIterator<java.io.File>
main
public static void main(java.lang.String[] argv)
- Test routine