mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
fix for local app data on non-windows systems
This commit is contained in:
parent
2ec56b2dba
commit
6e5e2ff2f5
@ -20,6 +20,7 @@ import java.nio.file.Paths;
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openide.modules.Places;
|
||||
|
||||
/**
|
||||
@ -38,7 +39,11 @@ public class CTSettings {
|
||||
LOGGER.log(Level.INFO, "Application Data (test mode) Path: " + Places.getUserDirectory().getAbsolutePath());
|
||||
return Places.getUserDirectory().getAbsolutePath();
|
||||
} else {
|
||||
Path localAppPath = Paths.get(System.getenv("LOCALAPPDATA"), "cybertriage");
|
||||
|
||||
Path localAppPath = StringUtils.isBlank(System.getenv("LOCALAPPDATA"))
|
||||
? Places.getUserDirectory().toPath().toAbsolutePath()
|
||||
: Paths.get(System.getenv("LOCALAPPDATA"), "cybertriage");
|
||||
|
||||
try {
|
||||
Files.createDirectories(localAppPath);
|
||||
LOGGER.log(Level.INFO, "Application Data Path: " + localAppPath.toString());
|
||||
|
Loading…
x
Reference in New Issue
Block a user