|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.exec.util.StringUtils
public class StringUtils
Supplement of commons-lang, the stringSubstitution() was in a simpler implementation available in an older commons-lang implementation. This class is not part of the public API and could change without warning.
Constructor Summary | |
---|---|
StringUtils()
|
Method Summary | |
---|---|
static String |
fixFileSeparatorChar(String arg)
Fixes the file separator char for the target platform using the following replacement. |
static boolean |
isQuoted(String argument)
Determines if this is a quoted argument - either single or double quoted. |
static String |
quoteArgument(String argument)
Put quotes around the given String if necessary. |
static String[] |
split(String input,
String splitChar)
Split a string into an array of strings based on a separator. |
static StringBuffer |
stringSubstitution(String argStr,
Map vars,
boolean isLenient)
Perform a series of substitutions. |
static String |
toString(String[] strings,
String separator)
Concatenates an array of string using a separator. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringUtils()
Method Detail |
---|
public static StringBuffer stringSubstitution(String argStr, Map vars, boolean isLenient)
argStr
- the argument string to be processedvars
- name/value pairs used for substitutionisLenient
- ignore a key not found in vars or throw a RuntimeException?
public static String[] split(String input, String splitChar)
input
- what to splitsplitChar
- what to split on
public static String fixFileSeparatorChar(String arg)
arg
- the argument to fix
public static String toString(String[] strings, String separator)
strings
- the strings to concatenateseparator
- the separator between two strings
public static String quoteArgument(String argument)
If the argument doesn't include spaces or quotes, return it as is. If it contains double quotes, use single quotes - else surround the argument by double quotes.
argument
- the argument to be quoted
IllegalArgumentException
- If argument contains both types of quotespublic static boolean isQuoted(String argument)
argument
- the argument to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |