mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
move files to shared config
This commit is contained in:
parent
6972d8059e
commit
536f4ab450
@ -316,7 +316,6 @@
|
|||||||
<package>org.sleuthkit.autopsy.casemodule.multiusercases</package>
|
<package>org.sleuthkit.autopsy.casemodule.multiusercases</package>
|
||||||
<package>org.sleuthkit.autopsy.casemodule.multiusercasesbrowser</package>
|
<package>org.sleuthkit.autopsy.casemodule.multiusercasesbrowser</package>
|
||||||
<package>org.sleuthkit.autopsy.casemodule.services</package>
|
<package>org.sleuthkit.autopsy.casemodule.services</package>
|
||||||
<package>org.sleuthkit.autopsy.centralrepository.settings</package>
|
|
||||||
<package>org.sleuthkit.autopsy.contentviewers</package>
|
<package>org.sleuthkit.autopsy.contentviewers</package>
|
||||||
<package>org.sleuthkit.autopsy.coordinationservice</package>
|
<package>org.sleuthkit.autopsy.coordinationservice</package>
|
||||||
<package>org.sleuthkit.autopsy.core</package>
|
<package>org.sleuthkit.autopsy.core</package>
|
||||||
@ -339,16 +338,13 @@
|
|||||||
<package>org.sleuthkit.autopsy.modules.encryptiondetection</package>
|
<package>org.sleuthkit.autopsy.modules.encryptiondetection</package>
|
||||||
<package>org.sleuthkit.autopsy.modules.filetypeid</package>
|
<package>org.sleuthkit.autopsy.modules.filetypeid</package>
|
||||||
<package>org.sleuthkit.autopsy.modules.hashdatabase</package>
|
<package>org.sleuthkit.autopsy.modules.hashdatabase</package>
|
||||||
<package>org.sleuthkit.autopsy.modules.interestingitems</package>
|
|
||||||
<package>org.sleuthkit.autopsy.modules.vmextractor</package>
|
<package>org.sleuthkit.autopsy.modules.vmextractor</package>
|
||||||
<package>org.sleuthkit.autopsy.modules.yara.rules</package>
|
|
||||||
<package>org.sleuthkit.autopsy.progress</package>
|
<package>org.sleuthkit.autopsy.progress</package>
|
||||||
<package>org.sleuthkit.autopsy.report</package>
|
<package>org.sleuthkit.autopsy.report</package>
|
||||||
<package>org.sleuthkit.autopsy.textextractors</package>
|
<package>org.sleuthkit.autopsy.textextractors</package>
|
||||||
<package>org.sleuthkit.autopsy.textextractors.configs</package>
|
<package>org.sleuthkit.autopsy.textextractors.configs</package>
|
||||||
<package>org.sleuthkit.autopsy.textsummarizer</package>
|
<package>org.sleuthkit.autopsy.textsummarizer</package>
|
||||||
<package>org.sleuthkit.autopsy.texttranslation</package>
|
<package>org.sleuthkit.autopsy.texttranslation</package>
|
||||||
<package>org.sleuthkit.autopsy.texttranslation.translators.settings</package>
|
|
||||||
<package>org.sleuthkit.autopsy.url.analytics</package>
|
<package>org.sleuthkit.autopsy.url.analytics</package>
|
||||||
<package>org.sleuthkit.datamodel</package>
|
<package>org.sleuthkit.datamodel</package>
|
||||||
<package>org.sleuthkit.datamodel.blackboardutils</package>
|
<package>org.sleuthkit.datamodel.blackboardutils</package>
|
||||||
|
@ -31,7 +31,7 @@ import javax.annotation.concurrent.Immutable;
|
|||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.centralrepository.settings.CentralRepoSettings;
|
import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
import org.sleuthkit.datamodel.TagName;
|
import org.sleuthkit.datamodel.TagName;
|
||||||
|
@ -16,16 +16,14 @@
|
|||||||
* 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.centralrepository.settings;
|
package org.sleuthkit.autopsy.centralrepository;
|
||||||
|
|
||||||
import com.google.common.annotations.Beta;
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
import org.sleuthkit.autopsy.core.configpath.SharedConfigPath;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Location for central repo settings and paths.
|
* Location for central repo settings and paths.
|
||||||
*/
|
*/
|
||||||
@Beta
|
|
||||||
public class CentralRepoSettings {
|
public class CentralRepoSettings {
|
||||||
|
|
||||||
private static final CentralRepoSettings instance = new CentralRepoSettings();
|
private static final CentralRepoSettings instance = new CentralRepoSettings();
|
||||||
@ -39,12 +37,21 @@ public class CentralRepoSettings {
|
|||||||
|
|
||||||
private static final String CENTRAL_REPOSITORY_FOLDER = "CentralRepository";
|
private static final String CENTRAL_REPOSITORY_FOLDER = "CentralRepository";
|
||||||
private static final String CENTRAL_REPOSITORY_SETTINGS_NAME = "CentralRepository";
|
private static final String CENTRAL_REPOSITORY_SETTINGS_NAME = "CentralRepository";
|
||||||
private static final String CENTRAL_REPO_BASE_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), CENTRAL_REPOSITORY_FOLDER).toString();
|
private static final String CENTRAL_REPO_BASE_PATH = Paths.get(
|
||||||
|
SharedConfigPath.getInstance().getSharedConfigPath(),
|
||||||
|
CENTRAL_REPOSITORY_FOLDER).toString();
|
||||||
|
|
||||||
private static final String DEFAULT_DB_PARENT_PATH = Paths.get(CENTRAL_REPO_BASE_PATH, "LocalDatabase").toString();
|
private static final String DEFAULT_DB_PARENT_PATH = Paths.get(CENTRAL_REPO_BASE_PATH, "LocalDatabase").toString();
|
||||||
private static final String DEFAULT_DB_NAME = "central_repository.db";
|
private static final String DEFAULT_DB_NAME = "central_repository.db";
|
||||||
private static final String MODULE_SETTINGS_KEY = Paths.get(CENTRAL_REPOSITORY_FOLDER, CENTRAL_REPOSITORY_SETTINGS_NAME).toString();
|
private static final String MODULE_SETTINGS_KEY = Paths.get(
|
||||||
private static final String MODULE_SETTINGS_PROPERTIES = Paths.get(CENTRAL_REPO_BASE_PATH, CENTRAL_REPOSITORY_SETTINGS_NAME + ".properties").toString();
|
SharedConfigPath.getInstance().getSharedConfigFolder(),
|
||||||
|
CENTRAL_REPOSITORY_FOLDER,
|
||||||
|
CENTRAL_REPOSITORY_SETTINGS_NAME).toString();
|
||||||
|
|
||||||
|
private static final String MODULE_SETTINGS_PROPERTIES = Paths.get(
|
||||||
|
CENTRAL_REPO_BASE_PATH,
|
||||||
|
CENTRAL_REPOSITORY_SETTINGS_NAME + ".properties").toString();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The base path for central repository settings.
|
* @return The base path for central repository settings.
|
||||||
*/
|
*/
|
||||||
@ -59,7 +66,7 @@ public class CentralRepoSettings {
|
|||||||
public String getModuleSettingsKey() {
|
public String getModuleSettingsKey() {
|
||||||
return MODULE_SETTINGS_KEY;
|
return MODULE_SETTINGS_KEY;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The path to the central repo settings.
|
* @return The path to the central repo settings.
|
||||||
*/
|
*/
|
@ -24,7 +24,7 @@ import java.io.File;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.sleuthkit.autopsy.centralrepository.settings.CentralRepoSettings;
|
import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings;
|
||||||
import org.sleuthkit.autopsy.coordinationservice.CoordinationService;
|
import org.sleuthkit.autopsy.coordinationservice.CoordinationService;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
@ -32,7 +32,7 @@ import org.openide.windows.WindowManager;
|
|||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
import static org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepo.SOFTWARE_CR_DB_SCHEMA_VERSION;
|
import static org.sleuthkit.autopsy.centralrepository.datamodel.RdbmsCentralRepo.SOFTWARE_CR_DB_SCHEMA_VERSION;
|
||||||
import org.sleuthkit.autopsy.centralrepository.settings.CentralRepoSettings;
|
import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -25,7 +25,7 @@ package org.sleuthkit.autopsy.centralrepository.datamodel;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.sleuthkit.autopsy.centralrepository.settings.CentralRepoSettings;
|
import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferencesException;
|
import org.sleuthkit.autopsy.core.UserPreferencesException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
@ -29,7 +29,7 @@ import java.sql.DriverManager;
|
|||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import org.sleuthkit.autopsy.centralrepository.settings.CentralRepoSettings;
|
import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||||
@ -62,22 +62,6 @@ public final class SqliteCentralRepoSettings implements CentralRepoDbConnectivit
|
|||||||
private String dbDirectory;
|
private String dbDirectory;
|
||||||
private int bulkThreshold;
|
private int bulkThreshold;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The settings key for the name of the database.
|
|
||||||
*/
|
|
||||||
public static String getDatabaseNameKey() {
|
|
||||||
return DATABASE_NAME;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The settings key for the parent path of the database.
|
|
||||||
*/
|
|
||||||
public static String getDatabasePathKey() {
|
|
||||||
return DATABASE_PATH;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public SqliteCentralRepoSettings() {
|
public SqliteCentralRepoSettings() {
|
||||||
loadSettings();
|
loadSettings();
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbChoice;
|
|||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbManager;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbManager;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoException;
|
||||||
import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteCentralRepoSettings;
|
import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteCentralRepoSettings;
|
||||||
import org.sleuthkit.autopsy.centralrepository.settings.CentralRepoSettings;
|
import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings;
|
||||||
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
@ -49,7 +49,6 @@ public class Installer extends ModuleInstall {
|
|||||||
|
|
||||||
private static final String LEGACY_DEFAULT_FOLDER = "central_repository";
|
private static final String LEGACY_DEFAULT_FOLDER = "central_repository";
|
||||||
private static final String LEGACY_DEFAULT_DB_PARENT_PATH = Paths.get(PlatformUtil.getUserDirectory().getAbsolutePath(), LEGACY_DEFAULT_FOLDER).toAbsolutePath().toString();
|
private static final String LEGACY_DEFAULT_DB_PARENT_PATH = Paths.get(PlatformUtil.getUserDirectory().getAbsolutePath(), LEGACY_DEFAULT_FOLDER).toAbsolutePath().toString();
|
||||||
//private static final String LEGACY_DEFAULT_DB_NAME = "central_repository.db";
|
|
||||||
private static final String LEGACY_MODULE_SETTINGS_KEY = "CentralRepository";
|
private static final String LEGACY_MODULE_SETTINGS_KEY = "CentralRepository";
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(Installer.class.getName());
|
private static final Logger logger = Logger.getLogger(Installer.class.getName());
|
||||||
|
@ -216,7 +216,7 @@ public class Installer extends ModuleInstall {
|
|||||||
packageInstallers.add(org.sleuthkit.autopsy.healthmonitor.Installer.getDefault());
|
packageInstallers.add(org.sleuthkit.autopsy.healthmonitor.Installer.getDefault());
|
||||||
packageInstallers.add(org.sleuthkit.autopsy.casemodule.Installer.getDefault());
|
packageInstallers.add(org.sleuthkit.autopsy.casemodule.Installer.getDefault());
|
||||||
packageInstallers.add(org.sleuthkit.autopsy.texttranslation.translators.Installer.getDefault());
|
packageInstallers.add(org.sleuthkit.autopsy.texttranslation.translators.Installer.getDefault());
|
||||||
packageInstallers.add(org.sleuthkit.autopsy.modules.hashdatabase.installer.Installer.getDefault());
|
packageInstallers.add(org.sleuthkit.autopsy.modules.hashdatabase.infrastructure.Installer.getDefault());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a temporary workaround for the following bug in Tika that
|
* This is a temporary workaround for the following bug in Tika that
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.core;
|
package org.sleuthkit.autopsy.core;
|
||||||
|
|
||||||
import com.google.common.annotations.Beta;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -36,6 +35,7 @@ import org.apache.commons.lang3.tuple.Triple;
|
|||||||
import org.openide.util.Lookup;
|
import org.openide.util.Lookup;
|
||||||
import org.python.icu.util.TimeZone;
|
import org.python.icu.util.TimeZone;
|
||||||
import org.sleuthkit.autopsy.appservices.AutopsyService;
|
import org.sleuthkit.autopsy.appservices.AutopsyService;
|
||||||
|
import org.sleuthkit.autopsy.core.configpath.SharedConfigPath;
|
||||||
import org.sleuthkit.autopsy.machinesettings.UserMachinePreferences;
|
import org.sleuthkit.autopsy.machinesettings.UserMachinePreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||||
@ -51,7 +51,8 @@ import org.sleuthkit.datamodel.TskData.DbType;
|
|||||||
public final class UserPreferences {
|
public final class UserPreferences {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the path to the preferences for the identifier.
|
* Returns the path to the preferences for the identifier in the user config
|
||||||
|
* directory.
|
||||||
*
|
*
|
||||||
* @param identifier The identifier.
|
* @param identifier The identifier.
|
||||||
*
|
*
|
||||||
@ -61,42 +62,22 @@ public final class UserPreferences {
|
|||||||
return Paths.get(PlatformUtil.getUserConfigDirectory(), identifier + ".properties").toString();
|
return Paths.get(PlatformUtil.getUserConfigDirectory(), identifier + ".properties").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String VIEW_PREFERENCE_PATH = getConfigPreferencePath("ViewPreferences");
|
/**
|
||||||
|
* Returns the path to the preferences for the identifier in the shared
|
||||||
|
* preference directory.
|
||||||
|
*
|
||||||
|
* @param identifier The identifier.
|
||||||
|
*
|
||||||
|
* @return The path to the preference file.
|
||||||
|
*/
|
||||||
|
private static String getSharedPreferencePath(String identifier) {
|
||||||
|
return Paths.get(SharedConfigPath.getInstance().getSharedConfigPath(), identifier + ".properties").toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String VIEW_PREFERENCE_PATH = getSharedPreferencePath("ViewPreferences");
|
||||||
private static final String MACHINE_SPECIFIC_PREFERENCE_PATH = getConfigPreferencePath("MachineSpecificPreferences");
|
private static final String MACHINE_SPECIFIC_PREFERENCE_PATH = getConfigPreferencePath("MachineSpecificPreferences");
|
||||||
private static final String MODE_PREFERENCE_PATH = getConfigPreferencePath("ModePreferences");
|
private static final String MODE_PREFERENCE_PATH = getConfigPreferencePath("ModePreferences");
|
||||||
private static final String EXTERNAL_SERVICE_PREFERENCE_PATH = getConfigPreferencePath("ExternalServicePreferences");
|
private static final String EXTERNAL_SERVICE_PREFERENCE_PATH = getSharedPreferencePath("ExternalServicePreferences");
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The path to machine specific preferences.
|
|
||||||
*/
|
|
||||||
@Beta
|
|
||||||
public static String getMachineSpecificPreferencePath() {
|
|
||||||
return MACHINE_SPECIFIC_PREFERENCE_PATH;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The path to mode preferences.
|
|
||||||
*/
|
|
||||||
@Beta
|
|
||||||
public static String getModePreferencePath() {
|
|
||||||
return MODE_PREFERENCE_PATH;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The path to external service preferences.
|
|
||||||
*/
|
|
||||||
@Beta
|
|
||||||
public static String getExternalServicePreferencePath() {
|
|
||||||
return EXTERNAL_SERVICE_PREFERENCE_PATH;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The path to view preferences.
|
|
||||||
*/
|
|
||||||
@Beta
|
|
||||||
public static String getViewPreferencePath() {
|
|
||||||
return VIEW_PREFERENCE_PATH;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final ConfigProperties viewPreferences = new ConfigProperties(VIEW_PREFERENCE_PATH);
|
private static final ConfigProperties viewPreferences = new ConfigProperties(VIEW_PREFERENCE_PATH);
|
||||||
private static final ConfigProperties machineSpecificPreferences = new ConfigProperties(MACHINE_SPECIFIC_PREFERENCE_PATH);
|
private static final ConfigProperties machineSpecificPreferences = new ConfigProperties(MACHINE_SPECIFIC_PREFERENCE_PATH);
|
||||||
|
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2022 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 org.sleuthkit.autopsy.core.configpath;
|
||||||
|
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Path to sharable config.
|
||||||
|
*/
|
||||||
|
public class SharedConfigPath {
|
||||||
|
|
||||||
|
private static final SharedConfigPath instance = new SharedConfigPath();
|
||||||
|
|
||||||
|
private static final String SHARED_FOLDER = "SharableConfig";
|
||||||
|
private static final String SHARED_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), SHARED_FOLDER).toAbsolutePath().toString();
|
||||||
|
|
||||||
|
private SharedConfigPath() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return An instance of this class.
|
||||||
|
*/
|
||||||
|
public static SharedConfigPath getInstance() {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The path to a folder for config items that can be shared between
|
||||||
|
* different instances.
|
||||||
|
*/
|
||||||
|
public String getSharedConfigPath() {
|
||||||
|
return SHARED_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The folder in user config for shared config.
|
||||||
|
*/
|
||||||
|
public String getSharedConfigFolder() {
|
||||||
|
return SHARED_FOLDER;
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.coreutils;
|
package org.sleuthkit.autopsy.coreutils;
|
||||||
|
|
||||||
import com.google.common.annotations.Beta;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@ -132,8 +131,7 @@ public class ModuleSettings {
|
|||||||
*
|
*
|
||||||
* @return The settings file path as a string.
|
* @return The settings file path as a string.
|
||||||
*/
|
*/
|
||||||
@Beta
|
static String getSettingsFilePath(String moduleName) {
|
||||||
public static String getSettingsFilePath(String moduleName) {
|
|
||||||
return Paths.get(MODULE_DIR_PATH, moduleName + SETTINGS_FILE_EXT).toString();
|
return Paths.get(MODULE_DIR_PATH, moduleName + SETTINGS_FILE_EXT).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.ingest;
|
package org.sleuthkit.autopsy.ingest;
|
||||||
|
|
||||||
import com.google.common.annotations.Beta;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
@ -37,9 +36,9 @@ import java.util.logging.Level;
|
|||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.io.NbObjectInputStream;
|
import org.openide.util.io.NbObjectInputStream;
|
||||||
import org.openide.util.io.NbObjectOutputStream;
|
import org.openide.util.io.NbObjectOutputStream;
|
||||||
|
import org.sleuthkit.autopsy.core.configpath.SharedConfigPath;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
|
||||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSet;
|
import org.sleuthkit.autopsy.modules.interestingitems.FilesSet;
|
||||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetsManager;
|
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetsManager;
|
||||||
import org.sleuthkit.autopsy.python.FactoryClassNameNormalizer;
|
import org.sleuthkit.autopsy.python.FactoryClassNameNormalizer;
|
||||||
@ -52,8 +51,18 @@ public final class IngestJobSettings {
|
|||||||
private static final String ENABLED_MODULES_PROPERTY = "Enabled_Ingest_Modules"; //NON-NLS
|
private static final String ENABLED_MODULES_PROPERTY = "Enabled_Ingest_Modules"; //NON-NLS
|
||||||
private static final String DISABLED_MODULES_PROPERTY = "Disabled_Ingest_Modules"; //NON-NLS
|
private static final String DISABLED_MODULES_PROPERTY = "Disabled_Ingest_Modules"; //NON-NLS
|
||||||
private static final String LAST_FILE_INGEST_FILTER_PROPERTY = "Last_File_Ingest_Filter"; //NON-NLS
|
private static final String LAST_FILE_INGEST_FILTER_PROPERTY = "Last_File_Ingest_Filter"; //NON-NLS
|
||||||
private static final String MODULE_SETTINGS_FOLDER = "IngestSettings"; //NON-NLS
|
private static final String MODULE_SETTINGS_FOLDER_NAME = "IngestSettings"; //NON-NLS
|
||||||
private static final String MODULE_SETTINGS_FOLDER_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), IngestJobSettings.MODULE_SETTINGS_FOLDER).toAbsolutePath().toString();
|
|
||||||
|
private static final String MODULE_SETTINGS_FOLDER = Paths.get(
|
||||||
|
SharedConfigPath.getInstance().getSharedConfigFolder(),
|
||||||
|
MODULE_SETTINGS_FOLDER_NAME
|
||||||
|
).toString();
|
||||||
|
|
||||||
|
private static final String MODULE_SETTINGS_FOLDER_PATH = Paths.get(
|
||||||
|
SharedConfigPath.getInstance().getSharedConfigPath(),
|
||||||
|
IngestJobSettings.MODULE_SETTINGS_FOLDER_NAME
|
||||||
|
).toAbsolutePath().toString();
|
||||||
|
|
||||||
private static final String MODULE_SETTINGS_FILE_EXT = ".settings"; //NON-NLS
|
private static final String MODULE_SETTINGS_FILE_EXT = ".settings"; //NON-NLS
|
||||||
private static final CharSequence PYTHON_CLASS_PROXY_PREFIX = "org.python.proxies.".subSequence(0, "org.python.proxies.".length() - 1); //NON-NLS
|
private static final CharSequence PYTHON_CLASS_PROXY_PREFIX = "org.python.proxies.".subSequence(0, "org.python.proxies.".length() - 1); //NON-NLS
|
||||||
private static final Logger logger = Logger.getLogger(IngestJobSettings.class.getName());
|
private static final Logger logger = Logger.getLogger(IngestJobSettings.class.getName());
|
||||||
@ -63,29 +72,26 @@ public final class IngestJobSettings {
|
|||||||
private String executionContext;
|
private String executionContext;
|
||||||
private FilesSet fileFilter;
|
private FilesSet fileFilter;
|
||||||
private String moduleSettingsFolderPath;
|
private String moduleSettingsFolderPath;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The base path to module settings.
|
* @return The base path to module settings.
|
||||||
*/
|
*/
|
||||||
@Beta
|
static String getBaseSettingsPath() {
|
||||||
public static String getBaseSettingsPath() {
|
|
||||||
return MODULE_SETTINGS_FOLDER_PATH;
|
return MODULE_SETTINGS_FOLDER_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the string to use with ModuleSettings for resource identification.
|
* Returns the string to use with ModuleSettings for resource
|
||||||
|
* identification.
|
||||||
|
*
|
||||||
* @param executionContext The execution context.
|
* @param executionContext The execution context.
|
||||||
* @return
|
*
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
static String getModuleSettingsResource(String executionContext) {
|
static String getModuleSettingsResource(String executionContext) {
|
||||||
return Paths.get(MODULE_SETTINGS_FOLDER, executionContext).toString();
|
return Paths.get(MODULE_SETTINGS_FOLDER, executionContext).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the path to the module settings folder for a given execution
|
* Gets the path to the module settings folder for a given execution
|
||||||
* context.
|
* context.
|
||||||
@ -95,7 +101,7 @@ public final class IngestJobSettings {
|
|||||||
* contexts may have different ingest job settings.
|
* contexts may have different ingest job settings.
|
||||||
*
|
*
|
||||||
* @param executionContext The execution context identifier.
|
* @param executionContext The execution context identifier.
|
||||||
*
|
*
|
||||||
* @return The path to the module settings folder
|
* @return The path to the module settings folder
|
||||||
*/
|
*/
|
||||||
static Path getSavedModuleSettingsFolder(String executionContext) {
|
static Path getSavedModuleSettingsFolder(String executionContext) {
|
||||||
@ -518,7 +524,7 @@ public final class IngestJobSettings {
|
|||||||
* specified context.
|
* specified context.
|
||||||
*
|
*
|
||||||
* @param context -the execution context (profile name) to check.
|
* @param context -the execution context (profile name) to check.
|
||||||
*
|
*
|
||||||
* @return the names of the enabled modules
|
* @return the names of the enabled modules
|
||||||
*/
|
*/
|
||||||
static List<String> getEnabledModules(String context) {
|
static List<String> getEnabledModules(String context) {
|
||||||
@ -597,7 +603,7 @@ public final class IngestJobSettings {
|
|||||||
disabledModuleNames.add(moduleName);
|
disabledModuleNames.add(moduleName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String ingestModuleResource = getModuleSettingsResource(this.executionContext);
|
String ingestModuleResource = getModuleSettingsResource(this.executionContext);
|
||||||
ModuleSettings.setConfigSetting(ingestModuleResource, IngestJobSettings.ENABLED_MODULES_PROPERTY, makeCsvList(enabledModuleNames));
|
ModuleSettings.setConfigSetting(ingestModuleResource, IngestJobSettings.ENABLED_MODULES_PROPERTY, makeCsvList(enabledModuleNames));
|
||||||
ModuleSettings.setConfigSetting(ingestModuleResource, IngestJobSettings.DISABLED_MODULES_PROPERTY, makeCsvList(disabledModuleNames));
|
ModuleSettings.setConfigSetting(ingestModuleResource, IngestJobSettings.DISABLED_MODULES_PROPERTY, makeCsvList(disabledModuleNames));
|
||||||
|
@ -45,8 +45,7 @@ public final class IngestProfiles {
|
|||||||
* @return Prefix to append to an ingest profile name when saving to disk or
|
* @return Prefix to append to an ingest profile name when saving to disk or
|
||||||
* using with ingest job settings.
|
* using with ingest job settings.
|
||||||
*/
|
*/
|
||||||
@Beta
|
static String getIngestProfilePrefix() {
|
||||||
public static String getIngestProfilePrefix() {
|
|
||||||
return SETTINGS_FILE_PREFIX;
|
return SETTINGS_FILE_PREFIX;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,13 +18,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.sleuthkit.autopsy.modules.hashdatabase;
|
package org.sleuthkit.autopsy.modules.hashdatabase;
|
||||||
|
|
||||||
import com.google.common.annotations.Beta;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -37,7 +35,6 @@ import org.openide.util.io.NbObjectOutputStream;
|
|||||||
import org.openide.windows.WindowManager;
|
import org.openide.windows.WindowManager;
|
||||||
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
import org.sleuthkit.autopsy.core.RuntimeProperties;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
|
||||||
import org.sleuthkit.autopsy.coreutils.XMLUtil;
|
import org.sleuthkit.autopsy.coreutils.XMLUtil;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.CentralRepoHashSet;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.CentralRepoHashSet;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.SleuthkitHashSet;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.SleuthkitHashSet;
|
||||||
@ -46,16 +43,12 @@ import org.w3c.dom.Document;
|
|||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
||||||
|
import org.sleuthkit.autopsy.modules.hashdatabase.infrastructure.HashConfigPaths;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to represent the settings to be serialized for hash lookup.
|
* Class to represent the settings to be serialized for hash lookup.
|
||||||
*/
|
*/
|
||||||
public final class HashLookupSettings implements Serializable {
|
final class HashLookupSettings implements Serializable {
|
||||||
|
|
||||||
private static final String HASHSET_FOLDER = "HashLookup";
|
|
||||||
private static final String HASHSET_CONFIG_DIR = Paths.get(PlatformUtil.getUserConfigDirectory(), HASHSET_FOLDER).toAbsolutePath().toString();
|
|
||||||
private static final String SERIALIZATION_FILE_NAME = "hashLookup.settings"; //NON-NLS
|
|
||||||
private static final String SERIALIZATION_FILE_PATH = Paths.get(HASHSET_CONFIG_DIR, SERIALIZATION_FILE_NAME).toString(); //NON-NLS
|
|
||||||
private static final String SET_ELEMENT = "hash_set"; //NON-NLS
|
private static final String SET_ELEMENT = "hash_set"; //NON-NLS
|
||||||
private static final String SET_NAME_ATTRIBUTE = "name"; //NON-NLS
|
private static final String SET_NAME_ATTRIBUTE = "name"; //NON-NLS
|
||||||
private static final String SET_TYPE_ATTRIBUTE = "type"; //NON-NLS
|
private static final String SET_TYPE_ATTRIBUTE = "type"; //NON-NLS
|
||||||
@ -63,11 +56,6 @@ public final class HashLookupSettings implements Serializable {
|
|||||||
private static final String SEND_INGEST_MESSAGES_ATTRIBUTE = "show_inbox_messages"; //NON-NLS
|
private static final String SEND_INGEST_MESSAGES_ATTRIBUTE = "show_inbox_messages"; //NON-NLS
|
||||||
private static final String PATH_ELEMENT = "hash_set_path"; //NON-NLS
|
private static final String PATH_ELEMENT = "hash_set_path"; //NON-NLS
|
||||||
private static final String LEGACY_PATH_NUMBER_ATTRIBUTE = "number"; //NON-NLS
|
private static final String LEGACY_PATH_NUMBER_ATTRIBUTE = "number"; //NON-NLS
|
||||||
private static final String CONFIG_FILE_NAME = "hashsets.xml"; //NON-NLS
|
|
||||||
private static final String CONFIG_FILE_PATH = Paths.get(HASHSET_CONFIG_DIR, CONFIG_FILE_NAME).toString();
|
|
||||||
private static final String HASH_DATABASE_DEFAULT_FOLDER = "HashDatabases";
|
|
||||||
private static final String HASH_DATABASE_DEFAULT_PATH = Paths.get(HASHSET_CONFIG_DIR, HASH_DATABASE_DEFAULT_FOLDER).toString();
|
|
||||||
|
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(HashDbManager.class.getName());
|
private static final Logger logger = Logger.getLogger(HashDbManager.class.getName());
|
||||||
|
|
||||||
@ -79,26 +67,23 @@ public final class HashLookupSettings implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* @return The path to the hash db settings file.
|
* @return The path to the hash db settings file.
|
||||||
*/
|
*/
|
||||||
@Beta
|
static String getSettingsPath() {
|
||||||
public static String getSettingsPath() {
|
return HashConfigPaths.getInstance().getSettingsPath();
|
||||||
return SERIALIZATION_FILE_PATH;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The default database folder path.
|
* @return The default database folder path.
|
||||||
*/
|
*/
|
||||||
@Beta
|
static String getDefaultDbPath() {
|
||||||
public static String getDefaultDbPath() {
|
return HashConfigPaths.getInstance().getDefaultDbPath();
|
||||||
return HASH_DATABASE_DEFAULT_PATH;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The base path of the hashset config folder.
|
* @return The base path of the hashset config folder.
|
||||||
*/
|
*/
|
||||||
@Beta
|
static String getBaseHashsetConfigPath() {
|
||||||
public static String getBaseHashsetConfigPath() {
|
return HashConfigPaths.getInstance().getBasePath();
|
||||||
return HASHSET_CONFIG_DIR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -140,7 +125,7 @@ public final class HashLookupSettings implements Serializable {
|
|||||||
* settings.
|
* settings.
|
||||||
*/
|
*/
|
||||||
static HashLookupSettings readSettings() throws HashLookupSettingsException {
|
static HashLookupSettings readSettings() throws HashLookupSettingsException {
|
||||||
File fileSetFile = new File(SERIALIZATION_FILE_PATH);
|
File fileSetFile = new File(HashConfigPaths.getInstance().getSettingsPath());
|
||||||
if (fileSetFile.exists()) {
|
if (fileSetFile.exists()) {
|
||||||
return readSerializedSettings();
|
return readSerializedSettings();
|
||||||
}
|
}
|
||||||
@ -159,7 +144,7 @@ public final class HashLookupSettings implements Serializable {
|
|||||||
*/
|
*/
|
||||||
private static HashLookupSettings readSerializedSettings() throws HashLookupSettingsException {
|
private static HashLookupSettings readSerializedSettings() throws HashLookupSettingsException {
|
||||||
try {
|
try {
|
||||||
try (NbObjectInputStream in = new NbObjectInputStream(new FileInputStream(SERIALIZATION_FILE_PATH))) {
|
try (NbObjectInputStream in = new NbObjectInputStream(new FileInputStream(HashConfigPaths.getInstance().getSettingsPath()))) {
|
||||||
HashLookupSettings filesSetsSettings = (HashLookupSettings) in.readObject();
|
HashLookupSettings filesSetsSettings = (HashLookupSettings) in.readObject();
|
||||||
|
|
||||||
/* NOTE: to support JIRA-4177, we need to check if any of the hash
|
/* NOTE: to support JIRA-4177, we need to check if any of the hash
|
||||||
@ -185,12 +170,12 @@ public final class HashLookupSettings implements Serializable {
|
|||||||
* settings
|
* settings
|
||||||
*/
|
*/
|
||||||
private static HashLookupSettings readXmlSettings() throws HashLookupSettingsException {
|
private static HashLookupSettings readXmlSettings() throws HashLookupSettingsException {
|
||||||
File xmlFile = new File(CONFIG_FILE_PATH);
|
File xmlFile = new File(HashConfigPaths.getInstance().getXmlSettingsPath());
|
||||||
if (xmlFile.exists()) {
|
if (xmlFile.exists()) {
|
||||||
boolean updatedSchema = false;
|
boolean updatedSchema = false;
|
||||||
|
|
||||||
// Open the XML document that implements the configuration file.
|
// Open the XML document that implements the configuration file.
|
||||||
final Document doc = XMLUtil.loadDoc(HashDbManager.class, CONFIG_FILE_PATH);
|
final Document doc = XMLUtil.loadDoc(HashDbManager.class, HashConfigPaths.getInstance().getXmlSettingsPath());
|
||||||
if (doc == null) {
|
if (doc == null) {
|
||||||
throw new HashLookupSettingsException("Could not open xml document.");
|
throw new HashLookupSettingsException("Could not open xml document.");
|
||||||
}
|
}
|
||||||
@ -285,13 +270,13 @@ public final class HashLookupSettings implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (updatedSchema) {
|
if (updatedSchema) {
|
||||||
String backupFilePath = CONFIG_FILE_PATH + ".v1_backup"; //NON-NLS
|
String backupFilePath = HashConfigPaths.getInstance().getXmlSettingsPath() + ".v1_backup"; //NON-NLS
|
||||||
String messageBoxTitle = NbBundle.getMessage(HashLookupSettings.class,
|
String messageBoxTitle = NbBundle.getMessage(HashLookupSettings.class,
|
||||||
"HashDbManager.msgBoxTitle.confFileFmtChanged");
|
"HashDbManager.msgBoxTitle.confFileFmtChanged");
|
||||||
String baseMessage = NbBundle.getMessage(HashLookupSettings.class,
|
String baseMessage = NbBundle.getMessage(HashLookupSettings.class,
|
||||||
"HashDbManager.baseMessage.updatedFormatHashDbConfig");
|
"HashDbManager.baseMessage.updatedFormatHashDbConfig");
|
||||||
try {
|
try {
|
||||||
FileUtils.copyFile(new File(CONFIG_FILE_PATH), new File(backupFilePath));
|
FileUtils.copyFile(new File(HashConfigPaths.getInstance().getXmlSettingsPath()), new File(backupFilePath));
|
||||||
logger.log(Level.INFO, "Updated the schema, backup saved at: " + backupFilePath);
|
logger.log(Level.INFO, "Updated the schema, backup saved at: " + backupFilePath);
|
||||||
if (RuntimeProperties.runningWithGUI()) {
|
if (RuntimeProperties.runningWithGUI()) {
|
||||||
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
|
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
|
||||||
@ -330,7 +315,7 @@ public final class HashLookupSettings implements Serializable {
|
|||||||
the current user directory path.
|
the current user directory path.
|
||||||
*/
|
*/
|
||||||
convertPathToPlaceholder(settings);
|
convertPathToPlaceholder(settings);
|
||||||
try (NbObjectOutputStream out = new NbObjectOutputStream(new FileOutputStream(SERIALIZATION_FILE_PATH))) {
|
try (NbObjectOutputStream out = new NbObjectOutputStream(new FileOutputStream(HashConfigPaths.getInstance().getSettingsPath()))) {
|
||||||
out.writeObject(settings);
|
out.writeObject(settings);
|
||||||
// restore the paths, in case they are going to be used somewhere
|
// restore the paths, in case they are going to be used somewhere
|
||||||
convertPlaceholderToPath(settings);
|
convertPlaceholderToPath(settings);
|
||||||
@ -352,9 +337,9 @@ public final class HashLookupSettings implements Serializable {
|
|||||||
for (HashDbInfo hashDbInfo : settings.getHashDbInfo()) {
|
for (HashDbInfo hashDbInfo : settings.getHashDbInfo()) {
|
||||||
if (hashDbInfo.isFileDatabaseType()) {
|
if (hashDbInfo.isFileDatabaseType()) {
|
||||||
String dbPath = hashDbInfo.getPath();
|
String dbPath = hashDbInfo.getPath();
|
||||||
if (dbPath.startsWith(HASHSET_CONFIG_DIR)) {
|
if (dbPath.startsWith(HashConfigPaths.getInstance().getBasePath())) {
|
||||||
// replace the current user directory with place holder
|
// replace the current user directory with place holder
|
||||||
String remainingPath = dbPath.substring(HASHSET_CONFIG_DIR.length());
|
String remainingPath = dbPath.substring(HashConfigPaths.getInstance().getBasePath().length());
|
||||||
hashDbInfo.setPath(USER_DIR_PLACEHOLDER + remainingPath);
|
hashDbInfo.setPath(USER_DIR_PLACEHOLDER + remainingPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -375,7 +360,7 @@ public final class HashLookupSettings implements Serializable {
|
|||||||
if (dbPath.startsWith(USER_DIR_PLACEHOLDER)) {
|
if (dbPath.startsWith(USER_DIR_PLACEHOLDER)) {
|
||||||
// replace the place holder with current user directory
|
// replace the place holder with current user directory
|
||||||
String remainingPath = dbPath.substring(USER_DIR_PLACEHOLDER.length());
|
String remainingPath = dbPath.substring(USER_DIR_PLACEHOLDER.length());
|
||||||
hashDbInfo.setPath(HASHSET_CONFIG_DIR + remainingPath);
|
hashDbInfo.setPath(HashConfigPaths.getInstance().getBasePath() + remainingPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,82 @@
|
|||||||
|
/*
|
||||||
|
* Autopsy Forensic Browser
|
||||||
|
*
|
||||||
|
* Copyright 2022 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 org.sleuthkit.autopsy.modules.hashdatabase.infrastructure;
|
||||||
|
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
import org.sleuthkit.autopsy.core.configpath.SharedConfigPath;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Paths for hash config files.
|
||||||
|
*/
|
||||||
|
public class HashConfigPaths {
|
||||||
|
|
||||||
|
private static final HashConfigPaths instance = new HashConfigPaths();
|
||||||
|
|
||||||
|
private static final String HASHSET_FOLDER = "HashLookup";
|
||||||
|
private static final String SERIALIZATION_FILE_NAME = "hashLookup.settings"; //NON-NLS
|
||||||
|
|
||||||
|
private static final String HASH_CONFIG_PATH = Paths.get(SharedConfigPath.getInstance().getSharedConfigPath(), HASHSET_FOLDER).toAbsolutePath().toString();
|
||||||
|
|
||||||
|
private static final String XML_FILE_NAME = "hashsets.xml"; //NON-NLS
|
||||||
|
private static final String XML_FILE_PATH = Paths.get(HASH_CONFIG_PATH, XML_FILE_NAME).toAbsolutePath().toString();
|
||||||
|
|
||||||
|
private static final String HASH_DATABASE_DEFAULT_FOLDER = "HashDatabases";
|
||||||
|
private static final String HASH_DATABASE_DEFAULT_PATH = Paths.get(HASH_CONFIG_PATH, HASH_DATABASE_DEFAULT_FOLDER).toString();
|
||||||
|
|
||||||
|
private static final String SERIALIZATION_FILE_PATH = Paths.get(HASH_CONFIG_PATH, SERIALIZATION_FILE_NAME).toString(); //NON-NLS
|
||||||
|
|
||||||
|
|
||||||
|
private HashConfigPaths() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Singleton instance of this class.
|
||||||
|
*/
|
||||||
|
public static HashConfigPaths getInstance() {
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The base path to the config file.
|
||||||
|
*/
|
||||||
|
public String getBasePath() {
|
||||||
|
return HASH_CONFIG_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The default hash database path.
|
||||||
|
*/
|
||||||
|
public String getDefaultDbPath() {
|
||||||
|
return HASH_DATABASE_DEFAULT_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The path to the serialized settings file.
|
||||||
|
*/
|
||||||
|
public String getSettingsPath() {
|
||||||
|
return SERIALIZATION_FILE_PATH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return The path to the xml settings file.
|
||||||
|
*/
|
||||||
|
public String getXmlSettingsPath() {
|
||||||
|
return XML_FILE_PATH;
|
||||||
|
}
|
||||||
|
}
|
@ -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.modules.hashdatabase.installer;
|
package org.sleuthkit.autopsy.modules.hashdatabase.infrastructure;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -27,13 +27,13 @@ import org.openide.modules.ModuleInstall;
|
|||||||
import org.python.icu.text.MessageFormat;
|
import org.python.icu.text.MessageFormat;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashLookupSettings;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Installer for hash databases that copies legacy settings to new location.
|
* Installer for hash databases that copies legacy settings to new location.
|
||||||
*/
|
*/
|
||||||
public class Installer extends ModuleInstall {
|
public class Installer extends ModuleInstall {
|
||||||
|
|
||||||
|
private static final String LEGACY_SERIALIZATION_XML_FILE_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), "hashsets.xml").toString();
|
||||||
private static final String LEGACY_SERIALIZATION_FILE_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), "hashLookup.settings").toString(); //NON-NLS
|
private static final String LEGACY_SERIALIZATION_FILE_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), "hashLookup.settings").toString(); //NON-NLS
|
||||||
private static final String LEGACY_HASH_DATABASE_DEFAULT_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), "HashDatabases").toString();
|
private static final String LEGACY_HASH_DATABASE_DEFAULT_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), "HashDatabases").toString();
|
||||||
|
|
||||||
@ -69,19 +69,18 @@ public class Installer extends ModuleInstall {
|
|||||||
public void restored() {
|
public void restored() {
|
||||||
// copy user dir hash dbs from legacy to new if old path exists and new does not.
|
// copy user dir hash dbs from legacy to new if old path exists and new does not.
|
||||||
File legacyDbPath = new File(LEGACY_HASH_DATABASE_DEFAULT_PATH);
|
File legacyDbPath = new File(LEGACY_HASH_DATABASE_DEFAULT_PATH);
|
||||||
File dbPath = new File(HashLookupSettings.getDefaultDbPath());
|
File dbPath = new File(HashConfigPaths.getInstance().getDefaultDbPath());
|
||||||
if (legacyDbPath.exists() && !dbPath.exists()) {
|
if (legacyDbPath.exists() && !dbPath.exists()) {
|
||||||
try {
|
try {
|
||||||
FileUtils.copyDirectory(legacyDbPath, dbPath);
|
FileUtils.copyDirectory(legacyDbPath, dbPath);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.log(Level.WARNING, MessageFormat.format("There was an error copying legacy path hash dbs from {0} to {1}", legacyDbPath, dbPath), ex);
|
logger.log(Level.WARNING, MessageFormat.format("There was an error copying legacy path hash dbs from {0} to {1}", legacyDbPath, dbPath), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy hash db settings to new location.
|
// copy hash db settings to new location.
|
||||||
File legacySettingsFile = new File(LEGACY_SERIALIZATION_FILE_PATH);
|
File legacySettingsFile = new File(LEGACY_SERIALIZATION_FILE_PATH);
|
||||||
File settingsFile = new File(HashLookupSettings.getSettingsPath());
|
File settingsFile = new File(HashConfigPaths.getInstance().getSettingsPath());
|
||||||
if (legacySettingsFile.exists() && !settingsFile.exists()) {
|
if (legacySettingsFile.exists() && !settingsFile.exists()) {
|
||||||
try {
|
try {
|
||||||
FileUtils.copyFile(legacySettingsFile, settingsFile);
|
FileUtils.copyFile(legacySettingsFile, settingsFile);
|
||||||
@ -89,6 +88,17 @@ public class Installer extends ModuleInstall {
|
|||||||
logger.log(Level.WARNING, MessageFormat.format("There was an error copying legacy hash db settings from {0} to {1}", legacySettingsFile, settingsFile), ex);
|
logger.log(Level.WARNING, MessageFormat.format("There was an error copying legacy hash db settings from {0} to {1}", legacySettingsFile, settingsFile), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File legacyXmlSettingsFile = new File(LEGACY_SERIALIZATION_XML_FILE_PATH);
|
||||||
|
File xmlSettingsFile = new File(HashConfigPaths.getInstance().getXmlSettingsPath());
|
||||||
|
if (legacyXmlSettingsFile.exists() && !xmlSettingsFile.exists()) {
|
||||||
|
try {
|
||||||
|
FileUtils.copyFile(legacyXmlSettingsFile, xmlSettingsFile);
|
||||||
|
} catch (IOException ex) {
|
||||||
|
logger.log(Level.WARNING, MessageFormat.format("There was an error copying legacy xml hash db settings from {0} to {1}", legacyXmlSettingsFile, xmlSettingsFile), ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -84,16 +84,14 @@ public final class FilesSetsManager extends Observable {
|
|||||||
/**
|
/**
|
||||||
* @return The path to file filter settings.
|
* @return The path to file filter settings.
|
||||||
*/
|
*/
|
||||||
@Beta
|
static String getFileFilterPath() {
|
||||||
public static String getFileFilterPath() {
|
|
||||||
return FILE_FILTER_PATH;
|
return FILE_FILTER_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The path to interesting item settings.
|
* @return The path to interesting item settings.
|
||||||
*/
|
*/
|
||||||
@Beta
|
static String getInterestingItemPath() {
|
||||||
public static String getInterestingItemPath() {
|
|
||||||
return INTERESTING_ITEM_PATH;
|
return INTERESTING_ITEM_PATH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,8 +89,7 @@ class InterestingItemsFilesSetSettings implements Serializable {
|
|||||||
private static final String EXTENSION_RULE_TAG = "EXTENSION"; //NON-NLS
|
private static final String EXTENSION_RULE_TAG = "EXTENSION"; //NON-NLS
|
||||||
private static final String STANDARD_SET = "standardSet";
|
private static final String STANDARD_SET = "standardSet";
|
||||||
private static final String VERSION_NUMBER = "versionNumber";
|
private static final String VERSION_NUMBER = "versionNumber";
|
||||||
|
|
||||||
|
|
||||||
private Map<String, FilesSet> filesSets;
|
private Map<String, FilesSet> filesSets;
|
||||||
|
|
||||||
InterestingItemsFilesSetSettings(Map<String, FilesSet> filesSets) {
|
InterestingItemsFilesSetSettings(Map<String, FilesSet> filesSets) {
|
||||||
|
@ -29,7 +29,6 @@ import java.io.IOException;
|
|||||||
import java.io.UncheckedIOException;
|
import java.io.UncheckedIOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@ -197,20 +196,6 @@ public final class LeappFileProcessor {
|
|||||||
.put("call history.tsv", "calllog")
|
.put("call history.tsv", "calllog")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
private static final String BASE_FOLDER = "LeappProcessor";
|
|
||||||
private static final String BASE_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), BASE_FOLDER).toString();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The path to an xml file config file on disk.
|
|
||||||
*
|
|
||||||
* @param xmlFileName The xml file name.
|
|
||||||
*
|
|
||||||
* @return The path to the xml file.
|
|
||||||
*/
|
|
||||||
private static String getXmlPath(String xmlFileName) {
|
|
||||||
return Paths.get(BASE_PATH, xmlFileName).toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
private final Blackboard blkBoard;
|
private final Blackboard blkBoard;
|
||||||
|
|
||||||
public LeappFileProcessor(String xmlFile, String moduleName, IngestJobContext context) throws IOException, IngestModuleException, NoCurrentCaseException {
|
public LeappFileProcessor(String xmlFile, String moduleName, IngestJobContext context) throws IOException, IngestModuleException, NoCurrentCaseException {
|
||||||
@ -1093,7 +1078,7 @@ public final class LeappFileProcessor {
|
|||||||
private void loadConfigFile() throws IngestModuleException {
|
private void loadConfigFile() throws IngestModuleException {
|
||||||
Document xmlinput;
|
Document xmlinput;
|
||||||
try {
|
try {
|
||||||
String path = getXmlPath(xmlFile);
|
String path = PlatformUtil.getUserConfigDirectory() + File.separator + xmlFile;
|
||||||
File f = new File(path);
|
File f = new File(path);
|
||||||
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
|
||||||
DocumentBuilder db = dbf.newDocumentBuilder();
|
DocumentBuilder db = dbf.newDocumentBuilder();
|
||||||
@ -1278,18 +1263,8 @@ public final class LeappFileProcessor {
|
|||||||
* @throws org.sleuthkit.autopsy.ingest.IngestModule.IngestModuleException
|
* @throws org.sleuthkit.autopsy.ingest.IngestModule.IngestModuleException
|
||||||
*/
|
*/
|
||||||
private void configExtractor() throws IOException {
|
private void configExtractor() throws IOException {
|
||||||
File curFileLoc = Paths.get(PlatformUtil.getUserConfigDirectory(), xmlFile).toFile();
|
PlatformUtil.extractResourceToUserConfigDir(LeappFileProcessor.class,
|
||||||
File newFileLoc = new File(getXmlPath(xmlFile));
|
xmlFile, true);
|
||||||
|
|
||||||
if (!newFileLoc.exists()) {
|
|
||||||
PlatformUtil.extractResourceToUserConfigDir(LeappFileProcessor.class,
|
|
||||||
xmlFile, true);
|
|
||||||
|
|
||||||
if (curFileLoc.exists()) {
|
|
||||||
newFileLoc.getParentFile().mkdirs();
|
|
||||||
curFileLoc.renameTo(newFileLoc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Set<String> ALLOWED_EXTENSIONS = new HashSet<>(Arrays.asList("zip", "tar", "tgz"));
|
private static final Set<String> ALLOWED_EXTENSIONS = new HashSet<>(Arrays.asList("zip", "tar", "tgz"));
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* Autopsy Forensic Browser
|
|
||||||
*
|
|
||||||
* Copyright 2022 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 org.sleuthkit.autopsy.report;
|
|
||||||
|
|
||||||
import org.sleuthkit.autopsy.report.infrastructure.ReportingConfigLoader;
|
|
||||||
import com.google.common.annotations.Beta;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Paths to report config.
|
|
||||||
*/
|
|
||||||
public class ReportingConfigPath {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The base path for reports.
|
|
||||||
*/
|
|
||||||
@Beta
|
|
||||||
public static String getBaseReportPath() {
|
|
||||||
return ReportingConfigLoader.getBaseReportPath();
|
|
||||||
}
|
|
||||||
}
|
|
@ -36,8 +36,8 @@ import java.util.TreeSet;
|
|||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.openide.util.io.NbObjectInputStream;
|
import org.openide.util.io.NbObjectInputStream;
|
||||||
import org.openide.util.io.NbObjectOutputStream;
|
import org.openide.util.io.NbObjectOutputStream;
|
||||||
|
import org.sleuthkit.autopsy.core.configpath.SharedConfigPath;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
|
||||||
import org.sleuthkit.autopsy.report.GeneralReportSettings;
|
import org.sleuthkit.autopsy.report.GeneralReportSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,11 +45,15 @@ import org.sleuthkit.autopsy.report.GeneralReportSettings;
|
|||||||
* all of the settings that make up a reporting configuration in an atomic,
|
* all of the settings that make up a reporting configuration in an atomic,
|
||||||
* thread safe way.
|
* thread safe way.
|
||||||
*/
|
*/
|
||||||
public final class ReportingConfigLoader {
|
final class ReportingConfigLoader {
|
||||||
|
|
||||||
private static final Logger logger = Logger.getLogger(ReportingConfigLoader.class.getName());
|
private static final Logger logger = Logger.getLogger(ReportingConfigLoader.class.getName());
|
||||||
private static final String REPORT_CONFIG_FOLDER = "ReportingConfigs"; //NON-NLS
|
private static final String REPORT_CONFIG_FOLDER = "ReportingConfigs"; //NON-NLS
|
||||||
private static final String REPORT_CONFIG_FOLDER_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), ReportingConfigLoader.REPORT_CONFIG_FOLDER).toAbsolutePath().toString();
|
private static final String REPORT_CONFIG_FOLDER_PATH = Paths.get(
|
||||||
|
SharedConfigPath.getInstance().getSharedConfigPath(),
|
||||||
|
ReportingConfigLoader.REPORT_CONFIG_FOLDER
|
||||||
|
).toAbsolutePath().toString();
|
||||||
|
|
||||||
private static final String REPORT_SETTINGS_FILE_EXTENSION = ".settings";
|
private static final String REPORT_SETTINGS_FILE_EXTENSION = ".settings";
|
||||||
private static final String TABLE_REPORT_CONFIG_FILE = "TableReportSettings.settings";
|
private static final String TABLE_REPORT_CONFIG_FILE = "TableReportSettings.settings";
|
||||||
private static final String FILE_REPORT_CONFIG_FILE = "FileReportSettings.settings";
|
private static final String FILE_REPORT_CONFIG_FILE = "FileReportSettings.settings";
|
||||||
@ -61,13 +65,6 @@ public final class ReportingConfigLoader {
|
|||||||
// existing in the configuration file.
|
// existing in the configuration file.
|
||||||
private static final List<String> DELETED_REPORT_MODULES = Arrays.asList("org.sleuthkit.autopsy.report.modules.stix.STIXReportModule");
|
private static final List<String> DELETED_REPORT_MODULES = Arrays.asList("org.sleuthkit.autopsy.report.modules.stix.STIXReportModule");
|
||||||
|
|
||||||
/**
|
|
||||||
* @return The base path for reports.
|
|
||||||
*/
|
|
||||||
public static String getBaseReportPath() {
|
|
||||||
return REPORT_CONFIG_FOLDER_PATH;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deserialize all of the settings that make up a reporting configuration in
|
* Deserialize all of the settings that make up a reporting configuration in
|
||||||
* an atomic, thread safe way.
|
* an atomic, thread safe way.
|
||||||
|
@ -20,7 +20,7 @@ package org.sleuthkit.autopsy.texttranslation.translators;
|
|||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
import org.sleuthkit.autopsy.texttranslation.translators.settings.TranslatorSettings;
|
import org.sleuthkit.autopsy.texttranslation.translators.TranslatorSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to handle the settings associated with the BingTranslator
|
* Class to handle the settings associated with the BingTranslator
|
||||||
|
@ -21,7 +21,7 @@ package org.sleuthkit.autopsy.texttranslation.translators;
|
|||||||
import com.google.cloud.translate.TranslateOptions;
|
import com.google.cloud.translate.TranslateOptions;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
import org.sleuthkit.autopsy.texttranslation.translators.settings.TranslatorSettings;
|
import org.sleuthkit.autopsy.texttranslation.translators.TranslatorSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class to handle the settings associated with the GoogleTranslator
|
* Class to handle the settings associated with the GoogleTranslator
|
||||||
|
@ -16,17 +16,15 @@
|
|||||||
* 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.texttranslation.translators.settings;
|
package org.sleuthkit.autopsy.texttranslation.translators;
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||||
import com.google.common.annotations.Beta;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ModuleSettings keys and paths for translator settings.
|
* ModuleSettings keys and paths for translator settings.
|
||||||
*/
|
*/
|
||||||
@Beta
|
class TranslatorSettings {
|
||||||
public class TranslatorSettings {
|
|
||||||
|
|
||||||
private static final String TRANSLATION_FOLDER = "Translation";
|
private static final String TRANSLATION_FOLDER = "Translation";
|
||||||
private static final String TRANSLATION_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), TRANSLATION_FOLDER).toString();
|
private static final String TRANSLATION_PATH = Paths.get(PlatformUtil.getUserConfigDirectory(), TRANSLATION_FOLDER).toString();
|
||||||
@ -36,7 +34,7 @@ public class TranslatorSettings {
|
|||||||
/**
|
/**
|
||||||
* @return The singular instance.
|
* @return The singular instance.
|
||||||
*/
|
*/
|
||||||
public static TranslatorSettings getInstance() {
|
static TranslatorSettings getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,14 +49,14 @@ public class TranslatorSettings {
|
|||||||
*
|
*
|
||||||
* @return The resource name to use with ModuleSettings.
|
* @return The resource name to use with ModuleSettings.
|
||||||
*/
|
*/
|
||||||
public String getModuleSettingsResource(String translationResource) {
|
String getModuleSettingsResource(String translationResource) {
|
||||||
return Paths.get(TRANSLATION_FOLDER, translationResource).toString();
|
return Paths.get(TRANSLATION_FOLDER, translationResource).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The base translation folder.
|
* @return The base translation folder.
|
||||||
*/
|
*/
|
||||||
public String getBaseTranslationFolder() {
|
String getBaseTranslationFolder() {
|
||||||
return TRANSLATION_PATH;
|
return TRANSLATION_PATH;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -43,7 +43,7 @@ import org.sleuthkit.autopsy.casemodule.CaseDetails;
|
|||||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||||
import org.sleuthkit.datamodel.TskData;
|
import org.sleuthkit.datamodel.TskData;
|
||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.centralrepository.settings.CentralRepoSettings;
|
import org.sleuthkit.autopsy.centralrepository.CentralRepoSettings;
|
||||||
import org.sleuthkit.autopsy.coreutils.FileUtil;
|
import org.sleuthkit.autopsy.coreutils.FileUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,7 +38,6 @@ import java.util.HashMap;
|
|||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.prefs.BackingStoreException;
|
import java.util.prefs.BackingStoreException;
|
||||||
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.sleuthkit.autopsy.centralrepository.settings.CentralRepoSettings;
|
|
||||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||||
@ -53,8 +52,6 @@ import org.sleuthkit.autopsy.coordinationservice.CoordinationService;
|
|||||||
import org.sleuthkit.autopsy.coordinationservice.CoordinationService.CategoryNode;
|
import org.sleuthkit.autopsy.coordinationservice.CoordinationService.CategoryNode;
|
||||||
import org.sleuthkit.autopsy.coordinationservice.CoordinationService.Lock;
|
import org.sleuthkit.autopsy.coordinationservice.CoordinationService.Lock;
|
||||||
import org.sleuthkit.autopsy.coordinationservice.CoordinationService.CoordinationServiceException;
|
import org.sleuthkit.autopsy.coordinationservice.CoordinationService.CoordinationServiceException;
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashLookupSettings;
|
|
||||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetsManager;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A utility class for loading and saving shared configuration data
|
* A utility class for loading and saving shared configuration data
|
||||||
@ -65,8 +62,8 @@ public class SharedConfiguration {
|
|||||||
private static final String AUTO_MODE_CONTEXT_FILE = "AutoModeContext.properties"; //NON-NLS
|
private static final String AUTO_MODE_CONTEXT_FILE = "AutoModeContext.properties"; //NON-NLS
|
||||||
private static final String USER_DEFINED_TYPE_DEFINITIONS_FILE = "UserFileTypeDefinitions.settings"; //NON-NLS
|
private static final String USER_DEFINED_TYPE_DEFINITIONS_FILE = "UserFileTypeDefinitions.settings"; //NON-NLS
|
||||||
private static final String USER_DEFINED_TYPE_DEFINITIONS_FILE_LEGACY = "UserFileTypeDefinitions.xml"; //NON-NLS
|
private static final String USER_DEFINED_TYPE_DEFINITIONS_FILE_LEGACY = "UserFileTypeDefinitions.xml"; //NON-NLS
|
||||||
|
private static final String INTERESTING_FILES_SET_DEFS_FILE = "InterestingFileSets.settings"; //NON-NLS
|
||||||
private static final String INTERESTING_FILES_SET_DEFS_FILE_LEGACY = "InterestingFilesSetDefs.xml"; //NON-NLS
|
private static final String INTERESTING_FILES_SET_DEFS_FILE_LEGACY = "InterestingFilesSetDefs.xml"; //NON-NLS
|
||||||
|
|
||||||
private static final String KEYWORD_SEARCH_SETTINGS = "keywords.settings"; //NON-NLS
|
private static final String KEYWORD_SEARCH_SETTINGS = "keywords.settings"; //NON-NLS
|
||||||
private static final String KEYWORD_SEARCH_SETTINGS_LEGACY = "keywords.xml"; //NON-NLS
|
private static final String KEYWORD_SEARCH_SETTINGS_LEGACY = "keywords.xml"; //NON-NLS
|
||||||
private static final String KEYWORD_SEARCH_GENERAL_LEGACY = "KeywordSearch.properties"; //NON-NLS
|
private static final String KEYWORD_SEARCH_GENERAL_LEGACY = "KeywordSearch.properties"; //NON-NLS
|
||||||
@ -77,22 +74,30 @@ public class SharedConfiguration {
|
|||||||
private static final String FILE_EXT_MISMATCH_SETTINGS_LEGACY = "mismatch_config.xml"; //NON-NLS
|
private static final String FILE_EXT_MISMATCH_SETTINGS_LEGACY = "mismatch_config.xml"; //NON-NLS
|
||||||
private static final String ANDROID_TRIAGE = "AndroidTriage_Options.properties"; //NON-NLS
|
private static final String ANDROID_TRIAGE = "AndroidTriage_Options.properties"; //NON-NLS
|
||||||
private static final String AUTO_INGEST_PROPERTIES = "AutoIngest.properties"; //NON-NLS
|
private static final String AUTO_INGEST_PROPERTIES = "AutoIngest.properties"; //NON-NLS
|
||||||
|
private static final String HASHDB_CONFIG_FILE_NAME = "hashLookup.settings"; //NON-NLS
|
||||||
private static final String REMOTE_HASH_FOLDER = "hashDb"; //NON-NLS
|
|
||||||
|
|
||||||
private static final String HASHDB_CONFIG_FILE_NAME_LEGACY = "hashsets.xml"; //NON-NLS
|
private static final String HASHDB_CONFIG_FILE_NAME_LEGACY = "hashsets.xml"; //NON-NLS
|
||||||
public static final String FILE_EXPORTER_SETTINGS_FILE = "fileexporter.settings"; //NON-NLS
|
public static final String FILE_EXPORTER_SETTINGS_FILE = "fileexporter.settings"; //NON-NLS
|
||||||
|
private static final String CENTRAL_REPOSITORY_PROPERTIES_FILE = "CentralRepository.properties"; //NON-NLS
|
||||||
private static final String SHARED_CONFIG_VERSIONS = "SharedConfigVersions.txt"; //NON-NLS
|
private static final String SHARED_CONFIG_VERSIONS = "SharedConfigVersions.txt"; //NON-NLS
|
||||||
|
|
||||||
// Folders
|
// Folders
|
||||||
private static final String AUTO_MODE_FOLDER = "AutoModeContext"; //NON-NLS
|
private static final String AUTO_MODE_FOLDER = "AutoModeContext"; //NON-NLS
|
||||||
|
private static final String REMOTE_HASH_FOLDER = "hashDb"; //NON-NLS
|
||||||
public static final String FILE_EXPORTER_FOLDER = "Automated File Exporter"; //NON-NLS
|
public static final String FILE_EXPORTER_FOLDER = "Automated File Exporter"; //NON-NLS
|
||||||
|
|
||||||
private static final String UPLOAD_IN_PROGRESS_FILE = "uploadInProgress"; // NON-NLS
|
private static final String UPLOAD_IN_PROGRESS_FILE = "uploadInProgress"; // NON-NLS
|
||||||
private static final String moduleDirPath = PlatformUtil.getUserConfigDirectory();
|
private static final String moduleDirPath = PlatformUtil.getUserConfigDirectory();
|
||||||
private static final String INGEST_MODULES_PATH = IngestJobSettings.getBaseSettingsPath();
|
private static final String INGEST_MODULES_PATH = IngestJobSettings.getBaseSettingsPath();
|
||||||
private static final String INGEST_MODULES_REL_PATH = new File(moduleDirPath).toURI().relativize(new File(INGEST_MODULES_PATH).toURI()).getPath();
|
private static final String INGEST_MODULES_REL_PATH = new File(moduleDirPath).toURI().relativize(new File(INGEST_MODULES_PATH).toURI()).getPath();
|
||||||
private static final Logger logger = Logger.getLogger(SharedConfiguration.class.getName());
|
private static final Logger logger = Logger.getLogger(SharedConfiguration.class.getName());
|
||||||
|
private static final String SHARED_DIR_PATH = Paths.get(moduleDirPath, "SharableConfig").toAbsolutePath().toString();
|
||||||
|
private static final String CENTRAL_REPO_DIR_PATH = Paths.get(SHARED_DIR_PATH, "CentralRepository").toAbsolutePath().toString();
|
||||||
|
private static final String VIEW_PREFERENCE_FILE = Paths.get(SHARED_DIR_PATH, "ViewPreferences").toAbsolutePath().toString();
|
||||||
|
private static final String MACHINE_SPECIFIC_PREFERENCE_FILE = Paths.get(moduleDirPath, "MachineSpecificPreferences").toAbsolutePath().toString();
|
||||||
|
private static final String MODE_PREFERENCE_FILE = Paths.get(moduleDirPath, "ModePreferences").toAbsolutePath().toString();
|
||||||
|
private static final String EXTERNAL_SERVICE_PREFERENCE_FILE = Paths.get(moduleDirPath, "ExternalServicePreferences").toAbsolutePath().toString();
|
||||||
|
|
||||||
|
|
||||||
private final UpdateConfigSwingWorker swingWorker;
|
private final UpdateConfigSwingWorker swingWorker;
|
||||||
private UserPreferences.SelectedMode mode;
|
private UserPreferences.SelectedMode mode;
|
||||||
private String sharedConfigFolder;
|
private String sharedConfigFolder;
|
||||||
@ -106,6 +111,8 @@ public class SharedConfiguration {
|
|||||||
private boolean hideSlackFilesInViews;
|
private boolean hideSlackFilesInViews;
|
||||||
private boolean keepPreferredViewer;
|
private boolean keepPreferredViewer;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception type thrown by shared configuration.
|
* Exception type thrown by shared configuration.
|
||||||
*/
|
*/
|
||||||
@ -444,24 +451,6 @@ public class SharedConfiguration {
|
|||||||
File contextProperties = Paths.get(folder.getAbsolutePath(), INGEST_MODULES_REL_PATH, AUTO_MODE_CONTEXT_FILE).toFile();
|
File contextProperties = Paths.get(folder.getAbsolutePath(), INGEST_MODULES_REL_PATH, AUTO_MODE_CONTEXT_FILE).toFile();
|
||||||
return contextProperties.exists();
|
return contextProperties.exists();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Copy a local settings file to the remote folder.
|
|
||||||
*
|
|
||||||
* @param fullLocalPathStr Full local path.
|
|
||||||
* @param localFolder Local settings folder
|
|
||||||
* @param remoteFolder Shared settings folder
|
|
||||||
* @param missingFileOk True if it's not an error if the source file is
|
|
||||||
* not found
|
|
||||||
*
|
|
||||||
* @throws SharedConfigurationException
|
|
||||||
*/
|
|
||||||
private static void copyToRemoteFolder(String fullLocalPathStr, File remoteFolder, boolean missingFileOk) throws SharedConfigurationException {
|
|
||||||
Path fullLocalPath = Paths.get(fullLocalPathStr);
|
|
||||||
String fileName = fullLocalPath.toFile().getName();
|
|
||||||
String parentPath = fullLocalPath.getParent().toString();
|
|
||||||
copyToRemoteFolder(fileName, parentPath, remoteFolder, missingFileOk);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy a local settings file to the remote folder.
|
* Copy a local settings file to the remote folder.
|
||||||
@ -502,23 +491,6 @@ public class SharedConfiguration {
|
|||||||
throw new SharedConfigurationException(String.format("Failed to copy %s to %s", localFile.getAbsolutePath(), remoteFolder.getAbsolutePath()), ex);
|
throw new SharedConfigurationException(String.format("Failed to copy %s to %s", localFile.getAbsolutePath(), remoteFolder.getAbsolutePath()), ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Copy a shared settings file to the local settings folder.
|
|
||||||
*
|
|
||||||
* @param fullLocalPathStr Full local path.
|
|
||||||
* @param remoteFolder Shared settings folder
|
|
||||||
* @param missingFileOk True if it's not an error if the source file is
|
|
||||||
* not found
|
|
||||||
*
|
|
||||||
* @throws SharedConfigurationException
|
|
||||||
*/
|
|
||||||
private static void copyToLocalFolder(String fullLocalPathStr, File remoteFolder, boolean missingFileOk) throws SharedConfigurationException {
|
|
||||||
Path fullLocalPath = Paths.get(fullLocalPathStr);
|
|
||||||
String fileName = fullLocalPath.toFile().getName();
|
|
||||||
String parentPath = fullLocalPath.getParent().toString();
|
|
||||||
copyToLocalFolder(fileName, parentPath, remoteFolder, missingFileOk);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copy a shared settings file to the local settings folder.
|
* Copy a shared settings file to the local settings folder.
|
||||||
@ -767,7 +739,7 @@ public class SharedConfiguration {
|
|||||||
private void uploadInterestingFilesSettings(File remoteFolder) throws SharedConfigurationException {
|
private void uploadInterestingFilesSettings(File remoteFolder) throws SharedConfigurationException {
|
||||||
publishTask("Uploading InterestingFiles module configuration");
|
publishTask("Uploading InterestingFiles module configuration");
|
||||||
copyToRemoteFolder(INTERESTING_FILES_SET_DEFS_FILE_LEGACY, moduleDirPath, remoteFolder, true);
|
copyToRemoteFolder(INTERESTING_FILES_SET_DEFS_FILE_LEGACY, moduleDirPath, remoteFolder, true);
|
||||||
copyToRemoteFolder(FilesSetsManager.getInstance().getInterestingItemPath(), remoteFolder, true);
|
copyToRemoteFolder(INTERESTING_FILES_SET_DEFS_FILE, SHARED_DIR_PATH, remoteFolder, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -780,7 +752,7 @@ public class SharedConfiguration {
|
|||||||
private void downloadInterestingFilesSettings(File remoteFolder) throws SharedConfigurationException {
|
private void downloadInterestingFilesSettings(File remoteFolder) throws SharedConfigurationException {
|
||||||
publishTask("Downloading InterestingFiles module configuration");
|
publishTask("Downloading InterestingFiles module configuration");
|
||||||
copyToLocalFolder(INTERESTING_FILES_SET_DEFS_FILE_LEGACY, moduleDirPath, remoteFolder, true);
|
copyToLocalFolder(INTERESTING_FILES_SET_DEFS_FILE_LEGACY, moduleDirPath, remoteFolder, true);
|
||||||
copyToLocalFolder(FilesSetsManager.getInstance().getInterestingItemPath(), remoteFolder, true);
|
copyToLocalFolder(INTERESTING_FILES_SET_DEFS_FILE, SHARED_DIR_PATH, remoteFolder, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -903,15 +875,7 @@ public class SharedConfiguration {
|
|||||||
*/
|
*/
|
||||||
private void uploadCentralRepositorySettings(File remoteFolder) throws SharedConfigurationException {
|
private void uploadCentralRepositorySettings(File remoteFolder) throws SharedConfigurationException {
|
||||||
publishTask("Uploading central repository configuration");
|
publishTask("Uploading central repository configuration");
|
||||||
|
copyToRemoteFolder(CENTRAL_REPOSITORY_PROPERTIES_FILE, CENTRAL_REPO_DIR_PATH, remoteFolder, true);
|
||||||
// get relative cr path to config path.
|
|
||||||
String centralRepoRelPath = new File(moduleDirPath).toURI().relativize(
|
|
||||||
new File(CentralRepoSettings.getInstance().getModuleSettingsFile()).getParentFile().toURI()).getPath();
|
|
||||||
|
|
||||||
copyToRemoteFolder(
|
|
||||||
CentralRepoSettings.getInstance().getModuleSettingsFile(),
|
|
||||||
Paths.get(remoteFolder.getAbsolutePath(), centralRepoRelPath).toFile(),
|
|
||||||
true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -923,12 +887,7 @@ public class SharedConfiguration {
|
|||||||
*/
|
*/
|
||||||
private void downloadCentralRepositorySettings(File remoteFolder) throws SharedConfigurationException {
|
private void downloadCentralRepositorySettings(File remoteFolder) throws SharedConfigurationException {
|
||||||
publishTask("Downloading central repository configuration");
|
publishTask("Downloading central repository configuration");
|
||||||
|
copyToLocalFolder(CENTRAL_REPOSITORY_PROPERTIES_FILE, CENTRAL_REPO_DIR_PATH, remoteFolder, true);
|
||||||
// get relative cr path to config path.
|
|
||||||
String centralRepoRelPath = new File(moduleDirPath).toURI().relativize(
|
|
||||||
new File(CentralRepoSettings.getInstance().getModuleSettingsFile()).getParentFile().toURI()).getPath();
|
|
||||||
|
|
||||||
copyToLocalFolder(CentralRepoSettings.getInstance().getModuleSettingsFile(), Paths.get(remoteFolder.getAbsolutePath(), centralRepoRelPath).toFile(), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -941,11 +900,11 @@ public class SharedConfiguration {
|
|||||||
private void uploadMultiUserAndGeneralSettings(File remoteFolder) throws SharedConfigurationException {
|
private void uploadMultiUserAndGeneralSettings(File remoteFolder) throws SharedConfigurationException {
|
||||||
publishTask("Uploading multi user configuration");
|
publishTask("Uploading multi user configuration");
|
||||||
|
|
||||||
copyToRemoteFolder(UserPreferences.getViewPreferencePath(), remoteFolder, false);
|
copyToRemoteFolder(VIEW_PREFERENCE_FILE, SHARED_DIR_PATH, remoteFolder, false);
|
||||||
copyToRemoteFolder(UserPreferences.getMachineSpecificPreferencePath(), remoteFolder, false);
|
copyToRemoteFolder(MACHINE_SPECIFIC_PREFERENCE_FILE, moduleDirPath, remoteFolder, false);
|
||||||
copyToRemoteFolder(UserPreferences.getModePreferencePath(), remoteFolder, false);
|
copyToRemoteFolder(MODE_PREFERENCE_FILE, moduleDirPath, remoteFolder, false);
|
||||||
copyToRemoteFolder(UserPreferences.getExternalServicePreferencePath(), remoteFolder, false);
|
copyToRemoteFolder(EXTERNAL_SERVICE_PREFERENCE_FILE, SHARED_DIR_PATH, remoteFolder, false);
|
||||||
|
|
||||||
copyToRemoteFolder(AUTO_INGEST_PROPERTIES, moduleDirPath, remoteFolder, false);
|
copyToRemoteFolder(AUTO_INGEST_PROPERTIES, moduleDirPath, remoteFolder, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -959,10 +918,10 @@ public class SharedConfiguration {
|
|||||||
private void downloadMultiUserAndGeneralSettings(File remoteFolder) throws SharedConfigurationException {
|
private void downloadMultiUserAndGeneralSettings(File remoteFolder) throws SharedConfigurationException {
|
||||||
publishTask("Downloading multi user configuration");
|
publishTask("Downloading multi user configuration");
|
||||||
|
|
||||||
copyToLocalFolder(UserPreferences.getViewPreferencePath(), remoteFolder, false);
|
copyToLocalFolder(VIEW_PREFERENCE_FILE, SHARED_DIR_PATH, remoteFolder, false);
|
||||||
copyToLocalFolder(UserPreferences.getMachineSpecificPreferencePath(), remoteFolder, false);
|
copyToLocalFolder(MACHINE_SPECIFIC_PREFERENCE_FILE, moduleDirPath, remoteFolder, false);
|
||||||
copyToLocalFolder(UserPreferences.getModePreferencePath(), remoteFolder, false);
|
copyToLocalFolder(MODE_PREFERENCE_FILE, moduleDirPath, remoteFolder, false);
|
||||||
copyToLocalFolder(UserPreferences.getExternalServicePreferencePath(), remoteFolder, false);
|
copyToLocalFolder(EXTERNAL_SERVICE_PREFERENCE_FILE, SHARED_DIR_PATH, remoteFolder, false);
|
||||||
|
|
||||||
copyToLocalFolder(AUTO_INGEST_PROPERTIES, moduleDirPath, remoteFolder, false);
|
copyToLocalFolder(AUTO_INGEST_PROPERTIES, moduleDirPath, remoteFolder, false);
|
||||||
}
|
}
|
||||||
@ -1041,7 +1000,7 @@ public class SharedConfiguration {
|
|||||||
Map<String, String> sharedVersions = readVersionsFromFile(sharedVersionFile);
|
Map<String, String> sharedVersions = readVersionsFromFile(sharedVersionFile);
|
||||||
|
|
||||||
// Copy the settings file
|
// Copy the settings file
|
||||||
copyToRemoteFolder(HashLookupSettings.getSettingsPath(), remoteFolder, true);
|
copyToRemoteFolder(HASHDB_CONFIG_FILE_NAME, SHARED_DIR_PATH, remoteFolder, true);
|
||||||
copyToRemoteFolder(HASHDB_CONFIG_FILE_NAME_LEGACY, moduleDirPath, remoteFolder, true);
|
copyToRemoteFolder(HASHDB_CONFIG_FILE_NAME_LEGACY, moduleDirPath, remoteFolder, true);
|
||||||
|
|
||||||
// Get the list of databases from the file
|
// Get the list of databases from the file
|
||||||
@ -1290,7 +1249,7 @@ public class SharedConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Copy the settings filey
|
// Copy the settings filey
|
||||||
copyToLocalFolder(HashLookupSettings.getSettingsPath(), remoteFolder, true);
|
copyToLocalFolder(HASHDB_CONFIG_FILE_NAME, SHARED_DIR_PATH, remoteFolder, true);
|
||||||
copyToLocalFolder(HASHDB_CONFIG_FILE_NAME_LEGACY, moduleDirPath, remoteFolder, true);
|
copyToLocalFolder(HASHDB_CONFIG_FILE_NAME_LEGACY, moduleDirPath, remoteFolder, true);
|
||||||
copyToLocalFolder(SHARED_CONFIG_VERSIONS, moduleDirPath, remoteFolder, true);
|
copyToLocalFolder(SHARED_CONFIG_VERSIONS, moduleDirPath, remoteFolder, true);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user