Autopsy  4.18.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
org.sleuthkit.autopsy.coreutils.ModuleSettings Class Reference

Static Public Member Functions

static synchronized boolean configExists (String moduleName)
 
static synchronized String getConfigSetting (String moduleName, String settingName)
 
static synchronized Map< String, String > getConfigSettings (String moduleName)
 
static synchronized File getPropertyFile (String moduleName)
 
static synchronized boolean makeConfigFile (String moduleName)
 
static synchronized void removeProperty (String moduleName, String settingName)
 
static synchronized void setConfigSetting (String moduleName, String settingName, String settingVal)
 
static synchronized void setConfigSettings (String moduleName, Map< String, String > settings)
 
static synchronized boolean settingExists (String moduleName, String settingName)
 

Static Public Attributes

static final String CURRENT_CASE_TYPE = "Current_Case_Type"
 
static final String DEFAULT_CONTEXT = "GeneralContext"
 
static final String MAIN_SETTINGS = "Case"
 

Private Member Functions

 ModuleSettings ()
 

Static Private Member Functions

static synchronized Properties fetchProperties (String moduleName) throws IOException
 
static String getSettingsFilePath (String moduleName)
 

Static Private Attributes

static final Logger logger = Logger.getLogger(ModuleSettings.class.getName())
 
static final String MODULE_DIR_PATH = PlatformUtil.getUserConfigDirectory()
 
static final String SETTINGS_FILE_EXT = ".properties"
 

Detailed Description

Provides utility methods for creating, updating, and deleting Java properties files with paths such as USERDIR%/Config/[module name].properties, where "module name" is intended to be a module name and the properties file is intended to be a settings file for the module.

Very coarse-grained thread safety is provided by these utilities if all modules confine themselves to their use when manipulating their settings files, with the consequence of serializing all such operations across the entire application.

TODO (JIRA-5964): The error handling in this class is not consistent with Autopsy error handling policy.

Definition at line 47 of file ModuleSettings.java.

Constructor & Destructor Documentation

org.sleuthkit.autopsy.coreutils.ModuleSettings.ModuleSettings ( )
private

Private constructor to prevent instantiation of this utility class.

Definition at line 303 of file ModuleSettings.java.

Member Function Documentation

static synchronized boolean org.sleuthkit.autopsy.coreutils.ModuleSettings.configExists ( String  moduleName)
static
static synchronized Properties org.sleuthkit.autopsy.coreutils.ModuleSettings.fetchProperties ( String  moduleName) throws IOException
staticprivate
static synchronized String org.sleuthkit.autopsy.coreutils.ModuleSettings.getConfigSetting ( String  moduleName,
String  settingName 
)
static

Gets the value of a setting (property) from a module settings file.

NOTE: If the settings file does not already exist, it is created.

Parameters
moduleNameThe module name.
settingNameThe setting name.
Returns
The value of the setting or null if the file cannot be read or the setting is not found.

Definition at line 149 of file ModuleSettings.java.

References org.sleuthkit.autopsy.coreutils.ModuleSettings.configExists(), org.sleuthkit.autopsy.coreutils.ModuleSettings.fetchProperties(), org.sleuthkit.autopsy.coreutils.ModuleSettings.getSettingsFilePath(), and org.sleuthkit.autopsy.coreutils.ModuleSettings.makeConfigFile().

Referenced by org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbUtil.allowUseOfCentralRepository(), org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent.componentOpened(), org.sleuthkit.autopsy.report.ReportBranding.getAgencyLogoPath(), org.sleuthkit.autopsy.casemodule.UnpackagePortableCaseProgressDialog.UnpackageWorker.getCaseIfUnpackedBefore(), org.sleuthkit.autopsy.ingest.runIngestModuleWizard.IngestProfileSelectionWizardPanel.getComponent(), org.sleuthkit.autopsy.ingest.IngestServices.getConfigSetting(), org.sleuthkit.autopsy.casemodule.services.TagNameDefinition.getCRNotableList(), org.sleuthkit.autopsy.ingest.IngestProfiles.getIngestProfiles(), org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel.getLastUsedDirectory(), org.sleuthkit.autopsy.core.UserPreferences.getMode(), org.sleuthkit.autopsy.ingest.IngestJobSettings.getModulesNames(), org.sleuthkit.autopsy.casemodule.services.TagNameDefinition.getPropertyFileVersion(), org.sleuthkit.autopsy.report.ReportBranding.getReportFooter(), org.sleuthkit.autopsy.report.ReportBranding.getReportTitle(), org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbManager.getSavedDbChoice(), org.sleuthkit.autopsy.keywordsearch.Server.initSettings(), org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbManager.isDisabledDueToFailure(), org.sleuthkit.autopsy.ingest.IngestJobSettings.load(), org.sleuthkit.autopsy.centralrepository.datamodel.SqliteCentralRepoSettings.loadSettings(), org.sleuthkit.autopsy.timeline.OpenTimelineAction.performAction(), org.sleuthkit.autopsy.centralrepository.datamodel.SqliteCentralRepoSettings.readDbPath(), org.sleuthkit.autopsy.casemodule.ImageFilePanel.readSettings(), org.sleuthkit.autopsy.coreutils.ModuleSettings.removeProperty(), org.sleuthkit.autopsy.core.Installer.updateConfig(), org.sleuthkit.autopsy.casemodule.services.TagNameDefinition.updatePropertyFile(), org.sleuthkit.autopsy.timeline.actions.ViewArtifactInTimelineAction.ViewArtifactInTimelineAction(), and org.sleuthkit.autopsy.timeline.actions.ViewFileInTimelineAction.ViewFileInTimelineAction().

static synchronized Map<String, String> org.sleuthkit.autopsy.coreutils.ModuleSettings.getConfigSettings ( String  moduleName)
static
static synchronized File org.sleuthkit.autopsy.coreutils.ModuleSettings.getPropertyFile ( String  moduleName)
static

Gets a File object for a module settings (properties) file.

Parameters
moduleNameThe module name.
Returns
The File object or null if the file does not exist.

Definition at line 292 of file ModuleSettings.java.

References org.sleuthkit.autopsy.coreutils.ModuleSettings.configExists(), and org.sleuthkit.autopsy.coreutils.ModuleSettings.getSettingsFilePath().

static String org.sleuthkit.autopsy.coreutils.ModuleSettings.getSettingsFilePath ( String  moduleName)
staticprivate
static synchronized boolean org.sleuthkit.autopsy.coreutils.ModuleSettings.makeConfigFile ( String  moduleName)
static
static synchronized void org.sleuthkit.autopsy.coreutils.ModuleSettings.removeProperty ( String  moduleName,
String  settingName 
)
static

Removes a setting (property) in a module settings file.

Parameters
moduleNameThe module name.
settingNameThe setting name.

Definition at line 252 of file ModuleSettings.java.

References org.sleuthkit.autopsy.coreutils.ModuleSettings.fetchProperties(), org.sleuthkit.autopsy.coreutils.ModuleSettings.getConfigSetting(), and org.sleuthkit.autopsy.coreutils.ModuleSettings.getSettingsFilePath().

static synchronized void org.sleuthkit.autopsy.coreutils.ModuleSettings.setConfigSetting ( String  moduleName,
String  settingName,
String  settingVal 
)
static

Sets the value of a setting (property) in a module settings file.

NOTE: If the settings file does not already exist, it is created.

Parameters
moduleNameThe module name.
settingNameThe setting name.
settingValThe setting value.

Definition at line 230 of file ModuleSettings.java.

References org.sleuthkit.autopsy.coreutils.ModuleSettings.configExists(), org.sleuthkit.autopsy.coreutils.ModuleSettings.fetchProperties(), org.sleuthkit.autopsy.coreutils.ModuleSettings.getSettingsFilePath(), and org.sleuthkit.autopsy.coreutils.ModuleSettings.makeConfigFile().

