Class PathBuilder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBuilds a path from the passed argument strings.static PathBuilderReturns an instance of PathBuilder with all checks enabled (recommended).protected static booleanprotected static booleanisPathRoot(String pathString)
-
Constructor Details
-
PathBuilder
public PathBuilder()
-
-
Method Details
-
getPathBuilder
Returns an instance of PathBuilder with all checks enabled (recommended).- Returns:
-
buildPath
Builds a path from the passed argument strings. This path will be compatible with the local filesystem.
If the args contain variables enclosed in square brackets (
[ ]), they will be replaced with values in the built path. There are several built-in variables available, listed below. Any text between square brackets that does not match these will be replaced by a matching System environment variable if one is available.Built-in variables include:
- [tmp] An available temp directory (Java Temp directory,
c:\\temp, $TMPDIR, %TEMP%, etc.) - [user] The OS user directory (~, user.home, etc)
This method will run several checks by default to ensure that the built path does not point to unintended areas of the filesystem. If these checks are violated, a RuntimeException will be thrown. If needed in special cases, the behavior of these checks can be modified via the linked fluent constructor methods below.
- Parameters:
args- entries with which to construct the filesystem path- Returns:
- a local filesystem path
- Throws:
RuntimeExceptionIOException
- [tmp] An available temp directory (Java Temp directory,
-
hasCTempDir
- Throws:
IOException
-
isPathRoot
-