Class ExecParseUtils
- java.lang.Object
-
- org.apache.camel.component.exec.impl.ExecParseUtils
-
public final class ExecParseUtils extends Object
Utility class for parsing, used by the Camel Exec component.
Note: the class should be dropped, when the commons-exec library implements similar functionality.
-
-
Field Summary
Fields Modifier and Type Field Description static String
QUOTE_CHAR
static String
WHITESPACE
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static boolean
isDoubleQuoted(String input)
Tests if the input is enclosed within a double-QUOTE_CHAR
stringprotected static boolean
isSingleQuoted(String input)
Tests if the input is enclosed withinQUOTE_CHAR
charactersstatic List<String>
splitToWhiteSpaceSeparatedTokens(String input)
Splits the input line string byWHITESPACE
.
-
-
-
Field Detail
-
WHITESPACE
public static final String WHITESPACE
- See Also:
- Constant Field Values
-
QUOTE_CHAR
public static final String QUOTE_CHAR
- See Also:
- Constant Field Values
-
-
Method Detail
-
splitToWhiteSpaceSeparatedTokens
public static List<String> splitToWhiteSpaceSeparatedTokens(String input)
Splits the input line string byWHITESPACE
. Supports quoting the white-spaces with aQUOTE_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.
E.g. The string"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
and3
- Parameters:
input
- the input to split.- Returns:
- a not-null list of tokens
-
isSingleQuoted
protected static boolean isSingleQuoted(String input)
Tests if the input is enclosed withinQUOTE_CHAR
characters- Parameters:
input
- a not null String- Returns:
- true if the regular expression is matched
-
isDoubleQuoted
protected static boolean isDoubleQuoted(String input)
Tests if the input is enclosed within a double-QUOTE_CHAR
string- Parameters:
input
- a not null String- Returns:
- true if the regular expression is matched
-
-