|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfiletools.filesearchtools.SimpleFileSearch
public abstract class SimpleFileSearch
Abstract base class for a simple recursive file search. It provides functionality for searching files and storing their names in in a primitive ascii file. In this file each line contains one filename. Derivied classes need to define which (sub-)directories should be searched and which filenames are valid (and to be stored).
Field Summary | |
---|---|
protected java.io.FileWriter |
outputFileWriter
|
Constructor Summary | |
---|---|
SimpleFileSearch()
|
Method Summary | |
---|---|
protected abstract boolean |
isDirToSearch(java.lang.String dir)
Derived classes need to define here which directories should be searched. |
protected abstract boolean |
isSearchedFileName(java.lang.String filename)
Derived classes need to define here which files are searched. |
protected abstract void |
processFile(java.io.File file)
Here concrete classes need to define what to do with a searched file which was found. |
int |
searchDir(java.io.File searchdir)
Searches the specified directory for files and stores the result in a file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.FileWriter outputFileWriter
Constructor Detail |
---|
public SimpleFileSearch()
Method Detail |
---|
public int searchDir(java.io.File searchdir)
IFileSearch
searchDir
in interface IFileSearch
searchdir
- Directory to search
IFileSearch.searchDir(java.io.File)
protected abstract void processFile(java.io.File file)
file
- File object which represents the found fileprotected abstract boolean isDirToSearch(java.lang.String dir)
dir
- Name of the directory, not the whole path!
protected abstract boolean isSearchedFileName(java.lang.String filename)
filename
- Name of the file, not its path!
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |