|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.kde.koala.KShell
public class KShell
\namespace KShell Provides some basic POSIX shell and bash functionality.
KStringHandler| Field Summary | |
|---|---|
static int |
AbortOnMeta
|
static int |
BadQuoting
|
static int |
FoundMeta
|
static int |
NoError
Status codes from splitArgs() |
static int |
NoOptions
Flags for splitArgs(). |
static int |
TildeExpand
|
| Constructor Summary | |
|---|---|
KShell()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
homeDir(java.lang.String user)
Obtain a user's home directory. |
static java.lang.String |
joinArgs(java.lang.String[] args)
Quotes and joins args together according to POSIX shell rules. |
static java.lang.String |
joinArgsDQ(java.lang.String[] args)
Same as above, but $'' is used instead of '' for the quoting. |
static java.util.ArrayList |
splitArgs(java.lang.String cmd)
|
static java.util.ArrayList |
splitArgs(java.lang.String cmd,
int flags)
|
static java.util.ArrayList |
splitArgs(java.lang.String cmd,
int flags,
int[] err)
Splits cmd according to POSIX shell word splitting and quoting rules. |
static java.lang.String |
tildeExpand(java.lang.String path)
Performs tilde expansion on path. Interprets "~/path" and
"~user/path". |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NoOptions
public static final int TildeExpand
public static final int AbortOnMeta
public static final int NoError
public static final int BadQuoting
public static final int FoundMeta
| Constructor Detail |
|---|
public KShell()
| Method Detail |
|---|
public static java.util.ArrayList splitArgs(java.lang.String cmd,
int flags,
int[] err)
cmd according to POSIX shell word splitting and quoting rules.
Can optionally perform tilde expansion and/or abort if it finds shell
meta characters it cannot process.
cmd - the command to splitflags - operation flags, see Optionserr - if not NULL, a status code will be stored at the pointer
target, see Errors
public static java.util.ArrayList splitArgs(java.lang.String cmd,
int flags)
public static java.util.ArrayList splitArgs(java.lang.String cmd)
public static java.lang.String joinArgs(java.lang.String[] args)
args together according to POSIX shell rules.
args - a list of strings to quote and join
public static java.lang.String joinArgsDQ(java.lang.String[] args)
args - a list of strings to quote and join
public static java.lang.String tildeExpand(java.lang.String path)
path. Interprets "~/path" and
"~user/path".
path - the path to tilde-expand
public static java.lang.String homeDir(java.lang.String user)
user's home directory.
user - The name of the user whose home dir should be obtained.
An empty string denotes the current user.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||