com.oracle.bedrock.runtime.java.SimpleLocalProcessBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bedrock-runtime Show documentation
Show all versions of bedrock-runtime Show documentation
Interfaces, classes and resources to construct, inspect and manage
runtime processes.
package com.oracle.bedrock.runtime.java;
import com.oracle.bedrock.OptionsByType;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* A simple {@link LocalProcessBuilder} implementation that
* wraps a Java {@link ProcessBuilder}.
*/
public class SimpleLocalProcessBuilder
implements LocalProcessBuilder
{
private final ProcessBuilder processBuilder;
public SimpleLocalProcessBuilder(String executable) {
processBuilder = new ProcessBuilder(executable);
}
@Override
public LocalProcessBuilder command(String... command) {
processBuilder.command(command);
return this;
}
@Override
public List command() {
return processBuilder.command();
}
@Override
public LocalProcessBuilder directory(File directory) {
processBuilder.directory(directory);
return this;
}
@Override
public File directory() {
return processBuilder.directory();
}
@Override
public Map environment() {
return processBuilder.environment();
}
@Override
public Process start(OptionsByType options) throws IOException {
return processBuilder.start();
}
@Override
public LocalProcessBuilder redirectErrorStream(boolean redirectErrorStream) {
processBuilder.redirectErrorStream(redirectErrorStream);
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy