Package org.apache.nutch.util
Class CommandRunner
java.lang.Object
org.apache.nutch.util.CommandRunner
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidevaluate()intexec()Execute the commandintintbooleanstatic voidvoidsetCommand(String s) voidvoidvoidvoidsetTimeout(int timeout) voidsetWaitForExit(boolean waitForExit)
-
Constructor Details
-
CommandRunner
public CommandRunner()
-
-
Method Details
-
getExitValue
public int getExitValue() -
setCommand
-
getCommand
-
setInputStream
-
setStdOutputStream
-
setStdErrorStream
-
evaluate
- Throws:
IOException
-
exec
Execute the command- Returns:
- process exit value (return code) or -1 if timed out.
- Throws:
IOException- if there is a fatal error interfacing with the environment in which the application is running.
-
getThrownError
-
getTimeout
public int getTimeout() -
setTimeout
public void setTimeout(int timeout) -
getWaitForExit
public boolean getWaitForExit() -
setWaitForExit
public void setWaitForExit(boolean waitForExit) -
main
- Throws:
Exception
-