Class ProcessLauncher
- java.lang.Object
-
- org.eclipse.rdf4j.common.platform.ProcessLauncher
-
@Deprecated public final class ProcessLauncher extends Object
Deprecated.Launches a process, redirecting the output of that sub-process to the output of this (the parent) process.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProcessLauncher.CommandNotExistsExceptionDeprecated.Exception that is thrown when a command could not be executed because it (probably) does not exist at all.static interfaceProcessLauncher.OutputListenerDeprecated.Classes implementing this interface can receive output generated by processes launched using the ProcessLauncher.
-
Constructor Summary
Constructors Constructor Description ProcessLauncher(String commandLine)Deprecated.Constructs a new ProcessLauncher with the given command line.ProcessLauncher(String[] commandArray)Deprecated.Constructs a new ProcessLauncher with the given command array.ProcessLauncher(String[] commandArray, File baseDir)Deprecated.Constructs a new ProcessLauncher with the given command array and base directory.ProcessLauncher(String commandLine, File baseDir)Deprecated.Constructs a new ProcessLauncher with the given command line and base directoryProcessLauncher(ArrayList<?> commandList)Deprecated.Constructs new process launcher with the given command element list.ProcessLauncher(ArrayList<?> commandList, File baseDir)Deprecated.Constructs new process launcher with the given command element list and base directory.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidabort()Deprecated.Tries to abort the currently running process.voidaddOutputListener(ProcessLauncher.OutputListener listener)Deprecated.Add a listener for output from the to-be-launched process.StringgetCommandLine()Deprecated.Get the commandline that is used to launch the process.StringgetErrorOutput()Deprecated.Get error output, in case no listeners were registered - never returns null.StringgetStandardOutput()Deprecated.Get standard output, in case no listeners were registered - never returns null.booleanhasFinished()Deprecated.Check whether execution has finished.intlaunch()Deprecated.Launches the process, and blocks until that process completes execution.
-
-
-
Constructor Detail
-
ProcessLauncher
public ProcessLauncher(String commandLine)
Deprecated.Constructs a new ProcessLauncher with the given command line.- Parameters:
commandLine- command line
-
ProcessLauncher
public ProcessLauncher(String commandLine, File baseDir)
Deprecated.Constructs a new ProcessLauncher with the given command line and base directory- Parameters:
commandLine- command linebaseDir- base directory
-
ProcessLauncher
public ProcessLauncher(String[] commandArray)
Deprecated.Constructs a new ProcessLauncher with the given command array.- Parameters:
commandArray- command as array of strings
-
ProcessLauncher
public ProcessLauncher(String[] commandArray, File baseDir)
Deprecated.Constructs a new ProcessLauncher with the given command array and base directory.- Parameters:
commandArray- command as array of stringsbaseDir- base directory
-
ProcessLauncher
public ProcessLauncher(ArrayList<?> commandList)
Deprecated.Constructs new process launcher with the given command element list.- Parameters:
commandList- command list
-
-
Method Detail
-
addOutputListener
public void addOutputListener(ProcessLauncher.OutputListener listener)
Deprecated.Add a listener for output from the to-be-launched process.- Parameters:
listener- output listener
-
getStandardOutput
public String getStandardOutput()
Deprecated.Get standard output, in case no listeners were registered - never returns null.- Returns:
- standard output as string
-
getErrorOutput
public String getErrorOutput()
Deprecated.Get error output, in case no listeners were registered - never returns null.- Returns:
- standard error as string
-
getCommandLine
public String getCommandLine()
Deprecated.Get the commandline that is used to launch the process.- Returns:
- command line
-
hasFinished
public boolean hasFinished()
Deprecated.Check whether execution has finished.- Returns:
- true when finished
-
launch
public int launch() throws ProcessLauncher.CommandNotExistsExceptionDeprecated.Launches the process, and blocks until that process completes execution.- Returns:
- command exit value
- Throws:
ProcessLauncher.CommandNotExistsException- If the command could not be executed because it does not exist
-
abort
public void abort()
Deprecated.Tries to abort the currently running process.
-
-