|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jaulp.file.search.FileSearchUtils
public class FileSearchUtils
The Class FileSearchUtils provides methods for searching in directories.
Constructor Summary | |
---|---|
FileSearchUtils()
|
Method Summary | |
---|---|
static boolean |
containsFile(java.io.File parent,
java.io.File search)
Checks if the given file contains only in the parent file, not in the subdirectories. |
static boolean |
containsFile(java.io.File fileToSearch,
java.lang.String pathname)
Checks if the given file contains in the parent file. |
static boolean |
containsFileRecursive(java.io.File parent,
java.io.File search)
Checks if the given file contains only in the parent file recursively. |
static long |
countAllFilesInDirectory(java.io.File dir,
long length,
boolean includeDirectories)
Counts all the files in a directory recursively. |
static java.util.List<java.io.File> |
findFiles(java.io.File dir,
java.lang.String filenameToSearch)
Finds all files that match the search pattern. |
static java.util.Vector<java.io.File> |
findFiles(java.lang.String start,
java.lang.String[] extensions)
Searches for files with the given extensions and adds them to a Vector. |
static java.util.List<java.io.File> |
findFilesRecursive(java.io.File dir,
java.lang.String filenameToSearch)
Finds all files that match the search pattern. |
static java.util.List<java.io.File> |
getAllFilesFromDirRecursive(java.io.File dir)
Gets all the files from directory recursive. |
static long |
getFileLengthInKilobytes(java.io.File dir)
Gets the file length from the given file in Kilobytes. |
static long |
getFileLengthInMegabytes(java.io.File dir)
Gets the file length from the given file in Megabytes. |
static java.util.List<java.io.File> |
listDirs(java.io.File dir)
List the directories from the given file(directory). |
static boolean |
match(java.lang.String stringToMatch,
java.lang.String[] suffixes)
Checks the given String matches the given suffixes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileSearchUtils()
Method Detail |
---|
public static boolean containsFile(java.io.File parent, java.io.File search)
parent
- The parent directory to search.search
- The file to search.
public static boolean containsFile(java.io.File fileToSearch, java.lang.String pathname)
fileToSearch
- The parent directory to search.pathname
- The file to search.
public static boolean containsFileRecursive(java.io.File parent, java.io.File search)
parent
- The parent directory to search.search
- The file to search.
public static java.util.List<java.io.File> findFiles(java.io.File dir, java.lang.String filenameToSearch)
dir
- The directory to search.filenameToSearch
- The search pattern. Allowed wildcards are "*" and "?".
public static java.util.Vector<java.io.File> findFiles(java.lang.String start, java.lang.String[] extensions)
start
- The path to the file.extensions
- The extensions to find.
public static java.util.List<java.io.File> findFilesRecursive(java.io.File dir, java.lang.String filenameToSearch)
dir
- The directory to search.filenameToSearch
- The search pattern. Allowed wildcards are "*" and "?".
public static long countAllFilesInDirectory(java.io.File dir, long length, boolean includeDirectories)
dir
- the directory.length
- the current length. By start is this 0.includeDirectories
- If this is true then the directories are in the count too.
public static long getFileLengthInKilobytes(java.io.File dir)
dir
- the dir
public static long getFileLengthInMegabytes(java.io.File dir)
dir
- the directory
public static java.util.List<java.io.File> getAllFilesFromDirRecursive(java.io.File dir)
dir
- the directory
public static java.util.List<java.io.File> listDirs(java.io.File dir)
dir
- the directory.
public static boolean match(java.lang.String stringToMatch, java.lang.String[] suffixes)
stringToMatch
- The string to compare.suffixes
- An array with suffixes.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |