|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.util.annotation.FileIterator
public final class FileIterator
FileIterator enables iteration over all files in a directory and all
its sub directories.
Usage:
FileIterator iter = new FileIterator(new File("./src"));
File f;
while ((f = iter.next()) != null) {
// do something with f
assert f == iter.getCurrent();
}
| Constructor Summary | |
|---|---|
FileIterator(File... filesOrDirectories)
Create a new FileIterator using the specified 'filesOrDirectories' as root. |
|
| Method Summary | |
|---|---|
File |
getFile()
Return the last returned file or null if no more files are available. |
boolean |
isRootFile()
Return true if the current file is one of the files originally
specified as one of the constructor file parameters, i.e. |
File |
next()
Return the next File object or null if no more files are
available. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileIterator(File... filesOrDirectories)
FileIterator using the specified 'filesOrDirectories' as root.
filesOrDirectories - Zero or more File objects, which are iterated
in the specified order (depth first)| Method Detail |
|---|
public File getFile()
null if no more files are available.
next()public boolean isRootFile()
true if the current file is one of the files originally
specified as one of the constructor file parameters, i.e. is a root file
or directory.
public File next()
throws IOException
File object or null if no more files are
available.
IOExceptiongetFile()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||