java.lang.Object | |
↳ | com.pnfsoftware.jeb.util.base.PathProcessor |
The path processor class is used to resolve flexible paths (flexi-paths) and lists of multiple flexi-paths (multi-flexi-paths are flexi-paths separated by semicolons).
A flexible path can contain environment variables, Windows-style (%xxx%) or Linux-style ($xxx). It may also contain alternatives, separated by pipes and enclosed in parenthesis.
Example: /root/($FOO|user)/$BAR/dir1
When alternatives are present, the first plausible one is used.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
public static final PathProcessor | ENV |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PathProcessor()
Standard constructor.
| |||||||||||
PathProcessor(Map<String, String> smap)
Construct a processor with a custom environment map.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
List<String> |
decodeFlexiMultiPath(String mp)
Decode multiple flexi-paths, composed of one or more flexi-paths separated by semi-columns.
| ||||||||||
String |
decodeFlexiPath(String p)
Decode a single flexi-path.
| ||||||||||
String |
decodeSinglePath(String p)
Decode a simple path (no flexi path), by injecting environment variable into it.
| ||||||||||
String |
substituteEnvironmentVariables(String p)
Inject Environment variables into a String using $var or %var%.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Standard constructor.
Construct a processor with a custom environment map. Usage is discouraged.
Decode multiple flexi-paths, composed of one or more flexi-paths separated by semi-columns.
mp | a multi-path |
---|
Decode a single flexi-path. A flexible path can contain environment variables; it may also
contain alternatives, separated by pipes and enclosed in parenthesis. Example:
/root/($FOO|user)/$BAR/dir1
. If alternatives are present, the first plausible
one is returned.
p | a flexi-path |
---|
Decode a simple path (no flexi path), by injecting environment variable into it. In addition
to substituteEnvironmentVariables(String)
, it consider the path as a full one,
allowing to replace the first ~ by user.home. Note that it only manage the homepath of
current user (~/xxx), not the one from a different user (~user)
p | path with environment variables |
---|
Inject Environment variables into a String using $var or %var%.
p | path with environment variables |
---|