|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.massimo.utils.FileFinder
public class FileFinder
Use known paths, such as the classpath and the environment's PATHs, to find files
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
log
|
Constructor Summary | |
---|---|
FileFinder()
|
Method Summary | |
---|---|
static boolean |
addJavaPath(String path)
Add all directories in path to the Java file search paths |
static boolean |
addNativePath(String path)
Add all directories in path to the native file search paths |
protected static boolean |
addPath(Collection<String> collection,
String path)
|
static boolean |
addTextPath(String path)
Add all directories in path to the text file search paths |
static String |
dump()
Debug aid |
static String |
findFile(Collection<String> paths,
String name)
|
static String |
findFile(String name)
Search all known paths |
static String |
findJavaFile(String name)
Search the java class paths |
static String |
findNativeFile(String name)
Search the native library locations |
static String |
findTextFile(String name)
Search text or property file locations. |
protected static void |
loadJavaPaths()
Load java search paths. |
protected static void |
loadNativePaths()
Load native search paths. |
protected static void |
loadTextPaths()
Load text search paths. |
static void |
resetPaths()
Reset all paths to their default values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger log
Constructor Detail |
---|
public FileFinder()
Method Detail |
---|
public static boolean addJavaPath(String path)
path
- Path to add
public static boolean addNativePath(String path)
path
- Path to add
protected static boolean addPath(Collection<String> collection, String path)
collection
- The path, or paths, are added to this colectionpath
- Path, or list of paths, to add
public static boolean addTextPath(String path)
path
- Path to add
public static String dump()
public static String findFile(Collection<String> paths, String name)
paths
- A Collection of paths to searchname
- File name to search for
public static String findFile(String name)
name
- File name to search for
public static String findJavaFile(String name)
name
- File name to search for
public static String findNativeFile(String name)
name
- File name to search for
public static String findTextFile(String name)
name
- File name to search for
protected static void loadJavaPaths()
protected static void loadNativePaths()
protected static void loadTextPaths()
public static void resetPaths()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |