Class OsCmdRunner
java.lang.Object
java.lang.Thread
org.snpeff.osCmd.OsCmdRunner
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close (kill) commandvoidfinish()Stop execution of this threadlonggetError()intgetHead()getJobId()getOsCmd()intbooleanisDone()Has this runner finished?booleanvoidrun()static booleanrunIfNotExists(String[] opts, String outputFile, boolean redirectToOutput) Run an OS command only if the output files does not exists.booleanrunIfNotExists(String outputFile, boolean redirectToOutput) Run a command only if 'outputFile' does not existvoidsetDefaultWaitTime(long defaultWaitTime) voidsetSaveStd(boolean save) toString()Methods inherited from class Thread
activeCount, checkAccess, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, threadId, yield
-
Constructor Details
-
OsCmdRunner
-
-
Method Details
-
runIfNotExists
Run an OS command only if the output files does not exists. opts[0] : OS Command opts[1] ... opts[N] : Command line options outputFile : Where the results are stored (if the file exists, the command is NOT run) redirect : If 'redirect=true' then run "command > outputFile" (i.e. redirect STDOUT to 'outputFile'). Output is assumed to be binary.- Parameters:
opts-outputFile-redirectToOutput-- Returns:
- true if command executed OK or outputFile exists
-
close
public void close()Close (kill) command -
finish
public void finish()Stop execution of this thread -
getDefaultWaitTime
public long getDefaultWaitTime() -
getError
-
getExitValue
public int getExitValue() -
getHead
-
getHeadStderr
-
getJobId
-
getOsCmd
-
getProgress
public int getProgress() -
getStderr
-
getStdout
-
isDone
public boolean isDone()Has this runner finished?- Returns:
-
isExecuting
public boolean isExecuting() -
run
-
runIfNotExists
Run a command only if 'outputFile' does not exist- Parameters:
outputFile-redirectToOutput-- Returns:
-
setDefaultWaitTime
public void setDefaultWaitTime(long defaultWaitTime) -
setSaveStd
public void setSaveStd(boolean save) -
toString
-