Skip to content

Instantly share code, notes, and snippets.

@kohsuke
Created March 23, 2012 22:24
Show Gist options
  • Select an option

  • Save kohsuke/2175674 to your computer and use it in GitHub Desktop.

Select an option

Save kohsuke/2175674 to your computer and use it in GitHub Desktop.
import org.jruby.ext.posix.*;
import hudson.os.*;
class MyHandler implements POSIXHandler {
public void error(POSIX.ERRORS errors, String s) {
throw new PosixException(s,errors);
}
public void unimplementedError(String s) {
throw new UnsupportedOperationException(s);
}
public void warn(POSIXHandler.WARNING_ID warning_id, String s, Object... objects) {
LOGGER.fine(s);
}
public boolean isVerbose() {
return true;
}
public File getCurrentWorkingDirectory() {
// TODO
throw new UnsupportedOperationException();
}
public String[] getEnv() {
// TODO
throw new UnsupportedOperationException();
}
public InputStream getInputStream() {
// TODO
throw new UnsupportedOperationException();
}
public PrintStream getOutputStream() {
// TODO
throw new UnsupportedOperationException();
}
public int getPID() {
// TODO
throw new UnsupportedOperationException();
}
public PrintStream getErrorStream() {
// TODO
throw new UnsupportedOperationException();
}
}
POSIXFactory.getPOSIX(new MyHandler(), true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment