Package com.topjohnwu.superuser
Interface Shell.Task
- Enclosing class:
- Shell
public static interface Shell.Task
A task that can be executed by a shell with the method
Shell.execTask(Task)
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
run
(OutputStream stdin, InputStream stdout, InputStream stderr) This method will be called when a task is executed by a shell.default void
This method will be called when a shell is unable to execute this task.
-
Method Details
-
run
void run(@NonNull OutputStream stdin, @NonNull InputStream stdout, @NonNull InputStream stderr) throws IOException This method will be called when a task is executed by a shell. CallingCloseable.close()
on any stream is NOP (does nothing).- Parameters:
stdin
- the STDIN of the shell.stdout
- the STDOUT of the shell.stderr
- the STDERR of the shell.- Throws:
IOException
- I/O errors when doing operations with STDIN/STDOUT/STDERR
-
shellDied
default void shellDied()This method will be called when a shell is unable to execute this task.
-