19 package org.sleuthkit.autopsy.machinesettings;
22 import java.nio.file.Paths;
23 import java.util.prefs.Preferences;
24 import org.apache.commons.lang3.StringUtils;
25 import org.openide.util.NbBundle;
26 import org.openide.util.NbPreferences;
45 return Paths.get(System.getProperty(
"java.io.tmpdir")).toAbsolutePath().toString();
54 String tempDir = preferences.get(TEMP_DIR_KEY, null);
72 "UserMachinePreferences_validateTempDirectory_errorOnCreate_text=There was an error creating the temp directory for path: {0}",
74 "UserMachinePreferences_validateTempDirectory_errorOnReadWrite_text=There was an error reading or writing to temp directory path: {0}"
77 if (StringUtils.isBlank(path)) {
82 File f =
new File(path);
83 if (!f.exists() && !f.mkdirs()) {
103 preferences.put(TEMP_DIR_KEY, path);
static void setBaseTempDirectory(String path)
static final Preferences preferences
static boolean hasReadWriteAccess(Path dirPath)
static final String TEMP_DIR_KEY
static boolean validateTempDirectory(String path)
static String getBaseTempDirectory()
static String getDefaultTempDirectory()