public class CommandlineImpl extends java.lang.Object implements Commandline
DEFAULT_TIMEOUT
Constructor and Description |
---|
CommandlineImpl() |
CommandlineImpl(boolean logEnabled) |
CommandlineImpl(long timeout) |
CommandlineImpl(long timeout,
boolean logEnabled) |
Modifier and Type | Method and Description |
---|---|
ProcessOutput |
execute(java.lang.String cmd)
Execute command line
|
ProcessOutput |
execute(java.lang.String[] cmd)
Execute command line
|
ProcessOutput |
execute(java.lang.String[] cmd,
java.io.File dir)
Execute command line
|
ProcessOutput |
execute(java.lang.String[] cmd,
java.lang.String[] environment)
Execute command line
|
ProcessOutput |
execute(java.lang.String[] cmd,
java.lang.String[] environment,
java.io.File dir)
Execute command line
|
ProcessOutput |
execute(java.lang.String cmd,
java.io.File dir)
Execute command line
|
ProcessOutput |
execute(java.lang.String cmd,
java.lang.String[] environment)
Execute command line
|
ProcessOutput |
execute(java.lang.String cmd,
java.lang.String[] environment,
java.io.File dir)
Execute command line
|
long |
getTimeout() |
boolean |
isLogEnabled() |
void |
log(java.lang.String text)
Print some log information.
|
protected void |
log(java.lang.String[] cmdarray,
java.lang.String[] envp,
java.io.File dir) |
protected void |
log(java.lang.String cmd,
java.lang.String[] envp,
java.io.File dir) |
protected ProcessOutput |
read(java.lang.Process process) |
void |
setLogEnabled(boolean logEnabled) |
void |
setTimeout(long timeout) |
public CommandlineImpl()
public CommandlineImpl(long timeout)
public CommandlineImpl(boolean logEnabled)
public CommandlineImpl(long timeout, boolean logEnabled)
protected ProcessOutput read(java.lang.Process process) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public void log(java.lang.String text)
Commandline
log
in interface Commandline
protected void log(java.lang.String cmd, java.lang.String[] envp, java.io.File dir)
protected void log(java.lang.String[] cmdarray, java.lang.String[] envp, java.io.File dir)
public ProcessOutput execute(java.lang.String cmd, java.lang.String[] environment, java.io.File dir) throws java.io.IOException, java.lang.InterruptedException
execute
in interface Commandline
dir
- file working directorycmd
- command linejava.io.IOException
java.lang.InterruptedException
public ProcessOutput execute(java.lang.String cmd, java.lang.String[] environment) throws java.io.IOException, java.lang.InterruptedException
execute
in interface Commandline
cmd
- command linejava.io.IOException
java.lang.InterruptedException
public ProcessOutput execute(java.lang.String cmd, java.io.File dir) throws java.io.IOException, java.lang.InterruptedException
execute
in interface Commandline
dir
- file working directorycmd
- command linejava.io.IOException
java.lang.InterruptedException
public ProcessOutput execute(java.lang.String cmd) throws java.io.IOException, java.lang.InterruptedException
execute
in interface Commandline
cmd
- command linejava.io.IOException
java.lang.InterruptedException
public ProcessOutput execute(java.lang.String[] cmd, java.lang.String[] environment, java.io.File dir) throws java.io.IOException, java.lang.InterruptedException
execute
in interface Commandline
dir
- file working directorycmd
- command linejava.io.IOException
java.lang.InterruptedException
public ProcessOutput execute(java.lang.String[] cmd, java.lang.String[] environment) throws java.io.IOException, java.lang.InterruptedException
execute
in interface Commandline
cmd
- command linejava.io.IOException
java.lang.InterruptedException
public ProcessOutput execute(java.lang.String[] cmd, java.io.File dir) throws java.io.IOException, java.lang.InterruptedException
execute
in interface Commandline
dir
- file working directorycmd
- command linejava.io.IOException
java.lang.InterruptedException
public ProcessOutput execute(java.lang.String[] cmd) throws java.io.IOException, java.lang.InterruptedException
execute
in interface Commandline
cmd
- command linejava.io.IOException
java.lang.InterruptedException
public long getTimeout()
getTimeout
in interface Commandline
public void setTimeout(long timeout)
setTimeout
in interface Commandline
public boolean isLogEnabled()
isLogEnabled
in interface Commandline
public void setLogEnabled(boolean logEnabled)