Class NbProcessDescriptor
java.lang.Object
org.openide.execution.NbProcessDescriptor
- All Implemented Interfaces:
Serializable
Encapsulates start information for a process. It allows the user to
specify the process name to execute and arguments to provide. The progammer
then uses method exec to start the process and can pass additional format that
will be applied to arguments.
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.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNbProcessDescriptor
(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. -
Method Summary
Modifier and TypeMethodDescriptionboolean
exec()
Executes the process with arguments provided in constructor.Executes the process with arguments and processName formatted by the provided format.Executes the process with arguments and processNme formatted by the provided format.Executes the process with arguments, processName and envp formatted by the provided format.Executes the process with arguments formatted by the provided format.Getter the execution arguments of the process.getInfo()
Getter for the human readable info about the arguments.Get the name of the executable to run.int
hashCode()
-
Constructor Details
-
NbProcessDescriptor
-
NbProcessDescriptor
Create a new descriptor for the specified process, classpath switch, and classpath.- Parameters:
processName
- the name of the executable to runarguments
- string for formating of arguments (may bequoted
)info
- info how to format the arguments (human-readable string)
-
-
Method Details
-
getProcessName
-
getArguments
Getter the execution arguments of the process.- Returns:
- the switch that the executable uses for passing the classpath as its command-line parameter
-
getInfo
Getter for the human readable info about the arguments.- Returns:
- the info string or null
-
exec
Executes the process with arguments formatted by the provided format. Also the envp properties are passed to the executed process, and a working directory may be supplied.- Parameters:
format
- format to be applied to arguments, process and envp supplied by user. It can benull
if no formatting should be done.envp
- list of properties to be applied to the process, ornull
to leave unspecifiedcwd
- the working directory to use, ornull
if this should not be specified- Returns:
- handle to executed process.
- Throws:
IOException
- if the start of the process fails, or if setting the working directory is not supported
-
exec
Executes the process with arguments, processName and envp formatted by the provided format. Also the envp properties are passed to the executed process, and a working directory may be supplied. Optionally the environment variables of the NetBeans JVM may be appended to (replaced when there is overlap) instead of specifying all of the environment variables from scratch. This requires the NetBeans core to translate environment variables to system properties prefixed byEnv-
in order to work correctly.- Parameters:
format
- format to be applied to arguments, process and envp supplied by user. It can benull
if no formatting should be done.envp
- list of properties to be applied to the process, ornull
to leave unspecifiedappendEnv
- if true andenvp
is notnull
, append or replace JVM's environmentcwd
- the working directory to use, ornull
if this should not be specified- Returns:
- handle to executed process.
- Throws:
IOException
- if the start of the process fails, or if setting the working directory is not supported- Since:
- 1.15
-
exec
Executes the process with arguments and processNme formatted by the provided format. Also the envp properties are passed to the executed process.- Parameters:
format
- format to be aplied to arguments, process and envp suplied by user. It can benull
if no formatting should be done.envp
- list of properties to be applied to the process, ornull
to leave unspecified- Returns:
- handle to executed process.
- Throws:
IOException
- if the start of the process fails
-
exec
Executes the process with arguments and processName formatted by the provided format.- Parameters:
format
- format to be aplied to arguments and process. It can benull
if no formatting should be done.- Returns:
- handle to executed process.
- Throws:
IOException
- if the start of the process fails
-
exec
Executes the process with arguments provided in constructor.- Returns:
- handle to executed process.
- Throws:
IOException
- if the start of the process fails
-
hashCode
-
equals
-