mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
set tsk temp directory
This commit is contained in:
parent
bf041ab06c
commit
b2c674e6b3
@ -66,11 +66,17 @@ public class Installer extends ModuleInstall {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private static final String JAVA_TEMP = "java.io.tmpdir";
|
||||
private static final String AUTOPSY_TEMP_DIR = "autopsy_temp";
|
||||
private static final String TSK_TEMP = "tsk.tmpdir";
|
||||
|
||||
private final List<ModuleInstall> packageInstallers;
|
||||
private static final Logger logger = Logger.getLogger(Installer.class.getName());
|
||||
private static volatile boolean javaFxInit = false;
|
||||
|
||||
static {
|
||||
setTskTemp();
|
||||
|
||||
loadDynLibraries();
|
||||
|
||||
// This call was moved from MediaViewImagePanel so that it is
|
||||
@ -81,6 +87,24 @@ public class Installer extends ModuleInstall {
|
||||
OpenCvLoader.openCvIsLoaded();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set TSK temp directory to de-conflict with other programs using TSK libs.
|
||||
*/
|
||||
private static void setTskTemp() {
|
||||
try {
|
||||
String curTemp = System.getProperty(JAVA_TEMP, "");
|
||||
String tskTemp = curTemp + (curTemp.endsWith(File.separator) ? "" : File.separator) + AUTOPSY_TEMP_DIR;
|
||||
System.setProperty(TSK_TEMP, tskTemp);
|
||||
File tskTempDir = new File(tskTemp);
|
||||
tskTempDir.mkdirs();
|
||||
if (!tskTempDir.isDirectory()) {
|
||||
throw new IOException("Unable to create directory at " + tskTemp);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.WARNING, "There was an error setting up tsk temp directory", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static void loadDynLibraries() {
|
||||
/*
|
||||
* On Windows, we distribute dlls that libtsk_jni depend on. If
|
||||
|
Loading…
x
Reference in New Issue
Block a user