# Class ExecuteOsCommand

java.lang.Object
java.lang.Thread
org.snpeff.osCmd.ExecuteOsCommand

All Implemented Interfaces:
  `Runnable, Progress`

public class ExecuteOsCommand extends Thread implements Progress
Launches an 'OS command' (e.g. "ls", "dir") Note: Launching a system command in Java is not trivial, we need to start 2 threads that read STDOUT and STDERR of the process, otherwise it will block (actually it may even cause a deadlock) References: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html?page=1

Author:
  pcingola

## Nested Class Summary

### Nested classes/interfaces inherited from class Thread

`Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler`

## Field Summary

Fields
Modifier and Type
Field
Description
`static boolean`
`debug`

### Fields inherited from class Thread

`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

## Constructor Summary

Constructors
Constructor
Description
`ExecuteOsCommand(String command)`
`ExecuteOsCommand(String[] args)`

## Method Summary

Modifier and Type
Method
Description
`int`
`exec()`
`String[]`
`getCommandArgs()`
`int`
`getExitValue()`
`String`
`getHead()`
First lines of stdout
`String`
`getHeadStderr()`
First lines of stderr
`int`
`getProgress()`
`String`
`getPwd()`
`String`
`getRedirectStderr()`
`String`
`getRedirectStdout()`
`String`
`getStderr()`
`OutputStream`
`getStdin()`
`String`
`getStdout()`
`LineFilter`
`getStdOutFilter()`
`boolean`
`isAlertDone()`
`boolean`
`isBinaryStderr()`
`boolean`
`isBinaryStdout()`
`boolean`
`isExecuting()`
`boolean`
`isQuiet()`
`boolean`
`isSaveStd()`
`boolean`
`isStarted()`
`void`
`kill()`
`void`
`progress()`
Report progress
`void`
`resetBuffers()`
`void`
`run()`
`void`
`setBinaryStderr(boolean binaryStderr)`
`void`
`setBinaryStdout(boolean binaryStdout)`
`void`
`setCommandArgs(String[] commandArgs)`
`void`
`setObjetcToNotify(Object objetcToNotify)`
`void`
`setPwd(String pwd)`
`void`
`setQuiet(boolean quietStdout, boolean quietStderr)`
`void`
`setRedirectStderr(String redirectStderr)`
`void`
`setRedirectStdout(String redirectStdout)`
`void`
`setSaveStd(boolean saveStd)`
`void`
`setShowExceptions(boolean showExceptions)`
`void`
`setStdoutAlert(String alert)`
`void`
`setStdoutAlertNotify(Object toBeNotified)`
`void`
`setStdOutFilter(LineFilter stdOutFilter)`
`String`
`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`

### Methods inherited from class Object

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### debug

public static boolean debug

## Constructor Details

### ExecuteOsCommand

public ExecuteOsCommand(String[] args)

### ExecuteOsCommand

public ExecuteOsCommand(String command)

## Method Details

### exec

public int exec()

### getCommandArgs

public String[] getCommandArgs()

### getExitValue

public int getExitValue()

### getHead

public String getHead()
First lines of stdout

### getHeadStderr

public String getHeadStderr()
First lines of stderr

### getProgress

public int getProgress()

Specified by:
  `getProgress` in interface `Progress`

### getPwd

public String getPwd()

### getRedirectStderr

public String getRedirectStderr()

### getRedirectStdout

public String getRedirectStdout()

### getStderr

public String getStderr()

### getStdin

public OutputStream getStdin()

### getStdout

public String getStdout()

### getStdOutFilter

public LineFilter getStdOutFilter()

### isAlertDone

public boolean isAlertDone()

### isBinaryStderr

public boolean isBinaryStderr()

### isBinaryStdout

public boolean isBinaryStdout()

### isExecuting

public boolean isExecuting()

### isQuiet

public boolean isQuiet()

### isSaveStd

public boolean isSaveStd()

### isStarted

public boolean isStarted()

### kill

public void kill()

### progress

public void progress()
Report progress

Specified by:
  `progress` in interface `Progress`

### resetBuffers

public void resetBuffers()

### run

public void run()

Specified by:
  `run` in interface `Runnable`
Overrides:
  `run` in class `Thread`

### setBinaryStderr

public void setBinaryStderr(boolean binaryStderr)

### setBinaryStdout

public void setBinaryStdout(boolean binaryStdout)

### setCommandArgs

public void setCommandArgs(String[] commandArgs)

### setObjetcToNotify

public void setObjetcToNotify(Object objetcToNotify)

### setPwd

public void setPwd(String pwd)

### setQuiet

public void setQuiet(boolean quietStdout, boolean quietStderr)

### setRedirectStderr

public void setRedirectStderr(String redirectStderr)

### setRedirectStdout

public void setRedirectStdout(String redirectStdout)

### setSaveStd

public void setSaveStd(boolean saveStd)

### setShowExceptions

public void setShowExceptions(boolean showExceptions)

### setStdoutAlert

public void setStdoutAlert(String alert)

### setStdoutAlertNotify

public void setStdoutAlertNotify(Object toBeNotified)

### setStdOutFilter

public void setStdOutFilter(LineFilter stdOutFilter)

### toString

public String toString()

Overrides:
  `toString` in class `Thread`