util
Class FileFinder
java.lang.Object
util.FileFinder
public class FileFinder
- extends java.lang.Object
This class can be used to instanciate an object for findng files
of certain file extensions in a specified directory and all its
subdirectories
- Author:
- Frank Bruns, but the basics of the code originate from the
book "Java ist auch eine Insel" by Christian Ullenboom
Field Summary |
java.util.List<java.io.File> |
files
|
Constructor Summary |
FileFinder(java.lang.String startDirectory,
java.lang.String ext)
Creates a new object of this class with the specified parameter. |
Method Summary |
java.lang.String[] |
getFoundFilePathes()
Returns the absolute file pathes of every found file |
java.util.List<java.io.File> |
getFoundFiles()
Returns a list of found files |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
files
public java.util.List<java.io.File> files
FileFinder
public FileFinder(java.lang.String startDirectory,
java.lang.String ext)
- Creates a new object of this class with the specified parameter.
- Parameters:
startDirectory
- diretory to start in looking for filesext
- file extension to look for, e.g. ".txt" or ".bsh"
getFoundFiles
public java.util.List<java.io.File> getFoundFiles()
- Returns a list of found files
- Returns:
- list of found files
getFoundFilePathes
public java.lang.String[] getFoundFilePathes()
- Returns the absolute file pathes of every found file
- Returns:
- String array of absolute file pathes