
public abstract class AbstractFileScanner extends Object implements Runnable
| Modifier and Type | Field and Description |
|---|---|
private File |
file |
private boolean |
followH |
| Constructor and Description |
|---|
AbstractFileScanner(File f) |
AbstractFileScanner(File f,
boolean followHidden) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract void |
exitDirectory(File directory)
Called every time the scanner exits a directory.
|
protected abstract void |
finish()
This method is called as soon as the scanning ends.
|
protected abstract void |
foundDirectory(File directory)
This method is called each time a directory is found.
|
protected abstract void |
foundFile(File f)
This method is called each time a new file is found.
|
void |
run() |
protected void |
scan(File f)
This recursive method scans the filesystem.
|
protected abstract void |
setup()
This method is called before starting the scanning.
|
private final File file
private final boolean followH
public AbstractFileScanner(File f)
f - the file or directory to start withpublic AbstractFileScanner(File f, boolean followHidden)
f - the file or directory to start withfollowHidden - true if the scanner should walk through hidden foldersprotected abstract void finish()
protected abstract void foundDirectory(File directory)
directory - the directory which has been foundprotected abstract void foundFile(File f)
f - the file which has been foundprotected void scan(File f)
f - The directory or file to start withprotected abstract void exitDirectory(File directory)
directory - the directory which has been scannedprotected abstract void setup()