com.panayotis.io
Class FileUtils
java.lang.Object
com.panayotis.io.FileUtils
public class FileUtils
- extends Object
This object is used to serch for an executable in the current $PATH.
- Author:
- teras
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileUtils
public FileUtils()
getExec
public static final File getExec(String path)
- Check if the specified file path is a valid file.
- Parameters:
path - The file path to check if it is valid.
- Returns:
- Pointer to this file, if this file is valid. Otherwise return null.
findPathExec
public static final String findPathExec(String prog)
- This method browses current path to search for a file. Typically this should be
an executable, but it is impossible under Java to check if this file has the execution
bit on. Apart from the user defined $PATH variable, common bin-directory places
are searched.
- Parameters:
prog - The file to check if it exists in the system $PATH
- Returns:
- The path of the specified program. If it is not found, the program name is returned.
Copyright © 2013. All Rights Reserved.