mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
1903-changed option for FilesAndDirs to All on rule creation
This commit is contained in:
parent
39d36df476
commit
258cfbf4ab
@ -44,7 +44,6 @@ FilesSetRulePanel.mimeCheck.text=MIME Type:
|
||||
FilesSetRulePanel.fileSizeCheck.text=File Size:
|
||||
FilesSetRulePanel.filesRadioButton.text=Files
|
||||
FilesSetRulePanel.dirsRadioButton.text=Directories
|
||||
FilesSetRulePanel.filesAndDirsRadioButton.text=Files and Directories
|
||||
FilesSetDefsPanel.interesting.setsListLabel.text=Rule Sets
|
||||
FilesSetDefsPanel.ingest.setsListLabel.text=File Ingest Filters
|
||||
FilesSetDefsPanel.interesting.jTextArea1.text=This module allows you to find files that match specified criteria. Each set has a list of rules, which will match on file name and parent path patterns.
|
||||
@ -81,3 +80,4 @@ FilesSetDefsPanel.fileNameExtensionRadioButton.text=Extension Only
|
||||
FilesSetDefsPanel.rulesListLabel.text=Rules:
|
||||
FilesSetDefsPanel.editRuleButton.text=Edit Rule
|
||||
FilesSetDefsPanel.filesRadioButton.text=Files
|
||||
FilesSetRulePanel.allRadioButton.text=All
|
||||
|
@ -42,7 +42,7 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="dirsRadioButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="filesAndDirsRadioButton" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="allRadioButton" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
@ -111,7 +111,7 @@
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="filesRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="dirsRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="filesAndDirsRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="allRadioButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
@ -199,9 +199,6 @@
|
||||
</Property>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="fullNameRadioButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="extensionRadioButton">
|
||||
<Properties>
|
||||
@ -370,17 +367,17 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="dirsRadioButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JRadioButton" name="filesAndDirsRadioButton">
|
||||
<Component class="javax.swing.JRadioButton" name="allRadioButton">
|
||||
<Properties>
|
||||
<Property name="buttonGroup" type="javax.swing.ButtonGroup" editor="org.netbeans.modules.form.RADComponent$ButtonGroupPropertyEditor">
|
||||
<ComponentRef name="typeButtonGroup"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/interestingitems/Bundle.properties" key="FilesSetRulePanel.filesAndDirsRadioButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/modules/interestingitems/Bundle.properties" key="FilesSetRulePanel.allRadioButton.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="filesAndDirsRadioButtonActionPerformed"/>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="allRadioButtonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
|
@ -39,7 +39,7 @@ import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
|
||||
import org.sleuthkit.autopsy.modules.interestingitems.FilesSetDefsPanel.PANEL_TYPE;
|
||||
|
||||
/**
|
||||
* A panel that allows a user to create and edit interesting files set
|
||||
* A panel that allows a user to create and edit files set
|
||||
* membership rules.
|
||||
*/
|
||||
final class FilesSetRulePanel extends javax.swing.JPanel {
|
||||
@ -251,8 +251,8 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
||||
case DIRECTORIES:
|
||||
this.dirsRadioButton.setSelected(true);
|
||||
break;
|
||||
case FILES_AND_DIRECTORIES:
|
||||
this.filesAndDirsRadioButton.setSelected(true);
|
||||
case ALL:
|
||||
this.allRadioButton.setSelected(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -295,7 +295,7 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
||||
|
||||
/**
|
||||
* Returns whether or not the data entered in the panel constitutes a valid
|
||||
* interesting files set membership rule definition, displaying a dialog
|
||||
* files set membership rule definition, displaying a dialog
|
||||
* explaining the deficiency if the definition is invalid.
|
||||
*
|
||||
* @return True if the definition is valid, false otherwise.
|
||||
@ -479,7 +479,7 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
||||
} else if (this.dirsRadioButton.isSelected()) {
|
||||
return new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.DIRECTORIES);
|
||||
} else {
|
||||
return new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES_AND_DIRECTORIES);
|
||||
return new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.ALL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -601,7 +601,7 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
||||
fileSizeCheck = new javax.swing.JCheckBox();
|
||||
filesRadioButton = new javax.swing.JRadioButton();
|
||||
dirsRadioButton = new javax.swing.JRadioButton();
|
||||
filesAndDirsRadioButton = new javax.swing.JRadioButton();
|
||||
allRadioButton = new javax.swing.JRadioButton();
|
||||
|
||||
org.openide.awt.Mnemonics.setLocalizedText(ruleNameLabel, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.ruleNameLabel.text")); // NOI18N
|
||||
|
||||
@ -620,11 +620,6 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
||||
nameButtonGroup.add(fullNameRadioButton);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(fullNameRadioButton, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.fullNameRadioButton.text")); // NOI18N
|
||||
fullNameRadioButton.setEnabled(false);
|
||||
fullNameRadioButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
fullNameRadioButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
nameButtonGroup.add(extensionRadioButton);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(extensionRadioButton, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.extensionRadioButton.text")); // NOI18N
|
||||
@ -702,11 +697,11 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
||||
}
|
||||
});
|
||||
|
||||
typeButtonGroup.add(filesAndDirsRadioButton);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(filesAndDirsRadioButton, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.filesAndDirsRadioButton.text")); // NOI18N
|
||||
filesAndDirsRadioButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
typeButtonGroup.add(allRadioButton);
|
||||
org.openide.awt.Mnemonics.setLocalizedText(allRadioButton, org.openide.util.NbBundle.getMessage(FilesSetRulePanel.class, "FilesSetRulePanel.allRadioButton.text")); // NOI18N
|
||||
allRadioButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
filesAndDirsRadioButtonActionPerformed(evt);
|
||||
allRadioButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
@ -733,7 +728,7 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(dirsRadioButton)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(filesAndDirsRadioButton)))
|
||||
.addComponent(allRadioButton)))
|
||||
.addGap(0, 0, Short.MAX_VALUE))))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
@ -784,7 +779,7 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(filesRadioButton)
|
||||
.addComponent(dirsRadioButton)
|
||||
.addComponent(filesAndDirsRadioButton))
|
||||
.addComponent(allRadioButton))
|
||||
.addGap(5, 5, 5)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(nameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
@ -889,22 +884,18 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
|
||||
this.setComponentsForSearchType();
|
||||
}//GEN-LAST:event_dirsRadioButtonActionPerformed
|
||||
|
||||
private void filesAndDirsRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_filesAndDirsRadioButtonActionPerformed
|
||||
private void allRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_allRadioButtonActionPerformed
|
||||
this.setComponentsForSearchType();
|
||||
}//GEN-LAST:event_filesAndDirsRadioButtonActionPerformed
|
||||
|
||||
private void fullNameRadioButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fullNameRadioButtonActionPerformed
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_fullNameRadioButtonActionPerformed
|
||||
}//GEN-LAST:event_allRadioButtonActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JRadioButton allRadioButton;
|
||||
private javax.swing.JRadioButton dirsRadioButton;
|
||||
private javax.swing.JComboBox<String> equalitySymbolComboBox;
|
||||
private javax.swing.JRadioButton extensionRadioButton;
|
||||
private javax.swing.JCheckBox fileSizeCheck;
|
||||
private javax.swing.JComboBox<String> fileSizeComboBox;
|
||||
private javax.swing.JSpinner fileSizeSpinner;
|
||||
private javax.swing.JRadioButton filesAndDirsRadioButton;
|
||||
private javax.swing.JRadioButton filesRadioButton;
|
||||
private javax.swing.JRadioButton fullNameRadioButton;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
|
@ -62,7 +62,7 @@ public final class FilesSetsManager extends Observable {
|
||||
private static FilesSetsManager instance;
|
||||
|
||||
/**
|
||||
* Gets the interesting item definitions manager singleton.
|
||||
* Gets the FilesSet definitions manager singleton.
|
||||
*/
|
||||
public synchronized static FilesSetsManager getInstance() {
|
||||
if (instance == null) {
|
||||
@ -171,7 +171,7 @@ public final class FilesSetsManager extends Observable {
|
||||
* Sets the current interesting file sets definitions, replacing any
|
||||
* previous definitions.
|
||||
*
|
||||
* @param filesSets A mapping of interesting files set names to files sets,
|
||||
* @param filesSets A mapping of file ingest filters names to files sets,
|
||||
* used to enforce unique files set names.
|
||||
*/
|
||||
void setFileIngestFilter(Map<String, FilesSet> filesSets) throws FilesSetsManagerException {
|
||||
@ -181,7 +181,7 @@ public final class FilesSetsManager extends Observable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads and writes interesting files set definitions to and from disk in
|
||||
* Reads and writes FilesSet definitions to and from disk in
|
||||
* XML format.
|
||||
*/
|
||||
private final static class FilesSetXML {
|
||||
@ -191,7 +191,7 @@ public final class FilesSetsManager extends Observable {
|
||||
private static final List<String> illegalFileNameChars = FilesSetsManager.getIllegalFileNameChars();
|
||||
|
||||
// The following tags and attributes are identical to those used in the
|
||||
// TSK Framework interesting files set definitions file schema.
|
||||
// TSK Framework FilesSet definitions file schema.
|
||||
private static final String FILE_SETS_ROOT_TAG = "INTERESTING_FILE_SETS"; //NON-NLS
|
||||
private static final String FILE_SET_TAG = "INTERESTING_FILE_SET"; //NON-NLS
|
||||
private static final String NAME_RULE_TAG = "NAME"; //NON-NLS
|
||||
@ -213,7 +213,7 @@ public final class FilesSetsManager extends Observable {
|
||||
private static int unnamedLegacyRuleCounter;
|
||||
|
||||
/**
|
||||
* Reads interesting file set definitions from an XML file.
|
||||
* Reads FilesSet definitions from an XML file.
|
||||
*
|
||||
* @param fileName The name of the file which is expected to store
|
||||
* the serialized definitions
|
||||
@ -239,21 +239,21 @@ public final class FilesSetsManager extends Observable {
|
||||
|
||||
// Check if the file can be read.
|
||||
if (!defsFile.canRead()) {
|
||||
logger.log(Level.SEVERE, "Interesting file sets definition file at {0} exists, but cannot be read", defsFile.getPath()); // NON-NLS
|
||||
logger.log(Level.SEVERE, "FilesSet definition file at {0} exists, but cannot be read", defsFile.getPath()); // NON-NLS
|
||||
return filesSets;
|
||||
}
|
||||
|
||||
// Parse the XML in the file.
|
||||
Document doc = XMLUtil.loadDoc(FilesSetXML.class, defsFile.getPath());
|
||||
if (doc == null) {
|
||||
logger.log(Level.SEVERE, "Failed to parse interesting file sets definition file at {0}", defsFile.getPath()); // NON-NLS
|
||||
logger.log(Level.SEVERE, "FilesSet definition file at {0}", defsFile.getPath()); // NON-NLS
|
||||
return filesSets;
|
||||
}
|
||||
|
||||
// Get the root element.
|
||||
Element root = doc.getDocumentElement();
|
||||
if (root == null) {
|
||||
logger.log(Level.SEVERE, "Failed to get root {0} element tag of interesting file sets definition file at {1}", new Object[]{FilesSetXML.FILE_SETS_ROOT_TAG, defsFile.getPath()}); // NON-NLS
|
||||
logger.log(Level.SEVERE, "Failed to get root {0} element tag of FilesSet definition file at {1}", new Object[]{FilesSetXML.FILE_SETS_ROOT_TAG, defsFile.getPath()}); // NON-NLS
|
||||
return filesSets;
|
||||
}
|
||||
|
||||
@ -293,9 +293,9 @@ public final class FilesSetsManager extends Observable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads in an interesting files set.
|
||||
* Reads in a FilesSet.
|
||||
*
|
||||
* @param setElem An interesting files set XML element
|
||||
* @param setElem A FilesSet XML element
|
||||
* @param filesSets A collection to which the set is to be added.
|
||||
* @param filePath The source file, used for error reporting.
|
||||
*/
|
||||
@ -303,11 +303,11 @@ public final class FilesSetsManager extends Observable {
|
||||
// The file set must have a unique name.
|
||||
String setName = setElem.getAttribute(FilesSetXML.NAME_ATTR);
|
||||
if (setName.isEmpty()) {
|
||||
logger.log(Level.SEVERE, "Found {0} element without required {1} attribute, ignoring malformed file set definition in interesting file sets definition file at {2}", new Object[]{FilesSetXML.FILE_SET_TAG, FilesSetXML.NAME_ATTR, filePath}); // NON-NLS
|
||||
logger.log(Level.SEVERE, "Found {0} element without required {1} attribute, ignoring malformed file set definition in FilesSet definition file at {2}", new Object[]{FilesSetXML.FILE_SET_TAG, FilesSetXML.NAME_ATTR, filePath}); // NON-NLS
|
||||
return;
|
||||
}
|
||||
if (filesSets.containsKey(setName)) {
|
||||
logger.log(Level.SEVERE, "Found duplicate definition of set named {0} in interesting file sets definition file at {1}, discarding duplicate set", new Object[]{setName, filePath}); // NON-NLS
|
||||
logger.log(Level.SEVERE, "Found duplicate definition of set named {0} in FilesSet definition file at {1}, discarding duplicate set", new Object[]{setName, filePath}); // NON-NLS
|
||||
return;
|
||||
}
|
||||
|
||||
@ -340,11 +340,11 @@ public final class FilesSetsManager extends Observable {
|
||||
if (!rules.containsKey(rule.getUuid())) {
|
||||
rules.put(rule.getUuid(), rule);
|
||||
} else {
|
||||
logger.log(Level.SEVERE, "Found duplicate rule {0} for set named {1} in interesting file sets definition file at {2}, discarding malformed set", new Object[]{rule.getUuid(), setName, filePath}); // NON-NLS
|
||||
logger.log(Level.SEVERE, "Found duplicate rule {0} for set named {1} in FilesSet definition file at {2}, discarding malformed set", new Object[]{rule.getUuid(), setName, filePath}); // NON-NLS
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.SEVERE, "Found malformed rule for set named {0} in interesting file sets definition file at {1}, discarding malformed set", new Object[]{setName, filePath}); // NON-NLS
|
||||
logger.log(Level.SEVERE, "Found malformed rule for set named {0} in FilesSet definition file at {1}, discarding malformed set", new Object[]{setName, filePath}); // NON-NLS
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -358,11 +358,11 @@ public final class FilesSetsManager extends Observable {
|
||||
if (!rules.containsKey(rule.getUuid())) {
|
||||
rules.put(rule.getUuid(), rule);
|
||||
} else {
|
||||
logger.log(Level.SEVERE, "Found duplicate rule {0} for set named {1} in interesting file sets definition file at {2}, discarding malformed set", new Object[]{rule.getUuid(), setName, filePath}); //NOI18N NON-NLS
|
||||
logger.log(Level.SEVERE, "Found duplicate rule {0} for set named {1} in FilesSet definition file at {2}, discarding malformed set", new Object[]{rule.getUuid(), setName, filePath}); //NOI18N NON-NLS
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.SEVERE, "Found malformed rule for set named {0} in interesting file sets definition file at {1}, discarding malformed set", new Object[]{setName, filePath}); //NOI18N NON-NLS
|
||||
logger.log(Level.SEVERE, "Found malformed rule for set named {0} in FilesSet definition file at {1}, discarding malformed set", new Object[]{setName, filePath}); //NOI18N NON-NLS
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -375,7 +375,7 @@ public final class FilesSetsManager extends Observable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct an interesting files set file name rule from the data in an
|
||||
* Construct a FilesSet file name rule from the data in an
|
||||
* XML element.
|
||||
*
|
||||
* @param elem The file name rule XML element.
|
||||
@ -433,7 +433,7 @@ public final class FilesSetsManager extends Observable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct an interesting files set file name extension rule from the
|
||||
* Construct a FilesSet file name extension rule from the
|
||||
* data in an XML element.
|
||||
*
|
||||
* @param elem The file name extension rule XML element.
|
||||
@ -526,7 +526,7 @@ public final class FilesSetsManager extends Observable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a meta-type condition for an interesting files set
|
||||
* Construct a meta-type condition for a FilesSet
|
||||
* membership rule from data in an XML element.
|
||||
*
|
||||
* @param ruleElement The XML element.
|
||||
@ -553,7 +553,7 @@ public final class FilesSetsManager extends Observable {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
// Accept TSK Framework interesting files set definitions,
|
||||
// Accept TSK Framework FilesSet definitions,
|
||||
// default to files.
|
||||
condition = new FilesSet.Rule.MetaTypeCondition(FilesSet.Rule.MetaTypeCondition.Type.FILES);
|
||||
}
|
||||
@ -561,7 +561,7 @@ public final class FilesSetsManager extends Observable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a path condition for an interesting files set membership
|
||||
* Construct a path condition for a FilesSet membership
|
||||
* rule from data in an XML element.
|
||||
*
|
||||
* @param ruleElement The XML element.
|
||||
@ -586,7 +586,7 @@ public final class FilesSetsManager extends Observable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes interesting files set definitions to disk as an XML file,
|
||||
* Writes FilesSet definitions to disk as an XML file,
|
||||
* logging any errors.
|
||||
*
|
||||
* @param fileName Name of the set definitions file as a string.
|
||||
|
Loading…
x
Reference in New Issue
Block a user