mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
fixes
This commit is contained in:
parent
6e5e2ff2f5
commit
0bec001773
@ -26,12 +26,12 @@ import java.beans.PropertyChangeListener;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.logging.Logger;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import javax.swing.JPanel;
|
||||
import org.netbeans.spi.options.OptionsPanelController;
|
||||
import org.openide.util.Lookup;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSettingsPanel;
|
||||
|
||||
/**
|
||||
|
@ -40,7 +40,6 @@ import java.util.Optional;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.SwingWorker;
|
||||
@ -51,6 +50,7 @@ import org.openide.util.NbBundle.Messages;
|
||||
import org.openide.util.lookup.ServiceProvider;
|
||||
import org.openide.windows.WindowManager;
|
||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
|
||||
/**
|
||||
* Options panel to be displayed in the CTOptionsPanel for settings regarding
|
||||
|
@ -1,16 +1,21 @@
|
||||
/** *************************************************************************
|
||||
** This data and information is proprietary to, and a valuable trade secret
|
||||
** of, Sleuth Kit Labs. It is given in confidence by Sleuth Kit Labs
|
||||
** and may only be used as permitted under the license agreement under which
|
||||
** it has been distributed, and in no other way.
|
||||
**
|
||||
** Copyright (c) 2023 Sleuth Kit Labs, LLC. All rights reserved
|
||||
**
|
||||
** The technical data and information provided herein are provided with
|
||||
** `limited rights', and the computer software provided herein is provided
|
||||
** with `restricted rights' as those terms are defined in DAR and ASPR
|
||||
** 7-104.9(a).
|
||||
************************************************************************** */
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2023 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.basistech.df.cybertriage.autopsy.incidentoptions;
|
||||
|
||||
import com.basistech.df.cybertriage.autopsy.ctoptions.subpanel.CTOptionsSubPanel;
|
||||
@ -21,7 +26,7 @@ import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Collections;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import javax.swing.JFileChooser;
|
||||
import javax.swing.event.DocumentEvent;
|
||||
import javax.swing.event.DocumentListener;
|
||||
|
@ -1,16 +1,21 @@
|
||||
/** *************************************************************************
|
||||
** This data and information is proprietary to, and a valuable trade secret
|
||||
** of, Sleuth Kit Labs. It is given in confidence by Sleuth Kit Labs
|
||||
** and may only be used as permitted under the license agreement under which
|
||||
** it has been distributed, and in no other way.
|
||||
**
|
||||
** Copyright (c) 2023 Sleuth Kit Labs, LLC. All rights reserved
|
||||
**
|
||||
** The technical data and information provided herein are provided with
|
||||
** `limited rights', and the computer software provided herein is provided
|
||||
** with `restricted rights' as those terms are defined in DAR and ASPR
|
||||
** 7-104.9(a).
|
||||
************************************************************************** */
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2023 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.basistech.df.cybertriage.autopsy.incidentoptions;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -19,41 +24,61 @@ import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Objects;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.openide.modules.Places;
|
||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||
|
||||
/**
|
||||
* CT settings that don't include license information. This code must be kept in-sync with code in
|
||||
* CT Autopsy Importer NBM.
|
||||
* CT settings that don't include license information. This code must be kept
|
||||
* in-sync with code in CT Autopsy Importer NBM.
|
||||
*/
|
||||
public class CTSettings {
|
||||
|
||||
private static final Logger LOGGER = Logger.getLogger(CTSettings.class.getCanonicalName());
|
||||
private static final String DEFAULT_FILE_REPO_PATH = getAppDataLocalDirectory();
|
||||
|
||||
// taken from com.basistech.df.cybertriage.utils.SystemProperties
|
||||
private static String getAppDataLocalDirectory() {
|
||||
private static final String CYBERTRIAGE_FOLDER = "cybertriage";
|
||||
private static final String CYBERTRIAGE_DOT_FOLDER = "." + CYBERTRIAGE_FOLDER;
|
||||
|
||||
Logger LOGGER = java.util.logging.Logger.getLogger(CTSettings.class.getCanonicalName());
|
||||
// based on com.basistech.df.cybertriage.utils.SystemProperties
|
||||
private static String getAppDataLocalDirectory() {
|
||||
if (Objects.nonNull(Places.getUserDirectory()) && Places.getUserDirectory().getAbsolutePath().endsWith("testuserdir")) { // APP is in testing .. this should return the test path
|
||||
LOGGER.log(Level.INFO, "Application Data (test mode) Path: " + Places.getUserDirectory().getAbsolutePath());
|
||||
return Places.getUserDirectory().getAbsolutePath();
|
||||
} else {
|
||||
|
||||
Path localAppPath = StringUtils.isBlank(System.getenv("LOCALAPPDATA"))
|
||||
? Places.getUserDirectory().toPath().toAbsolutePath()
|
||||
: Paths.get(System.getenv("LOCALAPPDATA"), "cybertriage");
|
||||
}
|
||||
|
||||
// try to use LOCALAPPDATA on windows
|
||||
String localDataStr = System.getenv("LOCALAPPDATA");
|
||||
if (StringUtils.isNotBlank(localDataStr)) {
|
||||
Path localAppPath = Paths.get(localDataStr, CYBERTRIAGE_FOLDER);
|
||||
try {
|
||||
Files.createDirectories(localAppPath);
|
||||
LOGGER.log(Level.INFO, "Application Data Path: " + localAppPath.toString());
|
||||
return localAppPath.toString();
|
||||
} catch (IOException ex) {
|
||||
LOGGER.log(Level.SEVERE, "IO Error, defaulting to user dir", ex);
|
||||
LOGGER.log(Level.SEVERE, "IO Error using " + localAppPath.toString(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
// try to use ~/.cybertriage anywhere else
|
||||
if (!PlatformUtil.isWindowsOS()) {
|
||||
String homePathStr = System.getenv("HOME");
|
||||
if (StringUtils.isNotBlank(homePathStr)) {
|
||||
Path localAppPath = Paths.get(homePathStr, CYBERTRIAGE_DOT_FOLDER);
|
||||
try {
|
||||
Files.createDirectories(localAppPath);
|
||||
LOGGER.log(Level.INFO, "Non-windows Application Data Path: " + localAppPath.toString());
|
||||
return localAppPath.toString();
|
||||
} catch (IOException ex) {
|
||||
LOGGER.log(Level.SEVERE, "IO Error using " + localAppPath.toString(), ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// defer to user directory otherwise
|
||||
return Places.getUserDirectory().getAbsolutePath(); // In case of an IO Error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String getDefaultFileRepoPath() {
|
||||
return DEFAULT_FILE_REPO_PATH;
|
||||
|
@ -1,16 +1,21 @@
|
||||
/** *************************************************************************
|
||||
** This data and information is proprietary to, and a valuable trade secret
|
||||
** of, Sleuth Kit Labs. It is given in confidence by Sleuth Kit Labs
|
||||
** and may only be used as permitted under the license agreement under which
|
||||
** it has been distributed, and in no other way.
|
||||
**
|
||||
** Copyright (c) 2023 Sleuth Kit Labs, LLC. All rights reserved
|
||||
**
|
||||
** The technical data and information provided herein are provided with
|
||||
** `limited rights', and the computer software provided herein is provided
|
||||
** with `restricted rights' as those terms are defined in DAR and ASPR
|
||||
** 7-104.9(a).
|
||||
************************************************************************** */
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2023 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.basistech.df.cybertriage.autopsy.incidentoptions;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
Loading…
x
Reference in New Issue
Block a user