mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
Merge pull request #2817 from wschaeferB/2603-MultiUserDelete
2603 multi user delete
This commit is contained in:
commit
4171b79b64
@ -3,6 +3,7 @@ CTL_AddImageButton=Add Data Source
|
||||
CTL_CaseCloseAct=Close Case
|
||||
CTL_CaseNewAction=New Case...
|
||||
CTL_CasePropertiesAction=Case Properties...
|
||||
CTL_CaseDeleteAction=Delete Case
|
||||
CTL_OpenAction=Open Case...
|
||||
Menu/Case/OpenRecentCase=Open Recent Case
|
||||
CTL_CaseDeleteAction=Delete Case
|
||||
@ -235,5 +236,4 @@ CasePropertiesPanel.lbDbName.text=Database Name:
|
||||
CasePropertiesPanel.lbDbType.text=Case Type:
|
||||
CasePropertiesPanel.examinerLabel.text=Examiner:
|
||||
CasePropertiesPanel.caseNumberLabel.text=Case Number:
|
||||
CasePropertiesPanel.deleteCaseButton.text=Delete Case
|
||||
LocalDiskPanel.changeDatabasePathCheckbox.text=Update case to use VHD file upon completion
|
||||
|
@ -2,6 +2,7 @@ CTL_AddImageButton=\u30c7\u30fc\u30bf\u30bd\u30fc\u30b9\u3092\u8ffd\u52a0
|
||||
CTL_CaseCloseAct=\u30b1\u30fc\u30b9\u3092\u9589\u3058\u308b
|
||||
CTL_CaseNewAction=\u65b0\u898f\u30b1\u30fc\u30b9...
|
||||
CTL_CasePropertiesAction=\u30b1\u30fc\u30b9\u30d7\u30ed\u30d1\u30c6\u30a3...
|
||||
CTL_CaseDeleteAction=\u30b1\u30fc\u30b9\u3092\u524a\u9664
|
||||
CTL_OpenAction=\u30b1\u30fc\u30b9\u3092\u958b\u304f...
|
||||
Menu/Case/OpenRecentCase=\u6700\u8fd1\u958b\u3044\u305f\u30b1\u30fc\u30b9\u3092\u958b\u304f
|
||||
CTL_CaseDeleteAction=\u30b1\u30fc\u30b9\u3092\u524a\u9664
|
||||
@ -195,4 +196,3 @@ CasePropertiesPanel.lbDbName.text=\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\uff
|
||||
CasePropertiesPanel.lbDbType.text=\u30b1\u30fc\u30b9\u30bf\u30a4\u30d7\uff1a
|
||||
CasePropertiesPanel.examinerLabel.text=\u8abf\u67fb\u62c5\u5f53\u8005\uff1a
|
||||
CasePropertiesPanel.caseNumberLabel.text=\u30b1\u30fc\u30b9\u756a\u53f7\uff1a
|
||||
CasePropertiesPanel.deleteCaseButton.text=\u30b1\u30fc\u30b9\u3092\u524a\u9664
|
||||
|
@ -624,7 +624,7 @@ public class Case {
|
||||
* First, acquire an exclusive case directory lock. The case
|
||||
* cannot be deleted if another node has it open.
|
||||
*/
|
||||
progressIndicator.start(Bundle.Case_progressMessage_checkingForOtherUser());
|
||||
progressIndicator.progress(Bundle.Case_progressMessage_checkingForOtherUser());
|
||||
try (CoordinationService.Lock dirLock = CoordinationService.getInstance().tryGetExclusiveLock(CategoryNode.CASES, metadata.getCaseDirectory())) {
|
||||
assert (null != dirLock);
|
||||
deleteCase(metadata, progressIndicator);
|
||||
|
@ -19,6 +19,7 @@
|
||||
package org.sleuthkit.autopsy.casemodule;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.Action;
|
||||
@ -31,6 +32,7 @@ import org.openide.util.HelpCtx;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.util.NbBundle.Messages;
|
||||
import org.openide.util.actions.CallableSystemAction;
|
||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
|
||||
/**
|
||||
@ -47,6 +49,9 @@ final class CaseDeleteAction extends CallableSystemAction {
|
||||
CaseDeleteAction() {
|
||||
putValue(Action.NAME, NbBundle.getMessage(CaseDeleteAction.class, "CTL_CaseDeleteAction"));
|
||||
this.setEnabled(false);
|
||||
Case.addEventSubscriber(Case.Events.CURRENT_CASE.toString(), (PropertyChangeEvent evt) -> {
|
||||
setEnabled(null != evt.getNewValue() && UserPreferences.getMode() != UserPreferences.SelectedMode.REVIEW);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -95,10 +100,8 @@ final class CaseDeleteAction extends CallableSystemAction {
|
||||
JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
/*
|
||||
* Close the Case Properties dialog that is the parent
|
||||
* of the Delete button that invokes this action.
|
||||
* Re-open the startup window.
|
||||
*/
|
||||
CasePropertiesAction.closeCasePropertiesWindow();
|
||||
StartupWindowProvider.getInstance().open();
|
||||
}
|
||||
}.execute();
|
||||
|
@ -79,11 +79,4 @@ final class CasePropertiesAction extends CallableSystemAction {
|
||||
public HelpCtx getHelpCtx() {
|
||||
return HelpCtx.DEFAULT_HELP;
|
||||
}
|
||||
|
||||
static void closeCasePropertiesWindow() {
|
||||
if (null != casePropertiesDialog) {
|
||||
casePropertiesDialog.setVisible(false);
|
||||
casePropertiesDialog = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -33,12 +33,12 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jPanel1" max="32767" attributes="0"/>
|
||||
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jPanel1" min="-2" pref="169" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
@ -82,10 +82,6 @@
|
||||
<Component id="crDateField" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="deleteCaseButton" min="-2" pref="106" max="-2" attributes="1"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -138,9 +134,7 @@
|
||||
</Group>
|
||||
<Component id="caseNumberLabel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="10" max="-2" attributes="0"/>
|
||||
<Component id="deleteCaseButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="44" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
@ -216,21 +210,6 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="updateCaseNameButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="deleteCaseButton">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
<FontInfo relative="true">
|
||||
<Font bold="false" component="deleteCaseButton" property="font" relativeSize="false" size="11"/>
|
||||
</FontInfo>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CasePropertiesPanel.deleteCaseButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteCaseButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="caseNumberLabel">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.modules.form.editors2.FontEditor">
|
||||
|
@ -21,7 +21,6 @@ package org.sleuthkit.autopsy.casemodule;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.logging.Level;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.util.actions.CallableSystemAction;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||
|
||||
@ -66,7 +65,6 @@ class CasePropertiesPanel extends javax.swing.JPanel {
|
||||
}
|
||||
Case.CaseType caseType = theCase.getCaseType();
|
||||
caseTypeField.setText(caseType.getLocalizedDisplayName());
|
||||
deleteCaseButton.setEnabled(Case.CaseType.SINGLE_USER_CASE == caseType);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -95,7 +93,6 @@ class CasePropertiesPanel extends javax.swing.JPanel {
|
||||
caseDirLabel = new javax.swing.JLabel();
|
||||
caseNameTextField = new javax.swing.JTextField();
|
||||
updateCaseNameButton = new javax.swing.JButton();
|
||||
deleteCaseButton = new javax.swing.JButton();
|
||||
caseNumberLabel = new javax.swing.JLabel();
|
||||
examinerLabel = new javax.swing.JLabel();
|
||||
lbDbType = new javax.swing.JLabel();
|
||||
@ -131,14 +128,6 @@ class CasePropertiesPanel extends javax.swing.JPanel {
|
||||
}
|
||||
});
|
||||
|
||||
deleteCaseButton.setFont(deleteCaseButton.getFont().deriveFont(deleteCaseButton.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
|
||||
deleteCaseButton.setText(org.openide.util.NbBundle.getMessage(CasePropertiesPanel.class, "CasePropertiesPanel.deleteCaseButton.text")); // NOI18N
|
||||
deleteCaseButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
deleteCaseButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
caseNumberLabel.setFont(caseNumberLabel.getFont().deriveFont(caseNumberLabel.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
|
||||
caseNumberLabel.setText(org.openide.util.NbBundle.getMessage(CasePropertiesPanel.class, "CasePropertiesPanel.caseNumberLabel.text")); // NOI18N
|
||||
|
||||
@ -187,10 +176,7 @@ class CasePropertiesPanel extends javax.swing.JPanel {
|
||||
.addComponent(caseNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(updateCaseNameButton, javax.swing.GroupLayout.PREFERRED_SIZE, 104, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(crDateField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(deleteCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(crDateField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||
.addContainerGap())
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
@ -230,9 +216,7 @@ class CasePropertiesPanel extends javax.swing.JPanel {
|
||||
.addComponent(lbDbName)
|
||||
.addComponent(dbNameField, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(caseNumberLabel))
|
||||
.addGap(10, 10, 10)
|
||||
.addComponent(deleteCaseButton)
|
||||
.addContainerGap())
|
||||
.addGap(44, 44, 44))
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
@ -248,7 +232,7 @@ class CasePropertiesPanel extends javax.swing.JPanel {
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
@ -285,10 +269,6 @@ class CasePropertiesPanel extends javax.swing.JPanel {
|
||||
}
|
||||
}//GEN-LAST:event_updateCaseNameButtonActionPerformed
|
||||
|
||||
private void deleteCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteCaseButtonActionPerformed
|
||||
CallableSystemAction.get(CaseDeleteAction.class).actionPerformed(evt);
|
||||
}//GEN-LAST:event_deleteCaseButtonActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JLabel caseDirField;
|
||||
@ -301,7 +281,6 @@ class CasePropertiesPanel extends javax.swing.JPanel {
|
||||
private javax.swing.JLabel crDateField;
|
||||
private javax.swing.JLabel crDateLabel;
|
||||
private javax.swing.JLabel dbNameField;
|
||||
private javax.swing.JButton deleteCaseButton;
|
||||
private javax.swing.JLabel examinerField;
|
||||
private javax.swing.JLabel examinerLabel;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
|
@ -30,6 +30,7 @@ import javax.crypto.spec.PBEKeySpec;
|
||||
import javax.crypto.spec.PBEParameterSpec;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.util.NbPreferences;
|
||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||
import org.sleuthkit.datamodel.CaseDbConnectionInfo;
|
||||
import org.sleuthkit.datamodel.TskData.DbType;
|
||||
@ -68,11 +69,42 @@ public final class UserPreferences {
|
||||
private static final String DEFAULT_PORT_STRING = "61616";
|
||||
private static final int DEFAULT_PORT_INT = 61616;
|
||||
private static final String APP_NAME = "AppName";
|
||||
public static final String SETTINGS_PROPERTIES = "AutoIngest";
|
||||
private static final String MODE = "AutopsyMode"; // NON-NLS
|
||||
|
||||
// Prevent instantiation.
|
||||
private UserPreferences() {
|
||||
}
|
||||
|
||||
public enum SelectedMode {
|
||||
|
||||
STANDALONE,
|
||||
AUTOINGEST,
|
||||
REVIEW
|
||||
};
|
||||
|
||||
/**
|
||||
* Get mode from persistent storage.
|
||||
*
|
||||
* @return SelectedMode Selected mode.
|
||||
*/
|
||||
public static SelectedMode getMode() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, MODE)) {
|
||||
int ordinal = Integer.parseInt(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, MODE));
|
||||
return UserPreferences.SelectedMode.values()[ordinal];
|
||||
}
|
||||
return UserPreferences.SelectedMode.STANDALONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mode to persistent storage.
|
||||
*
|
||||
* @param mode Selected mode.
|
||||
*/
|
||||
public static void setMode(SelectedMode mode) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, MODE, Integer.toString(mode.ordinal()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Reload all preferences from disk. This is only needed if the preferences
|
||||
* file is being directly modified on disk while Autopsy is running.
|
||||
@ -160,7 +192,9 @@ public final class UserPreferences {
|
||||
|
||||
/**
|
||||
* Reads persisted case database connection info.
|
||||
*
|
||||
* @return An object encapsulating the database connection info.
|
||||
*
|
||||
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||
*/
|
||||
public static CaseDbConnectionInfo getDatabaseConnectionInfo() throws UserPreferencesException {
|
||||
@ -183,6 +217,7 @@ public final class UserPreferences {
|
||||
*
|
||||
* @param connectionInfo An object encapsulating the database connection
|
||||
* info.
|
||||
*
|
||||
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||
*/
|
||||
public static void setDatabaseConnectionInfo(CaseDbConnectionInfo connectionInfo) throws UserPreferencesException {
|
||||
@ -224,6 +259,7 @@ public final class UserPreferences {
|
||||
* Persists message service connection info.
|
||||
*
|
||||
* @param info An object encapsulating the message service info.
|
||||
*
|
||||
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||
*/
|
||||
public static void setMessageServiceConnectionInfo(MessageServiceConnectionInfo info) throws UserPreferencesException {
|
||||
@ -237,6 +273,7 @@ public final class UserPreferences {
|
||||
* Reads persisted message service connection info.
|
||||
*
|
||||
* @return An object encapsulating the message service info.
|
||||
*
|
||||
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||
*/
|
||||
public static MessageServiceConnectionInfo getMessageServiceConnectionInfo() throws UserPreferencesException {
|
||||
@ -305,9 +342,10 @@ public final class UserPreferences {
|
||||
|
||||
/**
|
||||
* Get the display name for this program
|
||||
*
|
||||
* @return Name of this program
|
||||
*/
|
||||
public static String getAppName(){
|
||||
public static String getAppName() {
|
||||
return preferences.get(APP_NAME, "Autopsy");
|
||||
}
|
||||
|
||||
@ -316,11 +354,10 @@ public final class UserPreferences {
|
||||
*
|
||||
* @param name Display name
|
||||
*/
|
||||
public static void setAppName(String name){
|
||||
public static void setAppName(String name) {
|
||||
preferences.put(APP_NAME, name);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Provides ability to convert text to hex text.
|
||||
*/
|
||||
|
@ -3,8 +3,8 @@
|
||||
<filesystem>
|
||||
|
||||
<!-- ======================================================
|
||||
General
|
||||
====================================================== -->
|
||||
General
|
||||
====================================================== -->
|
||||
<attr name="Toolbars\Case\org-sleuthkit-autopsy-casemodule-CaseCloseAction.instance\iconBase" stringvalue="org/sleuthkit/autopsy/images/close-icon.gif"/>
|
||||
<attr name="Menu\Case\org-netbeans-modules-print-action-PageSetupAction.shadow_hidden\position" intvalue="300"/>
|
||||
<attr name="Menu\Case\org-netbeans-modules-print-action-PrintAction.shadow_hidden\position" intvalue="500"/>
|
||||
@ -36,8 +36,8 @@
|
||||
|
||||
|
||||
<!-- ======================================================
|
||||
Actions
|
||||
====================================================== -->
|
||||
Actions
|
||||
====================================================== -->
|
||||
<folder name="Actions">
|
||||
<folder name="Case">
|
||||
<file name="org-sleuthkit-autopsy-casemodule-AddImageAction.instance"/>
|
||||
@ -48,6 +48,7 @@
|
||||
<attr name="noIconInMenu" boolvalue="false"/>
|
||||
</file>
|
||||
<file name="org-sleuthkit-autopsy-casemodule-CasePropertiesAction.instance"/>
|
||||
<file name="org-sleuthkit-autopsy-casemodule-CaseDeleteAction.instance"/>
|
||||
<file name="org-sleuthkit-autopsy-casemodule-CaseOpenAction.instance">
|
||||
<attr name="delegate" newvalue="org.sleuthkit.autopsy.casemodule.CaseOpenAction"/>
|
||||
<attr name="displayName" bundlevalue="org.sleuthkit.autopsy.casemodule.Bundle#CTL_OpenAction"/>
|
||||
@ -132,15 +133,15 @@
|
||||
<file name="org-sleuthkit-autopsy-actions-OpenLogFolder.instance_hidden"/>
|
||||
</folder>
|
||||
<folder name="Toolbars">
|
||||
<folder name="QuickSearch_hidden"/>
|
||||
<folder name="QuickSearch_hidden"/>
|
||||
</folder>
|
||||
</folder>
|
||||
|
||||
|
||||
|
||||
<!-- ======================================================
|
||||
Menu
|
||||
====================================================== -->
|
||||
Menu
|
||||
====================================================== -->
|
||||
<folder name="Menu">
|
||||
<file name="GoTo_hidden"/>
|
||||
<file name="Reports_hidden"/>
|
||||
@ -166,6 +167,10 @@
|
||||
<attr name="originalFile" stringvalue="Actions/Case/org-sleuthkit-autopsy-casemodule-CaseCloseAction.instance"/>
|
||||
<attr name="position" intvalue="103"/>
|
||||
</file>
|
||||
<file name="org-sleuthkit-autopsy-casemodule-CaseDeleteAction.shadow">
|
||||
<attr name="originalFile" stringvalue="Actions/Case/org-sleuthkit-autopsy-casemodule-CaseDeleteAction.instance"/>
|
||||
<attr name="position" intvalue="104"/>
|
||||
</file>
|
||||
<file name="org-sleuthkit-autopsy-casemodule-AddImage-separatorBefore.instance">
|
||||
<attr name="instanceClass" stringvalue="javax.swing.JSeparator"/>
|
||||
<attr name="position" intvalue="200"/>
|
||||
@ -279,8 +284,8 @@
|
||||
|
||||
|
||||
<!-- ======================================================
|
||||
Services
|
||||
====================================================== -->
|
||||
Services
|
||||
====================================================== -->
|
||||
<folder name="Services">
|
||||
<folder name="AutoupdateType">
|
||||
<file name="org_sleuthkit_autopsy_core_update_center.settings" url="org_sleuthkit_autopsy_core_update_centerSettings.xml">
|
||||
@ -298,7 +303,7 @@
|
||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent.getDefault"/>
|
||||
<attr name="position" intvalue="125"/>
|
||||
</file>
|
||||
<file name="org-sleuthkit-autopsy-directorytree-DirectoryTreeTopComponent2.instance">
|
||||
<file name="org-sleuthkit-autopsy-directorytree-DirectoryTreeTopComponent2.instance">
|
||||
<attr name="instanceOf" stringvalue="org.sleuthkit.autopsy.corecomponentinterfaces.BlackboardResultViewer"/>
|
||||
<attr name="instanceCreate" methodvalue="org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent.getDefault"/>
|
||||
<attr name="position" intvalue="150"/>
|
||||
@ -356,8 +361,8 @@
|
||||
|
||||
|
||||
<!-- ======================================================
|
||||
Toolbars
|
||||
====================================================== -->
|
||||
Toolbars
|
||||
====================================================== -->
|
||||
<folder name="Toolbars">
|
||||
<file name="Clipboard_hidden"/>
|
||||
<file name="Memory_hidden"/>
|
||||
@ -408,8 +413,8 @@
|
||||
|
||||
|
||||
<!-- ======================================================
|
||||
Shortcuts
|
||||
====================================================== -->
|
||||
Shortcuts
|
||||
====================================================== -->
|
||||
<folder name="Shortcuts">
|
||||
<file name="D-N.shadow">
|
||||
<attr name="originalFile" stringvalue="Actions/Case/org-sleuthkit-autopsy-casemodule-CaseNewAction.instance"/>
|
||||
@ -422,8 +427,8 @@
|
||||
|
||||
|
||||
<!-- ======================================================
|
||||
Windows2
|
||||
====================================================== -->
|
||||
Windows2
|
||||
====================================================== -->
|
||||
<folder name="Windows2">
|
||||
<folder name="Components">
|
||||
<file name="DirectoryTreeTopComponent.settings" url="DirectoryTreeTopComponentSettings.xml"/>
|
||||
|
@ -31,7 +31,7 @@ import org.sleuthkit.autopsy.casemodule.CaseOpenAction;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.casemodule.StartupWindowProvider;
|
||||
import org.sleuthkit.autopsy.experimental.configuration.AutoIngestUserPreferences;
|
||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||
|
||||
final class AutoIngestCaseOpenAction extends CallableSystemAction implements ActionListener {
|
||||
|
||||
@ -44,7 +44,7 @@ final class AutoIngestCaseOpenAction extends CallableSystemAction implements Act
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
AutoIngestUserPreferences.SelectedMode mode = AutoIngestUserPreferences.getMode();
|
||||
UserPreferences.SelectedMode mode = UserPreferences.getMode();
|
||||
switch (mode) {
|
||||
case REVIEW:
|
||||
|
||||
@ -63,7 +63,7 @@ final class AutoIngestCaseOpenAction extends CallableSystemAction implements Act
|
||||
}
|
||||
break;
|
||||
|
||||
case AUTOMATED:
|
||||
case AUTOINGEST:
|
||||
/*
|
||||
* New case action is disabled in auto ingest mode.
|
||||
*/
|
||||
|
@ -39,7 +39,6 @@ import org.sleuthkit.datamodel.SleuthkitCase;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
import java.util.logging.Level;
|
||||
import org.sleuthkit.autopsy.experimental.configuration.AutoIngestUserPreferences;
|
||||
import static org.sleuthkit.autopsy.experimental.configuration.AutoIngestUserPreferences.SelectedMode.AUTOMATED;
|
||||
|
||||
/**
|
||||
* This panel shows up in a tab pane next to the copy files panel for the
|
||||
|
@ -125,7 +125,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
cbJoinAutoIngestCluster.setEnabled(UserPreferences.getIsMultiUserModeEnabled());
|
||||
|
||||
if (inStartup) {
|
||||
AutoIngestUserPreferences.SelectedMode storedMode = AutoIngestUserPreferences.getMode();
|
||||
UserPreferences.SelectedMode storedMode = UserPreferences.getMode();
|
||||
inputPathTextField.requestFocusInWindow();
|
||||
if (null != storedMode) {
|
||||
switch (storedMode) {
|
||||
@ -133,7 +133,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
jRadioButtonReview.setSelected(true);
|
||||
enableOptionsBasedOnMode(OptionsUiMode.REVIEW);
|
||||
break;
|
||||
case AUTOMATED:
|
||||
case AUTOINGEST:
|
||||
jRadioButtonAutomated.setSelected(true);
|
||||
enableOptionsBasedOnMode(OptionsUiMode.AIM);
|
||||
break;
|
||||
@ -207,7 +207,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
*/
|
||||
void store() {
|
||||
boolean needsRestart = false;
|
||||
AutoIngestUserPreferences.SelectedMode storedMode = AutoIngestUserPreferences.getMode();
|
||||
UserPreferences.SelectedMode storedMode = UserPreferences.getMode();
|
||||
|
||||
if (AutoIngestUserPreferences.getJoinAutoModeCluster() != cbJoinAutoIngestCluster.isSelected()) {
|
||||
needsRestart = true;
|
||||
@ -215,7 +215,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
|
||||
AutoIngestUserPreferences.setJoinAutoModeCluster(cbJoinAutoIngestCluster.isSelected());
|
||||
if (!cbJoinAutoIngestCluster.isSelected()) {
|
||||
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.STANDALONE);
|
||||
UserPreferences.setMode(UserPreferences.SelectedMode.STANDALONE);
|
||||
//before return popup the message
|
||||
if (needsRestart) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
@ -229,7 +229,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
}
|
||||
|
||||
if (jRadioButtonAutomated.isSelected()) {
|
||||
if (storedMode != AutoIngestUserPreferences.SelectedMode.AUTOMATED) {
|
||||
if (storedMode != UserPreferences.SelectedMode.AUTOINGEST) {
|
||||
needsRestart = true;
|
||||
}
|
||||
String thePath = AutoIngestUserPreferences.getAutoModeImageFolder();
|
||||
@ -241,7 +241,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
needsRestart = true;
|
||||
}
|
||||
|
||||
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.AUTOMATED);
|
||||
UserPreferences.setMode(UserPreferences.SelectedMode.AUTOINGEST);
|
||||
String imageFolderPath = getNormalizedFolderPath(inputPathTextField.getText().trim());
|
||||
AutoIngestUserPreferences.setAutoModeImageFolder(imageFolderPath);
|
||||
String resultsFolderPath = getNormalizedFolderPath(outputPathTextField.getText().trim());
|
||||
@ -253,7 +253,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
AutoIngestUserPreferences.setSharedConfigMaster(masterNodeCheckBox.isSelected());
|
||||
}
|
||||
} else if (jRadioButtonReview.isSelected()) {
|
||||
if (storedMode != AutoIngestUserPreferences.SelectedMode.REVIEW) {
|
||||
if (storedMode != UserPreferences.SelectedMode.REVIEW) {
|
||||
needsRestart = true;
|
||||
}
|
||||
String thePath = AutoIngestUserPreferences.getAutoModeResultsFolder();
|
||||
@ -261,7 +261,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
|
||||
needsRestart = true;
|
||||
}
|
||||
|
||||
AutoIngestUserPreferences.setMode(AutoIngestUserPreferences.SelectedMode.REVIEW);
|
||||
UserPreferences.setMode(UserPreferences.SelectedMode.REVIEW);
|
||||
String resultsFolderPath = getNormalizedFolderPath(outputPathTextField.getText().trim());
|
||||
AutoIngestUserPreferences.setAutoModeResultsFolder(resultsFolderPath);
|
||||
}
|
||||
|
@ -24,25 +24,16 @@ import javax.crypto.SecretKey;
|
||||
import javax.crypto.SecretKeyFactory;
|
||||
import javax.crypto.spec.PBEKeySpec;
|
||||
import javax.crypto.spec.PBEParameterSpec;
|
||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||
import org.sleuthkit.autopsy.core.UserPreferencesException;
|
||||
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
|
||||
|
||||
/**
|
||||
* Provides convenient access to a Preferences node for auto ingest user preferences
|
||||
* with default values.
|
||||
* Provides convenient access to a Preferences node for auto ingest user
|
||||
* preferences with default values.
|
||||
*/
|
||||
public final class AutoIngestUserPreferences {
|
||||
|
||||
|
||||
public enum SelectedMode {
|
||||
|
||||
STANDALONE,
|
||||
AUTOMATED,
|
||||
REVIEW
|
||||
};
|
||||
|
||||
private static final String SETTINGS_PROPERTIES = "AutoIngest";
|
||||
private static final String MODE = "AutopsyMode"; // NON-NLS
|
||||
private static final String JOIN_AUTO_MODE_CLUSTER = "JoinAutoModeCluster"; // NON-NLS
|
||||
private static final String AUTO_MODE_IMAGES_FOLDER = "AutoModeImageFolder"; // NON-NLS
|
||||
private static final String AUTO_MODE_RESULTS_FOLDER = "AutoModeResultsFolder"; // NON-NLS
|
||||
@ -66,36 +57,14 @@ public final class AutoIngestUserPreferences {
|
||||
private AutoIngestUserPreferences() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mode from persistent storage.
|
||||
*
|
||||
* @return SelectedMode Selected mode.
|
||||
*/
|
||||
public static SelectedMode getMode() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, MODE)) {
|
||||
int ordinal = Integer.parseInt(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, MODE));
|
||||
return SelectedMode.values()[ordinal];
|
||||
}
|
||||
return SelectedMode.STANDALONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mode to persistent storage.
|
||||
*
|
||||
* @param mode Selected mode.
|
||||
*/
|
||||
public static void setMode(SelectedMode mode) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, MODE, Integer.toString(mode.ordinal()));
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Get "Join Automated Ingest Cluster" setting from persistent storage.
|
||||
*
|
||||
* @return SelectedMode Selected setting.
|
||||
*/
|
||||
public static boolean getJoinAutoModeCluster() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, JOIN_AUTO_MODE_CLUSTER)) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, JOIN_AUTO_MODE_CLUSTER));
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, JOIN_AUTO_MODE_CLUSTER)) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, JOIN_AUTO_MODE_CLUSTER));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -106,17 +75,17 @@ public final class AutoIngestUserPreferences {
|
||||
* @param join boolean value of whether to join auto ingest cluster or not
|
||||
*/
|
||||
public static void setJoinAutoModeCluster(boolean join) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, JOIN_AUTO_MODE_CLUSTER, Boolean.toString(join));
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, JOIN_AUTO_MODE_CLUSTER, Boolean.toString(join));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get input folder for automated mode from persistent storage.
|
||||
*
|
||||
* @return String Selected input folder.
|
||||
*/
|
||||
public static String getAutoModeImageFolder() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, AUTO_MODE_IMAGES_FOLDER)) {
|
||||
return ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, AUTO_MODE_IMAGES_FOLDER);
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, AUTO_MODE_IMAGES_FOLDER)) {
|
||||
return ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, AUTO_MODE_IMAGES_FOLDER);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@ -127,7 +96,7 @@ public final class AutoIngestUserPreferences {
|
||||
* @param folder Selected input folder.
|
||||
*/
|
||||
public static void setAutoModeImageFolder(String folder) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, AUTO_MODE_IMAGES_FOLDER, folder);
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, AUTO_MODE_IMAGES_FOLDER, folder);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,8 +105,8 @@ public final class AutoIngestUserPreferences {
|
||||
* @return String Selected output folder.
|
||||
*/
|
||||
public static String getAutoModeResultsFolder() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, AUTO_MODE_RESULTS_FOLDER)) {
|
||||
return ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, AUTO_MODE_RESULTS_FOLDER);
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, AUTO_MODE_RESULTS_FOLDER)) {
|
||||
return ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, AUTO_MODE_RESULTS_FOLDER);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@ -148,39 +117,39 @@ public final class AutoIngestUserPreferences {
|
||||
* @param folder Selected output folder.
|
||||
*/
|
||||
public static void setAutoModeResultsFolder(String folder) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, AUTO_MODE_RESULTS_FOLDER, folder);
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, AUTO_MODE_RESULTS_FOLDER, folder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shared config folder for automated mode from persistent
|
||||
* storage.
|
||||
* Get shared config folder for automated mode from persistent storage.
|
||||
*
|
||||
* @return String Selected settings folder.
|
||||
*/
|
||||
public static String getSharedConfigFolder() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, SHARED_CONFIG_FOLDER)) {
|
||||
return ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, SHARED_CONFIG_FOLDER);
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, SHARED_CONFIG_FOLDER)) {
|
||||
return ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, SHARED_CONFIG_FOLDER);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Set shared config folder for automated mode from persistent
|
||||
* storage.
|
||||
* Set shared config folder for automated mode from persistent storage.
|
||||
*
|
||||
* @param folder the folder which contains the shared configF
|
||||
*/
|
||||
public static void setSharedConfigFolder(String folder) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, SHARED_CONFIG_FOLDER, folder);
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, SHARED_CONFIG_FOLDER, folder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get shared config checkbox state for automated mode from
|
||||
* persistent storage.
|
||||
* Get shared config checkbox state for automated mode from persistent
|
||||
* storage.
|
||||
*
|
||||
* @return Boolean true if shared settings are enabled.
|
||||
*/
|
||||
public static Boolean getSharedConfigEnabled() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, SHARED_CONFIG_ENABLED)) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, SHARED_CONFIG_ENABLED));
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, SHARED_CONFIG_ENABLED)) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, SHARED_CONFIG_ENABLED));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -193,7 +162,7 @@ public final class AutoIngestUserPreferences {
|
||||
* mode
|
||||
*/
|
||||
public static void setSharedConfigEnabled(boolean sharedSettingsEnabled) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, SHARED_CONFIG_ENABLED, Boolean.toString(sharedSettingsEnabled));
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, SHARED_CONFIG_ENABLED, Boolean.toString(sharedSettingsEnabled));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -203,8 +172,8 @@ public final class AutoIngestUserPreferences {
|
||||
* @return true if this node is set as a shared configuration master
|
||||
*/
|
||||
public static Boolean getSharedConfigMaster() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, SHARED_CONFIG_MASTER)) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, SHARED_CONFIG_MASTER));
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, SHARED_CONFIG_MASTER)) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, SHARED_CONFIG_MASTER));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -215,14 +184,13 @@ public final class AutoIngestUserPreferences {
|
||||
* @param sharedSettingsMaster true = this node can upload configuration
|
||||
*/
|
||||
public static void setSharedConfigMaster(boolean sharedSettingsMaster) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, SHARED_CONFIG_MASTER, Boolean.toString(sharedSettingsMaster));
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, SHARED_CONFIG_MASTER, Boolean.toString(sharedSettingsMaster));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get context string for automated mode ingest module settings.
|
||||
*
|
||||
* @return String Context string for automated mode ingest module
|
||||
* settings.
|
||||
* @return String Context string for automated mode ingest module settings.
|
||||
*/
|
||||
public static String getAutoModeIngestModuleContextString() {
|
||||
return AUTO_MODE_CONTEXT_STRING;
|
||||
@ -234,7 +202,7 @@ public final class AutoIngestUserPreferences {
|
||||
* @param showToolsWarning true = show warning dialog, false = don't show
|
||||
*/
|
||||
public static void setShowToolsWarning(boolean showToolsWarning) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, SHOW_TOOLS_WARNING, Boolean.toString(showToolsWarning));
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, SHOW_TOOLS_WARNING, Boolean.toString(showToolsWarning));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -243,21 +211,20 @@ public final class AutoIngestUserPreferences {
|
||||
* @return
|
||||
*/
|
||||
public static boolean getShowToolsWarning() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, SHOW_TOOLS_WARNING)) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, SHOW_TOOLS_WARNING));
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, SHOW_TOOLS_WARNING)) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, SHOW_TOOLS_WARNING));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the configured time to sleep between cases to prevent
|
||||
* database locks
|
||||
* Get the configured time to sleep between cases to prevent database locks
|
||||
*
|
||||
* @return int the value in seconds, default is 30 seconds.
|
||||
*/
|
||||
public static int getSecondsToSleepBetweenCases() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, SLEEP_BETWEEN_CASES_TIME)) {
|
||||
return Integer.parseInt(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, SLEEP_BETWEEN_CASES_TIME));
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, SLEEP_BETWEEN_CASES_TIME)) {
|
||||
return Integer.parseInt(ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, SLEEP_BETWEEN_CASES_TIME));
|
||||
}
|
||||
return 30;
|
||||
}
|
||||
@ -271,7 +238,7 @@ public final class AutoIngestUserPreferences {
|
||||
* @param value value the number of seconds to sleep between cases
|
||||
*/
|
||||
public static void setSecondsToSleepBetweenCases(int value) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, SLEEP_BETWEEN_CASES_TIME, Integer.toString(value));
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, SLEEP_BETWEEN_CASES_TIME, Integer.toString(value));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -282,8 +249,8 @@ public final class AutoIngestUserPreferences {
|
||||
* @return int maximum number of attempts, default is 2.
|
||||
*/
|
||||
public static int getMaxNumTimesToProcessImage() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, MAX_NUM_TIMES_TO_PROCESS_IMAGE)) {
|
||||
return Integer.parseInt(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, MAX_NUM_TIMES_TO_PROCESS_IMAGE));
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, MAX_NUM_TIMES_TO_PROCESS_IMAGE)) {
|
||||
return Integer.parseInt(ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, MAX_NUM_TIMES_TO_PROCESS_IMAGE));
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
@ -296,7 +263,7 @@ public final class AutoIngestUserPreferences {
|
||||
* @param retries the number of retries to allow
|
||||
*/
|
||||
public static void setMaxNumTimesToProcessImage(int retries) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, MAX_NUM_TIMES_TO_PROCESS_IMAGE, Integer.toString(retries));
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, MAX_NUM_TIMES_TO_PROCESS_IMAGE, Integer.toString(retries));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -306,8 +273,8 @@ public final class AutoIngestUserPreferences {
|
||||
* @return maximum number of concurrent nodes for one case. Default is 3.
|
||||
*/
|
||||
public static int getMaxConcurrentJobsForOneCase() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, MAX_CONCURRENT_NODES_FOR_ONE_CASE)) {
|
||||
return Integer.parseInt(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, MAX_CONCURRENT_NODES_FOR_ONE_CASE));
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, MAX_CONCURRENT_NODES_FOR_ONE_CASE)) {
|
||||
return Integer.parseInt(ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, MAX_CONCURRENT_NODES_FOR_ONE_CASE));
|
||||
}
|
||||
return 3;
|
||||
}
|
||||
@ -319,7 +286,7 @@ public final class AutoIngestUserPreferences {
|
||||
* @param numberOfNodes the number of concurrent nodes to allow for one case
|
||||
*/
|
||||
public static void setMaxConcurrentIngestNodesForOneCase(int numberOfNodes) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, MAX_CONCURRENT_NODES_FOR_ONE_CASE, Integer.toString(numberOfNodes));
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, MAX_CONCURRENT_NODES_FOR_ONE_CASE, Integer.toString(numberOfNodes));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -329,8 +296,8 @@ public final class AutoIngestUserPreferences {
|
||||
* @return Boolean true if database logging is enabled.
|
||||
*/
|
||||
public static Boolean getStatusDatabaseLoggingEnabled() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, STATUS_DATABASE_LOGGING_ENABLED)) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, STATUS_DATABASE_LOGGING_ENABLED));
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, STATUS_DATABASE_LOGGING_ENABLED)) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, STATUS_DATABASE_LOGGING_ENABLED));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -343,7 +310,7 @@ public final class AutoIngestUserPreferences {
|
||||
* mode
|
||||
*/
|
||||
public static void setStatusDatabaseLoggingEnabled(boolean databaseLoggingEnabled) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, STATUS_DATABASE_LOGGING_ENABLED, Boolean.toString(databaseLoggingEnabled));
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, STATUS_DATABASE_LOGGING_ENABLED, Boolean.toString(databaseLoggingEnabled));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -352,8 +319,8 @@ public final class AutoIngestUserPreferences {
|
||||
* @return Logging database hostname or IP
|
||||
*/
|
||||
public static String getLoggingDatabaseHostnameOrIP() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, LOGGING_DB_HOSTNAME_OR_IP)) {
|
||||
return ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, LOGGING_DB_HOSTNAME_OR_IP);
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, LOGGING_DB_HOSTNAME_OR_IP)) {
|
||||
return ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, LOGGING_DB_HOSTNAME_OR_IP);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@ -364,7 +331,7 @@ public final class AutoIngestUserPreferences {
|
||||
* @param hostname Logging database hostname or IP
|
||||
*/
|
||||
public static void setLoggingDatabaseHostnameOrIP(String hostname) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, LOGGING_DB_HOSTNAME_OR_IP, hostname);
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, LOGGING_DB_HOSTNAME_OR_IP, hostname);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -373,8 +340,8 @@ public final class AutoIngestUserPreferences {
|
||||
* @return logging database port
|
||||
*/
|
||||
public static String getLoggingPort() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, LOGGING_PORT)) {
|
||||
return ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, LOGGING_PORT);
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, LOGGING_PORT)) {
|
||||
return ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, LOGGING_PORT);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@ -385,7 +352,7 @@ public final class AutoIngestUserPreferences {
|
||||
* @param port Logging database port
|
||||
*/
|
||||
public static void setLoggingPort(String port) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, LOGGING_PORT, port);
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, LOGGING_PORT, port);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -394,8 +361,8 @@ public final class AutoIngestUserPreferences {
|
||||
* @return logging database username
|
||||
*/
|
||||
public static String getLoggingUsername() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, LOGGING_USERNAME)) {
|
||||
return ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, LOGGING_USERNAME);
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, LOGGING_USERNAME)) {
|
||||
return ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, LOGGING_USERNAME);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@ -406,17 +373,19 @@ public final class AutoIngestUserPreferences {
|
||||
* @param username Logging database username
|
||||
*/
|
||||
public static void setLoggingUsername(String username) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, LOGGING_USERNAME, username);
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, LOGGING_USERNAME, username);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the logging database password from persistent storage.
|
||||
*
|
||||
* @return logging database password
|
||||
*
|
||||
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||
*/
|
||||
public static String getLoggingPassword() throws UserPreferencesException {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, LOGGING_PASSWORD)) {
|
||||
return TextConverter.convertHexTextToText(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, LOGGING_PASSWORD));
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, LOGGING_PASSWORD)) {
|
||||
return TextConverter.convertHexTextToText(ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, LOGGING_PASSWORD));
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@ -425,9 +394,11 @@ public final class AutoIngestUserPreferences {
|
||||
* Save the logging database password to persistent storage.
|
||||
*
|
||||
* @param password Logging database password
|
||||
*
|
||||
* @throws org.sleuthkit.autopsy.core.UserPreferencesException
|
||||
*/
|
||||
public static void setLoggingPassword(String password) throws UserPreferencesException {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, LOGGING_PASSWORD, TextConverter.convertTextToHexText(password));
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, LOGGING_PASSWORD, TextConverter.convertTextToHexText(password));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -436,8 +407,8 @@ public final class AutoIngestUserPreferences {
|
||||
* @return logging database name
|
||||
*/
|
||||
public static String getLoggingDatabaseName() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, LOGGING_DATABASE_NAME)) {
|
||||
return ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, LOGGING_DATABASE_NAME);
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, LOGGING_DATABASE_NAME)) {
|
||||
return ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, LOGGING_DATABASE_NAME);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
@ -448,7 +419,7 @@ public final class AutoIngestUserPreferences {
|
||||
* @param name Logging database name
|
||||
*/
|
||||
public static void setLoggingDatabaseName(String name) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, LOGGING_DATABASE_NAME, name);
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, LOGGING_DATABASE_NAME, name);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -457,8 +428,8 @@ public final class AutoIngestUserPreferences {
|
||||
* @return int the value in minutes, default is 60 minutes.
|
||||
*/
|
||||
public static int getMinutesOfInputScanInterval() {
|
||||
if (ModuleSettings.settingExists(SETTINGS_PROPERTIES, INPUT_SCAN_INTERVAL_TIME)) {
|
||||
return Integer.parseInt(ModuleSettings.getConfigSetting(SETTINGS_PROPERTIES, INPUT_SCAN_INTERVAL_TIME));
|
||||
if (ModuleSettings.settingExists(UserPreferences.SETTINGS_PROPERTIES, INPUT_SCAN_INTERVAL_TIME)) {
|
||||
return Integer.parseInt(ModuleSettings.getConfigSetting(UserPreferences.SETTINGS_PROPERTIES, INPUT_SCAN_INTERVAL_TIME));
|
||||
}
|
||||
return 60;
|
||||
}
|
||||
@ -469,12 +440,12 @@ public final class AutoIngestUserPreferences {
|
||||
* @param value the number of minutes for input interval
|
||||
*/
|
||||
public static void setMinutesOfInputScanInterval(int value) {
|
||||
ModuleSettings.setConfigSetting(SETTINGS_PROPERTIES, INPUT_SCAN_INTERVAL_TIME, Integer.toString(value));
|
||||
ModuleSettings.setConfigSetting(UserPreferences.SETTINGS_PROPERTIES, INPUT_SCAN_INTERVAL_TIME, Integer.toString(value));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copied from Autopsy UserPreferences - can be removed once everything is merged together.
|
||||
* Provides ability to convert text to hex text.
|
||||
* Copied from Autopsy UserPreferences - can be removed once everything is
|
||||
* merged together. Provides ability to convert text to hex text.
|
||||
*/
|
||||
static final class TextConverter {
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class SharedConfiguration {
|
||||
private static final Logger logger = Logger.getLogger(SharedConfiguration.class.getName());
|
||||
|
||||
private final UpdateConfigSwingWorker swingWorker;
|
||||
private AutoIngestUserPreferences.SelectedMode mode;
|
||||
private UserPreferences.SelectedMode mode;
|
||||
private String sharedConfigFolder;
|
||||
private int fileIngestThreads;
|
||||
private boolean sharedConfigMaster;
|
||||
|
@ -33,6 +33,7 @@ import org.openide.util.lookup.ServiceProvider;
|
||||
import org.openide.windows.WindowManager;
|
||||
import org.sleuthkit.autopsy.casemodule.CueBannerPanel;
|
||||
import org.sleuthkit.autopsy.casemodule.StartupWindowInterface;
|
||||
import org.sleuthkit.autopsy.core.UserPreferences;
|
||||
import org.sleuthkit.autopsy.coreutils.NetworkUtils;
|
||||
import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestDashboard;
|
||||
import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestCasePanel;
|
||||
@ -103,10 +104,10 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa
|
||||
* user.
|
||||
*/
|
||||
private void addPanelForMode() {
|
||||
AutoIngestUserPreferences.SelectedMode mode = AutoIngestUserPreferences.getMode();
|
||||
UserPreferences.SelectedMode mode = UserPreferences.getMode();
|
||||
|
||||
switch (mode) {
|
||||
case AUTOMATED:
|
||||
case AUTOINGEST:
|
||||
this.setTitle(NbBundle.getMessage(StartupWindow.class, "StartupWindow.AutoIngestMode") + " (" + LOCAL_HOST_NAME + ")");
|
||||
setIconImage(ImageUtilities.loadImage("org/sleuthkit/autopsy/experimental/images/frame.gif", false)); //NON-NLS
|
||||
this.addWindowListener(new WindowAdapter() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user