public class ArgumentUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Properties |
convertStringToProperties(String propertiesString)
Converts the given properties String to a Properties object.
|
static String |
escapeCommaDelimitedPathsForScript(String input)
Returns an escaped version of the given comma-delmited paths input String for a Batch or Shell script.
|
static String |
escapeForScript(String input)
Returns an escaped version of the given input String for a Batch or Shell script.
|
static String |
prefixWithDash(String input)
Prefixes the given input String with a dash (-).
|
static String |
resolvePath(String folder,
String workspacePath)
Resolves a folder name to an absolute path.
|
static String |
wrapInDoubleQuotes(String input)
Wraps the given input String in double quotes.
|
public static String escapeForScript(String input)
For comma-delimited path Strings, use escapeCommaDelimitedPathsForScript(String) instead as this method does not
account for the possibility of the user surrounding each path with double quotes.
If the input String is null/empty or does not require escaping, it is returned unchanged.
input - the String to escapeStringpublic static String escapeCommaDelimitedPathsForScript(String input)
This method accounts for the possibility of the user surrounding each path in the input String with double quotes. For
all other Strings, use escapeForScript(String) instead.
If the input String is null/empty or does not require escaping, it is returned unchanged.
input - the comma-delimited paths String to escapeStringpublic static String wrapInDoubleQuotes(String input)
If the input String is null/empty or is already wrapped in double quotes, it is returned unchanged.
input - the String to wrap in double quotesStringpublic static String prefixWithDash(String input)
If the input String is already prefixed with a dash, it is returned unchanged.
input - the String to prefixStringpublic static Properties convertStringToProperties(String propertiesString) throws IOException
If the given properties String is null/empty, an empty Properties object is returned.
propertiesString - the String to convertProperties objectIOException - if an error occurred during conversionProperties.load(Reader)Copyright © 2016–2022. All rights reserved.