mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-13 00:16:16 +00:00
Move ExecUtil class to Core utils and simplify Timeline dependencies
This commit is contained in:
parent
7fde0d12a5
commit
62bb213b58
@ -16,7 +16,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.recentactivity;
|
package org.sleuthkit.autopsy.coreutils;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -27,7 +27,7 @@ import java.util.logging.Level;
|
|||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Takes of forking a process and reading output / error streams to either a
|
* Takes care of forking a process and reading output / error streams to either a
|
||||||
* string buffer or directly to a file writer
|
* string buffer or directly to a file writer
|
||||||
*/
|
*/
|
||||||
public final class ExecUtil {
|
public final class ExecUtil {
|
||||||
@ -67,12 +67,6 @@ public final class ExecUtil {
|
|||||||
logger.log(Level.INFO, "Executing " + arrayCommandToLog.toString());
|
logger.log(Level.INFO, "Executing " + arrayCommandToLog.toString());
|
||||||
|
|
||||||
proc = rt.exec(arrayCommand);
|
proc = rt.exec(arrayCommand);
|
||||||
try {
|
|
||||||
//give time to fully start the process
|
|
||||||
Thread.sleep(2000);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
logger.log(Level.WARNING, "Pause interrupted", ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
//stderr redirect
|
//stderr redirect
|
||||||
errorStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getErrorStream(), "ERROR");
|
errorStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getErrorStream(), "ERROR");
|
||||||
@ -128,14 +122,6 @@ public final class ExecUtil {
|
|||||||
logger.log(Level.INFO, "Executing " + arrayCommandToLog.toString());
|
logger.log(Level.INFO, "Executing " + arrayCommandToLog.toString());
|
||||||
|
|
||||||
proc = rt.exec(arrayCommand);
|
proc = rt.exec(arrayCommand);
|
||||||
if (false) {
|
|
||||||
try {
|
|
||||||
//give time to fully start the process
|
|
||||||
Thread.sleep(2000);
|
|
||||||
} catch (InterruptedException ex) {
|
|
||||||
logger.log(Level.WARNING, "Pause interrupted", ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//stderr redirect
|
//stderr redirect
|
||||||
errorStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getErrorStream(), "ERROR");
|
errorStringRedirect = new ExecUtil.StreamToStringRedirect(proc.getErrorStream(), "ERROR");
|
@ -23,6 +23,7 @@
|
|||||||
package org.sleuthkit.autopsy.recentactivity;
|
package org.sleuthkit.autopsy.recentactivity;
|
||||||
|
|
||||||
//IO imports
|
//IO imports
|
||||||
|
import org.sleuthkit.autopsy.coreutils.ExecUtil;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.recentactivity;
|
package org.sleuthkit.autopsy.recentactivity;
|
||||||
|
|
||||||
|
import org.sleuthkit.autopsy.coreutils.ExecUtil;
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
|
@ -106,15 +106,6 @@
|
|||||||
<specification-version>1.0</specification-version>
|
<specification-version>1.0</specification-version>
|
||||||
</run-dependency>
|
</run-dependency>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<code-name-base>org.sleuthkit.autopsy.recentactivity</code-name-base>
|
|
||||||
<build-prerequisite/>
|
|
||||||
<compile-dependency/>
|
|
||||||
<run-dependency>
|
|
||||||
<release-version>4</release-version>
|
|
||||||
<specification-version>2.0</specification-version>
|
|
||||||
</run-dependency>
|
|
||||||
</dependency>
|
|
||||||
</module-dependencies>
|
</module-dependencies>
|
||||||
<public-packages/>
|
<public-packages/>
|
||||||
</data>
|
</data>
|
||||||
|
@ -97,7 +97,7 @@ import org.sleuthkit.autopsy.datamodel.DisplayableItemNode;
|
|||||||
import org.sleuthkit.autopsy.datamodel.DisplayableItemNodeVisitor;
|
import org.sleuthkit.autopsy.datamodel.DisplayableItemNodeVisitor;
|
||||||
import org.sleuthkit.autopsy.datamodel.FileNode;
|
import org.sleuthkit.autopsy.datamodel.FileNode;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.recentactivity.ExecUtil;
|
import org.sleuthkit.autopsy.coreutils.ExecUtil;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.Directory;
|
import org.sleuthkit.datamodel.Directory;
|
||||||
import org.sleuthkit.datamodel.File;
|
import org.sleuthkit.datamodel.File;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user