org.expasy.jpl.commons.base.io
Class FileFinder
java.lang.Object
org.expasy.jpl.commons.base.io.FileFinder
public final class FileFinder
- extends Object
Class to find all files matching a regular expression in a directory tree.
- Version:
- 1.0
- Author:
- Markus Muller
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileFinder
public FileFinder()
getFiles
public static List<File> getFiles(String root,
String regex)
throws FileNotFoundException
- Throws:
FileNotFoundException
getFiles
public static List<File> getFiles(String root,
String regex,
boolean recurse)
throws FileNotFoundException
- Find all files in the directory sub-tree under root
- Parameters:
root - Root directory for searchregex - Regular expression to match file namerecurse - recursive search if true
- Returns:
- List of matched files throws FileNotFoundException if root does
not exist or is not a directory
- Throws:
FileNotFoundException
getFiles
public static List<File> getFiles(String root,
Pattern pattern)
throws FileNotFoundException
- Throws:
FileNotFoundException
getFiles
public static List<File> getFiles(String root,
Pattern pattern,
boolean recurse)
throws FileNotFoundException
- Find all files in the directory sub-tree under root
- Parameters:
root - Root directory for searchpattern - Regular expression pattern to match file namerecurse - recursive search if true
- Returns:
- List of matched files throws FileNotFoundException if root does
not exist or is not a directory
- Throws:
FileNotFoundException
Copyright (c) 2012 Swiss Institute of Bioinformatics. All rights reserved.