Package tv.hd3g.processlauncher.cmdline
Class ExecutableFinder
java.lang.Object
tv.hd3g.processlauncher.cmdline.ExecutableFinder
It will resolve/find valid executable files in *NIX and valid executable extensions in Windows.
On system PATH, classpath, current dir, and local user dir (/bin).
ThreadSafe
-
Field Summary
FieldsModifier and TypeFieldDescriptionunmodifiableList Specified by -Dexecfinder.searchdir=path1;path2... or path1:path2... on *Nix systems.Return exists and isDirectory and canReadunmodifiableList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddLocalPath(String relativeUserHomePath) Put in top priority.Put in top priority.Can add .exe to name if OS == Windows and if it's missing.registerExecutable(String name, File fullPath)
-
Field Details
-
isValidDirectory
Return exists and isDirectory and canRead -
WINDOWS_EXEC_EXTENSIONS
unmodifiableList -
GLOBAL_DECLARED_DIRS
unmodifiableList Specified by -Dexecfinder.searchdir=path1;path2... or path1:path2... on *Nix systems.
-
-
Constructor Details
-
ExecutableFinder
public ExecutableFinder()
-
-
Method Details
-
getFullPathToString
-
getFullPath
- Returns:
- unmodifiableList
-
addLocalPath
Put in top priority. Path / or \ will be corrected -
addPath
Put in top priority. -
registerExecutable
- Throws:
IOException
-
get
Can add .exe to name if OS == Windows and if it's missing.- Parameters:
name- can be a simple exec name, or a full path.- Returns:
- never null
- Throws:
FileNotFoundException- if exec don't exists or is not correctly registed.
-