Referenced by org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent.componentOpened(), org.sleuthkit.autopsy.casemodule.UnpackagePortableCaseProgressDialog.UnpackageWorker.doInBackground(), org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel.exportSetButtonActionPerformed(), org.sleuthkit.autopsy.ingest.IngestJobSettings.getModulesNames(), org.sleuthkit.autopsy.report.ReportBranding.getReportFooter(), org.sleuthkit.autopsy.report.ReportBranding.getReportTitle(), org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel.importSetButtonActionPerformed(), org.sleuthkit.autopsy.keywordsearch.Server.initSettings(), org.sleuthkit.autopsy.ingest.IngestJobSettings.load(), org.sleuthkit.autopsy.core.AutopsyOptionProcessor.process(), org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbManager.saveDbChoice(), org.sleuthkit.autopsy.centralrepository.datamodel.SqliteCentralRepoSettings.saveDbPath(), org.sleuthkit.autopsy.centralrepository.datamodel.SqliteCentralRepoSettings.saveSettings(), org.sleuthkit.autopsy.report.ReportBranding.setAgencyLogoPath(), org.sleuthkit.autopsy.ingest.IngestServices.setConfigSetting(), org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbManager.setDisabledDueToFailure(), org.sleuthkit.autopsy.core.UserPreferences.setMode(), org.sleuthkit.autopsy.corecomponents.Installer.setModuleSettings(), org.sleuthkit.autopsy.report.ReportBranding.setReportFooter(), org.sleuthkit.autopsy.report.ReportBranding.setReportTitle(), org.sleuthkit.autopsy.centralrepository.eventlisteners.Installer.setupDefaultCentralRepository(), org.sleuthkit.autopsy.centralrepository.datamodel.CentralRepoDbUtil.setUseCentralRepo(), org.sleuthkit.autopsy.ingest.IngestJobSettings.store(), org.sleuthkit.autopsy.ingest.runIngestModuleWizard.IngestProfileSelectionWizardPanel.storeSettings(), org.sleuthkit.autopsy.casemodule.ImageFilePanel.storeSettings(), org.sleuthkit.autopsy.core.Installer.updateConfig(), and org.sleuthkit.autopsy.casemodule.services.TagNameDefinition.updatePropertyFile().

static synchronized void org.sleuthkit.autopsy.coreutils.ModuleSettings.setConfigSettings ( String  moduleName,
Map< String, String >  settings 
)
static
static synchronized boolean org.sleuthkit.autopsy.coreutils.ModuleSettings.settingExists ( String  moduleName,
String  settingName 
)
static

Member Data Documentation

final String org.sleuthkit.autopsy.coreutils.ModuleSettings.CURRENT_CASE_TYPE = "Current_Case_Type"
static

Definition at line 59 of file ModuleSettings.java.

final String org.sleuthkit.autopsy.coreutils.ModuleSettings.DEFAULT_CONTEXT = "GeneralContext"
static

Definition at line 57 of file ModuleSettings.java.

final Logger org.sleuthkit.autopsy.coreutils.ModuleSettings.logger = Logger.getLogger(ModuleSettings.class.getName())
staticprivate

Definition at line 49 of file ModuleSettings.java.

final String org.sleuthkit.autopsy.coreutils.ModuleSettings.MAIN_SETTINGS = "Case"
static
final String org.sleuthkit.autopsy.coreutils.ModuleSettings.MODULE_DIR_PATH = PlatformUtil.getUserConfigDirectory()
staticprivate

Definition at line 50 of file ModuleSettings.java.

final String org.sleuthkit.autopsy.coreutils.ModuleSettings.SETTINGS_FILE_EXT = ".properties"
staticprivate

Definition at line 51 of file ModuleSettings.java.


The documentation for this class was generated from the following file:

Copyright © 2012-2021 Basis Technology. Generated on: Thu Jul 8 2021
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.