|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dtolabs.rundeck.core.cli.CLIUtils
public class CLIUtils
CLIUtils provides utility functions
Field Summary | |
---|---|
static org.apache.commons.collections.Predicate |
stringContainsQuotePredicate
evaluates to true if a string contains a quote |
static org.apache.commons.collections.Predicate |
stringContainsWhitespacePredicate
evaluates to true if a string contains a space |
static Converter<java.lang.String,java.lang.String> |
UNIX_ARGUMENT_QUOTE
Converter that can escape shell-special characters |
static Converter<java.lang.String,java.lang.String> |
UNIX_SHELL_ESCAPE
Converter that can escape shell-special characters |
Constructor Summary | |
---|---|
CLIUtils()
|
Method Summary | |
---|---|
static Converter<java.lang.String,java.lang.String> |
argumentQuoteForOperatingSystem(java.lang.String type)
|
static Converter<java.lang.String,java.lang.String> |
characterEscapeForOperatingSystem(java.lang.String type)
|
static boolean |
containsQuote(java.lang.String arg)
Return true if the string contains any whitespace |
static boolean |
containsSpace(java.lang.String arg)
Return true if the string contains any whitespace |
static java.lang.String |
escapeUnixShellChars(java.lang.String str)
|
static void |
escapeUnixShellChars(java.lang.StringBuilder out,
java.lang.String str)
|
static java.lang.String |
generateArgline(java.lang.String scriptpath,
java.lang.String[] args)
Create an appropriately quoted argline to use given the command (script path) and argument strings. |
static java.lang.String |
generateArgline(java.lang.String scriptpath,
java.lang.String[] args,
java.lang.Boolean unsafe)
Create an appropriately quoted argline to use given the command (script path) and argument strings. |
static java.lang.String |
generateArgline(java.lang.String scriptpath,
java.lang.String[] args,
java.lang.String separator,
java.lang.Boolean unsafe)
Create an appropriately quoted argline to use given the command (script path) and argument strings. |
static java.lang.String |
quoteUnixShellArg(java.lang.String arg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final org.apache.commons.collections.Predicate stringContainsWhitespacePredicate
public static final org.apache.commons.collections.Predicate stringContainsQuotePredicate
public static final Converter<java.lang.String,java.lang.String> UNIX_ARGUMENT_QUOTE
public static final Converter<java.lang.String,java.lang.String> UNIX_SHELL_ESCAPE
Constructor Detail |
---|
public CLIUtils()
Method Detail |
---|
public static java.lang.String generateArgline(java.lang.String scriptpath, java.lang.String[] args)
scriptpath
- path to command or scriptargs
- arguments to pass to the command
public static java.lang.String generateArgline(java.lang.String scriptpath, java.lang.String[] args, java.lang.Boolean unsafe)
scriptpath
- path to command or scriptargs
- arguments to pass to the commandunsafe
- whether to use backwards-compatible, known-insecure quoting
public static java.lang.String generateArgline(java.lang.String scriptpath, java.lang.String[] args, java.lang.String separator, java.lang.Boolean unsafe)
scriptpath
- path to command or scriptargs
- arguments to pass to the commandseparator
- character to use to separate argumentsunsafe
- whether to use backwards-compatible, known-insecure quoting
public static boolean containsSpace(java.lang.String arg)
arg
-
public static boolean containsQuote(java.lang.String arg)
arg
-
public static java.lang.String quoteUnixShellArg(java.lang.String arg)
public static Converter<java.lang.String,java.lang.String> characterEscapeForOperatingSystem(java.lang.String type)
public static Converter<java.lang.String,java.lang.String> argumentQuoteForOperatingSystem(java.lang.String type)
public static java.lang.String escapeUnixShellChars(java.lang.String str)
public static void escapeUnixShellChars(java.lang.StringBuilder out, java.lang.String str)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |