|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.util.ExampleCommandLineArgument
@ThreadSafety(level=COMPLETELY_THREADSAFE) public final class ExampleCommandLineArgument
This class provides access to a form of a command-line argument that is safe to use in a shell. It includes both forms for both Unix (bash shell specifically) and Windows, since there are differences between the two platforms. Quoting of arguments is performed with the following goals:
parseExampleCommandLine(java.lang.String)
method regardless of the platform. This
method can be used when needing to parse a command line that was generated
by this class outside of a shell environment, e.g. if the full command line
was read from a file. Special characters that are escaped include |, &,
;, (, ), !, ", ', *, ?, $, and `.
Method Summary | |
---|---|
static ExampleCommandLineArgument |
getCleanArgument(java.lang.String argument)
Return a clean form of the specified argument that can be used directly on the command line. |
java.lang.String |
getLocalForm()
Return the form of the argument that is safe to use in the command line shell of the current operating system platform. |
java.lang.String |
getRawForm()
Return the original, unquoted raw form of the argument. |
java.lang.String |
getUnixForm()
Return the form of the argument that is safe to use in a Unix command line shell. |
static java.lang.String |
getUnixForm(java.lang.String argument)
Return a clean form of the specified argument that can be used directly on a Unix command line. |
java.lang.String |
getWindowsForm()
Return the form of the argument that is safe to use in a Windows command line shell. |
static java.lang.String |
getWindowsForm(java.lang.String argument)
Return a clean form of the specified argument that can be used directly on a Windows command line. |
static java.util.List<java.lang.String> |
parseExampleCommandLine(java.lang.String exampleCommandLine)
Return a list of raw parameters that were parsed from the specified String. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.String getRawForm()
getCleanArgument(java.lang.String)
method.
public java.lang.String getUnixForm()
public java.lang.String getWindowsForm()
public java.lang.String getLocalForm()
public static ExampleCommandLineArgument getCleanArgument(java.lang.String argument)
argument
- The raw argument to convert into a clean form that can
be used directly on the command line.
public static java.lang.String getUnixForm(java.lang.String argument)
argument
- The raw argument to convert into a clean form that can
be used directly on the Unix command line.
public static java.lang.String getWindowsForm(java.lang.String argument)
argument
- The raw argument to convert into a clean form that can
be used directly on the Windows command line.
public static java.util.List<java.lang.String> parseExampleCommandLine(java.lang.String exampleCommandLine)
getCleanArgument(java.lang.String)
. It perfectly handles any String that was
passed into this method, but it won't behave exactly as any single shell
behaves because they aren't consistent. For instance, it will never
treat \\ as an escape character.
exampleCommandLine
- The command line to parse.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |