Autopsy
4.17.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
|
Classes | |
class | HybridTerminator |
class | InterruptedThreadProcessTerminator |
interface | ProcessTerminator |
class | StreamToStringRedirect |
class | StreamToWriterRedirect |
class | TimedProcessTerminator |
Public Member Functions | |
synchronized String | execute (final String aCommand, final String...params) throws IOException, InterruptedException |
synchronized void | execute (final Writer stdoutWriter, final String aCommand, final String...params) throws IOException, InterruptedException |
synchronized int | getExitValue () |
synchronized void | stop () |
Static Public Member Functions | |
static int | execute (ProcessBuilder processBuilder) throws SecurityException, IOException |
static int | execute (ProcessBuilder processBuilder, ProcessTerminator terminator) throws SecurityException, IOException |
static int | execute (ProcessBuilder processBuilder, long terminationCheckInterval, TimeUnit units, ProcessTerminator terminator) throws SecurityException, IOException |
static void | killProcess (Process process) |
static int | waitForTermination (String processName, Process process, long terminationCheckInterval, TimeUnit units, ProcessTerminator terminator) throws IOException |
Static Private Member Functions | |
static void | terminateProcess (String processName, Process process) throws IOException, InterruptedException |
static int | waitForProcess (String processName, Process process, long terminationCheckInterval, TimeUnit units, ProcessTerminator terminator) throws IOException, InterruptedException |
Private Attributes | |
ExecUtil.StreamToStringRedirect | errorStringRedirect = null |
int | exitValue = -100 |
ExecUtil.StreamToStringRedirect | outputStringRedirect = null |
ExecUtil.StreamToWriterRedirect | outputWriterRedirect = null |
Process | proc = null |
Static Private Attributes | |
static final long | DEFAULT_TERMINATION_CHECK_INTERVAL = 5 |
static final TimeUnit | DEFAULT_TERMINATION_CHECK_INTERVAL_UNITS = TimeUnit.SECONDS |
static final Logger | logger = Logger.getLogger(ExecUtil.class.getName()) |
static final long | MAX_WAIT_FOR_TERMINATION = 1 |
static final TimeUnit | MAX_WAIT_FOR_TERMINATION_UNITS = TimeUnit.MINUTES |
Executes a command line using an operating system process with pluggable logic to terminate the process under certain conditions.
Definition at line 37 of file ExecUtil.java.
|
static |
Runs a process without a process terminator. This method should be used with caution because there is nothing to stop the process from running forever.
IMPORTANT: This method blocks while the process is running. For legacy API reasons, if there is an interrupt the InterruptedException is wrapped in an IOException instead of being thrown. Callers that need to know about interrupts to detect backgound task cancellation can call Thread.isInterrupted() or, if the thread's interrupt flag should be cleared, Thread.interrupted().
processBuilder | A process builder used to configure and construct the process to be run. |
SecurityException | If a security manager exists and vetoes any aspect of running the process. |
IOException | If an error occurs while executing or terminating the process. |
Definition at line 172 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.ExecUtil.execute().
Referenced by org.sleuthkit.autopsy.modules.pictureanalyzer.impls.HEICProcessor.convertToJPEG(), org.sleuthkit.autopsy.coreutils.ExecUtil.execute(), org.sleuthkit.autopsy.casemodule.LocalFilesDSProcessor.extractLogicalEvidenceFileContents(), org.sleuthkit.autopsy.modules.leappanalyzers.ALeappAnalyzerIngestModule.process(), org.sleuthkit.autopsy.modules.leappanalyzers.ILeappAnalyzerIngestModule.process(), org.sleuthkit.autopsy.modules.plaso.PlasoIngestModule.process(), org.sleuthkit.autopsy.modules.leappanalyzers.ALeappAnalyzerIngestModule.processALeappFile(), org.sleuthkit.autopsy.modules.leappanalyzers.ALeappAnalyzerIngestModule.processALeappFs(), org.sleuthkit.autopsy.modules.leappanalyzers.ILeappAnalyzerIngestModule.processILeappFile(), and org.sleuthkit.autopsy.modules.leappanalyzers.ILeappAnalyzerIngestModule.processILeappFs().
|
static |
Runs a process using the default termination check interval and a process terminator.
IMPORTANT: This method blocks while the process is running. For legacy API reasons, if there is an interrupt the InterruptedException is wrapped in an IOException instead of being thrown. Callers that need to know about interrupts to detect backgound task cancellation can call Thread.isInterrupted() or, if the thread's interrupt flag should be cleared, Thread.interrupted().
processBuilder | A process builder used to configure and construct the process to be run. |
terminator | The terminator. |
SecurityException | If a security manager exists and vetoes any aspect of running the process. |
IOException | If an error occurs while executing or terminating the process. |
Definition at line 203 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.ExecUtil.DEFAULT_TERMINATION_CHECK_INTERVAL, org.sleuthkit.autopsy.coreutils.ExecUtil.DEFAULT_TERMINATION_CHECK_INTERVAL_UNITS, and org.sleuthkit.autopsy.coreutils.ExecUtil.execute().
|
static |
Runs a process using a custom termination check interval and a process terminator.
IMPORTANT: This method blocks while the process is running. For legacy API reasons, if there is an interrupt the InterruptedException is wrapped in an IOException instead of being thrown. Callers that need to know about interrupts to detect backgound task cancellation can call Thread.isInterrupted() or, if the thread's interrupt flag should be cleared, Thread.interrupted().
processBuilder | A process builder used to configure and construct the process to be run. |
terminationCheckInterval | The interval at which to query the process terminator to see if the process should be killed. |
units | The units for the termination check interval. |
terminator | The terminator. |
SecurityException | If a security manager exists and vetoes any aspect of running the process. |
IOException | If an error occurs while executing or terminating the process. |
Definition at line 234 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.ExecUtil.waitForTermination().
synchronized String org.sleuthkit.autopsy.coreutils.ExecUtil.execute | ( | final String | aCommand, |
final String... | params | ||
) | throws IOException, InterruptedException |
Execute a process. Redirect asynchronously stdout to a string and stderr to nowhere. Use only for small outputs, otherwise use the execute() variant with Writer.
aCommand | command to be executed |
params | parameters of the command |
java.io.IOException | |
java.lang.InterruptedException |
Definition at line 422 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.ExecUtil.errorStringRedirect, and org.sleuthkit.autopsy.coreutils.ExecUtil.outputStringRedirect.
synchronized void org.sleuthkit.autopsy.coreutils.ExecUtil.execute | ( | final Writer | stdoutWriter, |
final String | aCommand, | ||
final String... | params | ||
) | throws IOException, InterruptedException |
Execute a process. Redirect asynchronously stdout to a passed in writer and stderr to nowhere.
stdoutWriter | file writer to write stdout to |
aCommand | command to be executed |
params | parameters of the command |
java.io.IOException | |
java.lang.InterruptedException |
Definition at line 470 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.ExecUtil.errorStringRedirect, and org.sleuthkit.autopsy.coreutils.ExecUtil.outputWriterRedirect.
synchronized int org.sleuthkit.autopsy.coreutils.ExecUtil.getExitValue | ( | ) |
Gets the exit value returned by the subprocess used to execute a command.
Definition at line 543 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.ExecUtil.exitValue.
|
static |
Terminates a process and its children, waiting with a time out to try to ensure the process is no longer alive before returning.
IMPORTANT: This method blocks while the process is running. For legacy API reasons, if there is an interrupt (or any other exception) the exception is logged instead of being thrown. Callers that need to know about interrupts to detect backgound task cancellation can call Thread.isInterrupted() or, if the thread's interrupt flag should be cleared, Thread.interrupted().
process | The process. |
Definition at line 344 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.ExecUtil.terminateProcess().
synchronized void org.sleuthkit.autopsy.coreutils.ExecUtil.stop | ( | ) |
Interrupt the running process and stop its stream redirect threads
Definition at line 513 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.ExecUtil.errorStringRedirect, org.sleuthkit.autopsy.coreutils.ExecUtil.outputStringRedirect, and org.sleuthkit.autopsy.coreutils.ExecUtil.outputWriterRedirect.
|
staticprivate |
Terminates a process and its children, waiting with a time out to try to ensure the process is no longer alive before returning.
processName | The name of the process, for logging purposes. |
process | The process. |
IOException | If an error occurs while trying to terminate the process. |
InterruptedException | If the thread running this code is interrupted while waiting for the process to terminate. |
Definition at line 369 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.Win32Process.getChildren(), and org.sleuthkit.autopsy.coreutils.Win32Process.terminate().
Referenced by org.sleuthkit.autopsy.coreutils.ExecUtil.killProcess(), and org.sleuthkit.autopsy.coreutils.ExecUtil.waitForProcess().
|
staticprivate |
Waits for an existing process to finish, using a custom termination check interval and a process terminator.
processName | The name of the process, for logging purposes. |
process | The process. |
terminationCheckInterval | The interval at which to query the process terminator to see if the process should be killed. |
units | The units for the termination check interval. |
terminator | The process terminator. |
IOException | If an error occurs while executing or terminating the process. |
InterruptedException | If the thread running this code is interrupted while the process is running. |
Definition at line 298 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.ExecUtil.terminateProcess().
Referenced by org.sleuthkit.autopsy.coreutils.ExecUtil.waitForTermination().
|
static |
Waits for an existing process to finish, using a custom termination check interval and a process terminator.
IMPORTANT: This method blocks while the process is running. For legacy API reasons, if there is an interrupt the InterruptedException is wrapped in an IOException instead of being thrown. Callers that need to know about interrupts to detect backgound task cancellation can call Thread.isInterrupted() or, if the thread's interrupt flag should be cleared, Thread.interrupted().
processName | The name of the process, for logging purposes. |
process | The process. |
terminationCheckInterval | The interval at which to query the process terminator to see if the process should be killed. |
units | The units for the termination check interval. |
terminator | The process terminator. |
IOException | If an error occurs while executing or terminating the process. |
Definition at line 264 of file ExecUtil.java.
References org.sleuthkit.autopsy.coreutils.ExecUtil.waitForProcess().
Referenced by org.sleuthkit.autopsy.coreutils.ExecUtil.execute(), and org.sleuthkit.autopsy.modules.plaso.PlasoIngestModule.process().
|
staticprivate |
Definition at line 40 of file ExecUtil.java.
Referenced by org.sleuthkit.autopsy.coreutils.ExecUtil.execute().
|
staticprivate |
Definition at line 41 of file ExecUtil.java.
Referenced by org.sleuthkit.autopsy.coreutils.ExecUtil.execute().
|
private |
Definition at line 403 of file ExecUtil.java.
Referenced by org.sleuthkit.autopsy.coreutils.ExecUtil.execute(), and org.sleuthkit.autopsy.coreutils.ExecUtil.stop().
|
private |
Definition at line 406 of file ExecUtil.java.
Referenced by org.sleuthkit.autopsy.coreutils.ExecUtil.getExitValue().
|
staticprivate |
Definition at line 39 of file ExecUtil.java.
|
staticprivate |
Definition at line 42 of file ExecUtil.java.
|
staticprivate |
Definition at line 43 of file ExecUtil.java.
|
private |
Definition at line 404 of file ExecUtil.java.
Referenced by org.sleuthkit.autopsy.coreutils.ExecUtil.execute(), and org.sleuthkit.autopsy.coreutils.ExecUtil.stop().
|
private |
Definition at line 405 of file ExecUtil.java.
Referenced by org.sleuthkit.autopsy.coreutils.ExecUtil.execute(), and org.sleuthkit.autopsy.coreutils.ExecUtil.stop().
|
private |
Definition at line 402 of file ExecUtil.java.
Copyright © 2012-2021 Basis Technology. Generated on: Tue Jan 19 2021
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.