|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.replicator.util.ProcessHelper
public class ProcessHelper
Implements a simple helper to execute operating system processes with consistent logging and handling of errors.
| Constructor Summary | |
|---|---|
ProcessHelper()
Create a new helper. |
|
| Method Summary | |
|---|---|
void |
configure()
Configure the helper. |
void |
exec(java.lang.String description,
java.lang.String baseCommand)
Convenience method to execute a command that is given as a single string. |
void |
exec(java.lang.String description,
java.lang.String[] baseCommand)
Convenience method to execute command without providing input or output. |
void |
exec(java.lang.String description,
java.lang.String[] baseCommand,
java.io.InputStream stdin,
java.io.File stdout,
java.io.File stderr,
boolean stdoutAppend,
boolean stderrAppend)
Execute a command accompanied by a description. |
java.lang.String |
getCmdPrefix()
|
java.util.List<java.lang.String> |
getOutputLines()
|
java.lang.String[] |
mergeArrays(java.lang.String[] a1,
java.lang.String[] a2)
|
void |
setCmdPrefix(java.lang.String cmdPrefix)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProcessHelper()
| Method Detail |
|---|
public java.lang.String getCmdPrefix()
public void setCmdPrefix(java.lang.String cmdPrefix)
public void configure()
public void exec(java.lang.String description,
java.lang.String[] baseCommand,
java.io.InputStream stdin,
java.io.File stdout,
java.io.File stderr,
boolean stdoutAppend,
boolean stderrAppend)
throws BackupException
description - Text description of the commandbaseCommand - Command as an array but without 'sudo' or other prefixstdin - InputStream for process stdinstdout - File to receive stdoutstderr - File to receive stderrstdoutAppend - If true append to stdout filestderrAppend - If true append to stderr file
BackupException - If the command fails
public void exec(java.lang.String description,
java.lang.String[] baseCommand)
throws BackupException
description - Text description of the commandbaseCommand - Command as an array but without 'sudo' or other prefix
BackupException - If the command fails
public void exec(java.lang.String description,
java.lang.String baseCommand)
throws BackupException
description - Text description of the commandbaseCommand - Un-prefixed command; arguments must be space-separate
BackupException - If the command fails
public java.lang.String[] mergeArrays(java.lang.String[] a1,
java.lang.String[] a2)
public java.util.List<java.lang.String> getOutputLines()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||