public final class NbProcessDescriptor extends Object implements Serializable
This allows to define arguments in format -user {USER_NAME} -do {ACTION} and then use MapFormat with defined values for USER_NAME and ACTION that will be substitued by into the arguments.
Constructor and Description |
---|
NbProcessDescriptor(String processName,
String arguments)
Create a new descriptor for the specified process, classpath switch, and classpath.
|
NbProcessDescriptor(String processName,
String arguments,
String info)
Create a new descriptor for the specified process, classpath switch, and classpath.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Process |
exec()
Executes the process with arguments provided in constructor.
|
Process |
exec(Format format)
Executes the process with arguments and processName formatted by the provided
format.
|
Process |
exec(Format format,
String[] envp)
Executes the process with arguments and processNme formatted by the provided
format.
|
Process |
exec(Format format,
String[] envp,
boolean appendEnv,
File cwd)
Executes the process with arguments, processName and envp formatted by the provided
format.
|
Process |
exec(Format format,
String[] envp,
File cwd)
Executes the process with arguments formatted by the provided
format.
|
String |
getArguments()
Getter the execution arguments of the process.
|
String |
getInfo()
Getter for the human readable info about the arguments.
|
String |
getProcessName()
Get the name of the executable to run.
|
int |
hashCode() |
public NbProcessDescriptor(String processName, String arguments)
processName
- the name of the executable to runarguments
- string for formating of arguments (may be quoted
)public NbProcessDescriptor(String processName, String arguments, String info)
processName
- the name of the executable to runarguments
- string for formating of arguments (may be quoted
)info
- info how to format the arguments (human-readable string)public String getProcessName()
public String getArguments()
public String getInfo()
public Process exec(Format format, String[] envp, File cwd) throws IOException
format
- format to be applied to arguments, process and envp supplied by user. It can be null
if no formatting should be done.envp
- list of properties to be applied to the process, or null
to leave unspecifiedcwd
- the working directory to use, or null
if this should not be specifiedIOException
- if the start of the process fails, or if setting the working directory is not supportedpublic Process exec(Format format, String[] envp, boolean appendEnv, File cwd) throws IOException
format
- format to be applied to arguments, process and envp supplied by user. It can be null
if no formatting should be done.envp
- list of properties to be applied to the process, or null
to leave unspecifiedappendEnv
- if true and envp
is not null
, append or replace JVM's environmentcwd
- the working directory to use, or null
if this should not be specifiedIOException
- if the start of the process fails, or if setting the working directory is not supportedpublic Process exec(Format format, String[] envp) throws IOException
format
- format to be aplied to arguments, process and envp suplied by user. It can be null
if no formatting should be done.envp
- list of properties to be applied to the process, or null
to leave unspecifiedIOException
- if the start of the process failspublic Process exec(Format format) throws IOException
format
- format to be aplied to arguments and process. It can be null
if no formatting should be done.IOException
- if the start of the process failspublic Process exec() throws IOException
IOException
- if the start of the process fails