Package org.dellroad.jct.core.simple
Class SimpleExecRequest
java.lang.Object
org.dellroad.jct.core.AbstractConsoleRequest<ExecRequest>
org.dellroad.jct.core.simple.SimpleExecRequest
- All Implemented Interfaces:
ConsoleRequest<ExecRequest>,ExecRequest
Straightforward implementation of the
ExecRequest interface.-
Constructor Summary
ConstructorsConstructorDescriptionSimpleExecRequest(InputStream in, PrintStream out, PrintStream err, Map<String, String> env, String commandString) Constructor.SimpleExecRequest(InputStream in, PrintStream out, PrintStream err, Map<String, String> env, List<String> commandList) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet this request's command to execute as a string array.Get this request's command to execute as a single string.Get this request's error output stream.Get this request's input stream.Get this request's normal output stream.Methods inherited from class org.dellroad.jct.core.AbstractConsoleRequest
getEnvironmentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dellroad.jct.core.ConsoleRequest
getEnvironment
-
Constructor Details
-
SimpleExecRequest
public SimpleExecRequest(InputStream in, PrintStream out, PrintStream err, Map<String, String> env, String commandString) Constructor.- Parameters:
in- command inputout- command outputerr- command error outputenv- environment variables, or null for an empty mapcommandString- the command string to execute- Throws:
IllegalArgumentException- if any parameter other thanenvis null
-
SimpleExecRequest
public SimpleExecRequest(InputStream in, PrintStream out, PrintStream err, Map<String, String> env, List<String> commandList) Constructor.- Parameters:
in- command inputout- command outputerr- command error outputenv- environment variables, or null for an empty mapcommandList- the command list to execute- Throws:
IllegalArgumentException- if any parameter other thanenvis null
-
-
Method Details
-
getInputStream
Description copied from interface:ExecRequestGet this request's input stream.- Specified by:
getInputStreamin interfaceExecRequest- Returns:
- command input
-
getOutputStream
Description copied from interface:ExecRequestGet this request's normal output stream.- Specified by:
getOutputStreamin interfaceExecRequest- Returns:
- command output
-
getErrorStream
Description copied from interface:ExecRequestGet this request's error output stream.- Specified by:
getErrorStreamin interfaceExecRequest- Returns:
- command error output
-
getCommandString
Description copied from interface:ExecRequestGet this request's command to execute as a single string.The command is given as a single string. Typically the string is parsed somehow into a distinguisble command.
- Specified by:
getCommandStringin interfaceExecRequest- Returns:
- the command to execute, or null if
ExecRequest.getCommandList()returns a non-null array
-
getCommandList
Description copied from interface:ExecRequestGet this request's command to execute as a string array.- Specified by:
getCommandListin interfaceExecRequest- Returns:
- the command to execute, or null if
ExecRequest.getCommandString()returns a non-null command string
-