|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.partnersoft.os.OsCommand
public class OsCommand
An operating-system specific, native command builder and manager.
OsCommand takes care of the various issues involved in starting native processes. Naive use of Runtime.exec() can cause lots of problems - incorrect starting directory, spaces in filenames, etc.
It serves as an object-oriented builder and runner, with the actual work being passed to com.partnersoft.system.RuntimeLib methods for execution.
Copyright 2008 Partner Software, Inc.
| Constructor Summary | |
|---|---|
OsCommand()
|
|
OsCommand(VfsFile file,
java.lang.String... arguments)
|
|
| Method Summary | |
|---|---|
void |
addArgument(java.lang.String argument)
|
void |
addArguments(java.lang.String... arguments)
|
void |
execAndHalt()
Executes the command and halts the current Java system. |
int |
execAndWait()
Executes the command, waits for it to finish, and returns the exit value. |
void |
execNoWait()
Executes the command and returns immediately, without waiting for it to finish. |
java.lang.String |
getCommand()
Gets the name or path of the command. |
VfsDirectory |
getDirectory()
|
java.util.List<java.lang.String> |
listArguments()
|
void |
setCommand(java.lang.String command)
Sets the name or path of the command as a string. |
void |
setCommandAsFile(VfsFile file)
|
void |
setDirectory(VfsDirectory directory)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OsCommand()
public OsCommand(VfsFile file,
java.lang.String... arguments)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void setCommandAsFile(VfsFile file)
throws java.io.IOException
java.io.IOExceptionpublic void addArgument(java.lang.String argument)
public void addArguments(java.lang.String... arguments)
public int execAndWait()
throws java.io.IOException
java.io.IOException
public void execNoWait()
throws java.io.IOException
java.io.IOException
public void execAndHalt()
throws java.io.IOException
java.io.IOExceptionpublic void setCommand(java.lang.String command)
public java.lang.String getCommand()
public java.util.List<java.lang.String> listArguments()
public VfsDirectory getDirectory()
public void setDirectory(VfsDirectory directory)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||