Java Code Examples for com.topjohnwu.superuser.Shell#Job

The following examples show how to use com.topjohnwu.superuser.Shell#Job . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JobImpl.java    From libsu with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public Shell.Job to(List<String> output) {
    out = output;
    redirect = InternalUtils.hasFlag(Shell.FLAG_REDIRECT_STDERR);
    return this;
}
 
Example 2
Source File: JobImpl.java    From libsu with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public Shell.Job to(List<String> stdout, List<String> stderr) {
    out = stdout;
    err = stderr;
    redirect = false;
    return this;
}
 
Example 3
Source File: JobImpl.java    From libsu with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public Shell.Job add(@NonNull InputStream in) {
    if (in != null)
        handlers.add(InputHandler.newInstance(in));
    return this;
}
 
Example 4
Source File: JobImpl.java    From libsu with Apache License 2.0 5 votes vote down vote up
@NonNull
@Override
public Shell.Job add(@NonNull String... cmds) {
    if (cmds != null && cmds.length > 0)
        handlers.add(InputHandler.newInstance(cmds));
    return this;
}
 
Example 5
Source File: Factory.java    From libsu with Apache License 2.0 4 votes vote down vote up
public static Shell.Job createJob(boolean su, InputStream in) {
    return new PendingJob(su).add(in);
}
 
Example 6
Source File: Factory.java    From libsu with Apache License 2.0 4 votes vote down vote up
public static Shell.Job createJob(boolean su, String... cmds) {
    return new PendingJob(su).add(cmds);
}