Package com.jcabi.ssh
Class Shell.Safe
- java.lang.Object
-
- com.jcabi.ssh.Shell.Safe
-
- All Implemented Interfaces:
Shell
- Enclosing interface:
- Shell
@Immutable public static final class Shell.Safe extends Object implements Shell
Safe run (throws if exit code is not zero).- Since:
- 0.1
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jcabi.ssh.Shell
Shell.Empty, Shell.Fake, Shell.Plain, Shell.Safe, Shell.Verbose
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
exec(String command, InputStream stdin, OutputStream stdout, OutputStream stderr)
Execute and return exit code.
-
-
-
Constructor Detail
-
Safe
public Safe(Shell shell)
Ctor.- Parameters:
shell
- Original shell
-
-
Method Detail
-
exec
public int exec(String command, InputStream stdin, OutputStream stdout, OutputStream stderr) throws IOException
Description copied from interface:Shell
Execute and return exit code.- Specified by:
exec
in interfaceShell
- Parameters:
command
- Commandstdin
- Stdin (will be closed)stdout
- Stdout (will be closed)stderr
- Stderr (will be closed)- Returns:
- Exit code
- Throws:
IOException
- If fails
-
-