public class ExecUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
private static String[] |
EXECUTABLE_EXTENSIONS
The set of extensions (including the empty extension) to append to the searched executable name.
|
| Constructor and Description |
|---|
ExecUtils() |
| Modifier and Type | Method and Description |
|---|---|
static File |
find(String executable,
File... dirs)
Tries to find an executable with the given name.
|
private static File |
findExecutableInDirectory(String executable,
File directory)
Tries to find the given executable (specified by its name) in the given directory.
|
static File |
findExecutableInSystemPath(String executable)
Tries to find the given executable (specified by its name) in the system's path.
|
private static final String[] EXECUTABLE_EXTENSIONS
public static File find(String executable, File... dirs)
executable - the name of the program to find, generally without the extensiondirs - optional set of directories in which the program need to be searched before checking the system's
path.null if not foundprivate static File findExecutableInDirectory(String executable, File directory)
EXECUTABLE_EXTENSIONS, and checks that this file is executable.executable - the name of the program to find, generally without the extensiondirectory - the directory in which the program is searched.null otherwise. If the given directory is
null or not a real directory, it also returns null.public static File findExecutableInSystemPath(String executable)
EXECUTABLE_EXTENSIONS, and checks that this file is executable.executable - the name of the program to find, generally without the extensionnull otherwise.Copyright © 2018. All rights reserved.