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
getEnvironment
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 thanenv
is 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 thanenv
is null
-
-
Method Details
-
getInputStream
Description copied from interface:ExecRequest
Get this request's input stream.- Specified by:
getInputStream
in interfaceExecRequest
- Returns:
- command input
-
getOutputStream
Description copied from interface:ExecRequest
Get this request's normal output stream.- Specified by:
getOutputStream
in interfaceExecRequest
- Returns:
- command output
-
getErrorStream
Description copied from interface:ExecRequest
Get this request's error output stream.- Specified by:
getErrorStream
in interfaceExecRequest
- Returns:
- command error output
-
getCommandString
Description copied from interface:ExecRequest
Get 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:
getCommandString
in interfaceExecRequest
- Returns:
- the command to execute, or null if
ExecRequest.getCommandList()
returns a non-null array
-
getCommandList
Description copied from interface:ExecRequest
Get this request's command to execute as a string array.- Specified by:
getCommandList
in interfaceExecRequest
- Returns:
- the command to execute, or null if
ExecRequest.getCommandString()
returns a non-null command string
-