public final class ExecParseUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
QUOTE_CHAR |
static java.lang.String |
WHITESPACE |
Modifier and Type | Method and Description |
---|---|
protected static boolean |
isDoubleQuoted(java.lang.String input)
Tests if the input is enclosed within a double-
QUOTE_CHAR string |
protected static boolean |
isSingleQuoted(java.lang.String input)
Tests if the input is enclosed within
QUOTE_CHAR characters |
static java.util.List<java.lang.String> |
splitToWhiteSpaceSeparatedTokens(java.lang.String input)
Splits the input line string by
WHITESPACE . |
public static final java.lang.String WHITESPACE
public static final java.lang.String QUOTE_CHAR
public static java.util.List<java.lang.String> splitToWhiteSpaceSeparatedTokens(java.lang.String input)
WHITESPACE
. Supports quoting the
white-spaces with a QUOTE_CHAR
. A quote itself can also be
enclosed within #QUOTE_CHAR
#QUOTE_CHAR
. More than two
double-quotes in a sequence is not allowed. Nested quotes are not
allowed."arg 1" arg2 will return the tokens arg 1
,
arg2
The string
""arg 1"" "arg2" arg 3 will return the tokens "arg 1"
, arg2
,arg
and 3
input
- the input to split.protected static boolean isSingleQuoted(java.lang.String input)
QUOTE_CHAR
charactersinput
- a not null Stringprotected static boolean isDoubleQuoted(java.lang.String input)
QUOTE_CHAR
stringinput
- a not null StringCopyright © 2016 Red Hat. All Rights Reserved.