diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileType.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileType.java index e44a3b5adc..30c9525603 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileType.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileType.java @@ -20,6 +20,7 @@ package org.sleuthkit.autopsy.modules.filetypeid; import java.nio.charset.StandardCharsets; import java.util.Arrays; +import java.util.Objects; import java.util.logging.Level; import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.datamodel.AbstractFile; @@ -103,6 +104,29 @@ class FileType { String getFilesSetName() { return interestingFilesSetName; } + + @Override + public String toString() { + return this.mimeType; + } + + @Override + public boolean equals(Object other) { + if(other != null && other instanceof FileType) { + FileType that = (FileType) other; + if(this.getMimeType().equals(that.getMimeType()) && this.getSignature().equals(that.getSignature())) + return true; + } + return false; + } + + @Override + public int hashCode() { + int hash = 7; + hash = 67 * hash + Objects.hashCode(this.mimeType); + hash = 67 * hash + Objects.hashCode(this.signature); + return hash; + } /** * A file signature consisting of a sequence of bytes at a specific offset @@ -221,6 +245,27 @@ class FileType { return false; } } + + @Override + public boolean equals(Object other) { + if (other != null && other instanceof Signature) { + Signature that = (Signature) other; + if(Arrays.equals(this.getSignatureBytes(), that.getSignatureBytes()) + && this.getOffset() == that.getOffset() + && this.getType().equals(that.getType())) + return true; + } + return false; + } + + @Override + public int hashCode() { + int hash = 3; + hash = 97 * hash + Arrays.hashCode(this.signatureBytes); + hash = 97 * hash + (int) (this.offset ^ (this.offset >>> 32)); + hash = 97 * hash + Objects.hashCode(this.type); + return hash; + } } } diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java index b2ff1e5ada..cde31639f4 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java @@ -19,6 +19,7 @@ package org.sleuthkit.autopsy.modules.filetypeid; import java.util.ArrayList; +import java.util.List; import java.util.Map; import java.util.SortedSet; import org.apache.tika.Tika; @@ -38,15 +39,14 @@ public class FileTypeDetector { private static final Tika tika = new Tika(); private static final int BUFFER_SIZE = 64 * 1024; private final byte buffer[] = new byte[BUFFER_SIZE]; - private final Map userDefinedFileTypes; + private final List userDefinedFileTypes; /** * Constructs an object that detects the type of a file by an inspection of * its contents. * * @throws FileTypeDetector.FileTypeDetectorInitException if an - * initialization - * error occurs. + * initialization error occurs. */ public FileTypeDetector() throws FileTypeDetectorInitException { try { @@ -77,7 +77,12 @@ public class FileTypeDetector { * @return True if MIME type is detectable. */ private boolean isDetectableAsUserDefinedType(String mimeType) { - return userDefinedFileTypes.containsKey(mimeType); + for (FileType fileType : userDefinedFileTypes) { + if (fileType.getMimeType().equals(mimeType)) { + return true; + } + } + return false; } /** @@ -216,7 +221,7 @@ public class FileTypeDetector { * @throws TskCoreException */ private String detectUserDefinedType(AbstractFile file) throws TskCoreException { - for (FileType fileType : userDefinedFileTypes.values()) { + for (FileType fileType : userDefinedFileTypes) { if (fileType.matches(file)) { if (fileType.alertOnMatch()) { BlackboardArtifact artifact; diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.form b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.form index 1d124ea29d..bfc83ee709 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.form +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.form @@ -33,59 +33,58 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - @@ -181,7 +180,7 @@ - + diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.java index cebce19890..5380234490 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeIdGlobalSettingsPanel.java @@ -58,8 +58,8 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane * the MIME types to file type objects lies behind the list model. This map * is obtained from the user-defined types manager. */ - private DefaultListModel typesListModel; - private Map fileTypes; + private DefaultListModel typesListModel; + private java.util.List fileTypes; /** * This panel implements a property change listener that listens to ingest @@ -227,7 +227,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane ex.getLocalizedMessage(), NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.loadFailed.title"), JOptionPane.ERROR_MESSAGE); - fileTypes = Collections.emptyMap(); + fileTypes = Collections.emptyList(); } enableButtons(); } @@ -236,11 +236,10 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane * Sets the list model for the file types list component. */ private void updateFileTypesListModel() { - ArrayList mimeTypes = new ArrayList<>(fileTypes.keySet()); - Collections.sort(mimeTypes); typesListModel.clear(); - for (String mimeType : mimeTypes) { - typesListModel.addElement(mimeType); + for (FileType fileType : fileTypes) { + typesListModel.addElement(fileType); + } } @@ -249,10 +248,10 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane * panel based on the current selection in the file types list. */ private void populateTypeDetailsComponents() { - String mimeType = typesList.getSelectedValue(); - FileType fileType = fileTypes.get(mimeType); + FileType fileType = typesList.getSelectedValue(); if (null != fileType) { mimeTypeTextField.setText(fileType.getMimeType()); + mimeTypeTextField.setEditable(false); Signature signature = fileType.getSignature(); FileType.Signature.Type sigType = signature.getType(); signatureTypeComboBox.setSelectedItem(sigType == FileType.Signature.Type.RAW ? FileTypeIdGlobalSettingsPanel.RAW_SIGNATURE_TYPE_COMBO_BOX_ITEM : FileTypeIdGlobalSettingsPanel.ASCII_SIGNATURE_TYPE_COMBO_BOX_ITEM); @@ -286,6 +285,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane private void clearTypeDetailsComponents() { typesList.clearSelection(); mimeTypeTextField.setText(""); //NON-NLS + mimeTypeTextField.setEditable(true); signatureTypeComboBox.setSelectedItem(FileTypeIdGlobalSettingsPanel.RAW_SIGNATURE_TYPE_COMBO_BOX_ITEM); hexPrefixLabel.setVisible(true); signatureTextField.setText("0000"); //NON-NLS @@ -339,7 +339,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane private void initComponents() { typesScrollPane = new javax.swing.JScrollPane(); - typesList = new javax.swing.JList(); + typesList = new javax.swing.JList(); separator = new javax.swing.JSeparator(); mimeTypeLabel = new javax.swing.JLabel(); mimeTypeTextField = new javax.swing.JTextField(); @@ -451,48 +451,47 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane .addGap(30, 30, 30)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(jLabel2) .addGroup(layout.createSequentialGroup() - .addGap(10, 10, 10) - .addComponent(deleteTypeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) - .addGap(18, 18, 18) - .addComponent(newTypeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(typesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, 7, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(layout.createSequentialGroup() - .addComponent(mimeTypeLabel) - .addGap(30, 30, 30) - .addComponent(mimeTypeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(postHitCheckBox) - .addGroup(layout.createSequentialGroup() - .addComponent(signatureTypeLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(signatureTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(signatureLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(hexPrefixLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(signatureTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(layout.createSequentialGroup() - .addComponent(offsetLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(offsetTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addGap(21, 21, 21) - .addComponent(filesSetNameLabel) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) - .addComponent(filesSetNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() - .addComponent(saveTypeButton) - .addGap(8, 8, 8))) - .addContainerGap()) - .addGroup(layout.createSequentialGroup() - .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(jLabel2) + .addGroup(layout.createSequentialGroup() + .addGap(10, 10, 10) + .addComponent(deleteTypeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(18, 18, 18) + .addComponent(newTypeButton, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(typesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(separator, javax.swing.GroupLayout.PREFERRED_SIZE, 7, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addComponent(mimeTypeLabel) + .addGap(30, 30, 30) + .addComponent(mimeTypeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(postHitCheckBox) + .addGroup(layout.createSequentialGroup() + .addComponent(signatureTypeLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(signatureTypeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(signatureLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(hexPrefixLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(signatureTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(layout.createSequentialGroup() + .addComponent(offsetLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(offsetTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addGap(21, 21, 21) + .addComponent(filesSetNameLabel) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) + .addComponent(filesSetNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 182, javax.swing.GroupLayout.PREFERRED_SIZE))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() + .addComponent(saveTypeButton) + .addGap(8, 8, 8)))) .addComponent(jLabel1) .addComponent(jLabel3)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) @@ -557,8 +556,8 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane }//GEN-LAST:event_newTypeButtonActionPerformed private void deleteTypeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteTypeButtonActionPerformed - String typeName = typesList.getSelectedValue(); - fileTypes.remove(typeName); + FileType fileType = typesList.getSelectedValue(); + fileTypes.remove(fileType); updateFileTypesListModel(); if (!typesListModel.isEmpty()) { typesList.setSelectedIndex(0); @@ -626,7 +625,10 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane /** * Get the interesting files set details. */ - String filesSetName = filesSetNameTextField.getText(); + String filesSetName = ""; + if (postHitCheckBox.isSelected()) { + filesSetName = filesSetNameTextField.getText(); + } if (postHitCheckBox.isSelected() && filesSetName.isEmpty()) { JOptionPane.showMessageDialog(null, NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidInterestingFilesSetName.message"), @@ -640,9 +642,13 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane */ FileType.Signature signature = new FileType.Signature(signatureBytes, offset, sigType); FileType fileType = new FileType(typeName, signature, filesSetName, postHitCheckBox.isSelected()); - fileTypes.put(typeName, fileType); + FileType selected = typesList.getSelectedValue(); + if (selected != null) { + fileTypes.remove(selected); + } + fileTypes.add(fileType); updateFileTypesListModel(); - typesList.setSelectedValue(fileType.getMimeType(), true); + typesList.setSelectedValue(fileType, true); }//GEN-LAST:event_saveTypeButtonActionPerformed private void postHitCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_postHitCheckBoxActionPerformed @@ -685,7 +691,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane private javax.swing.JTextField signatureTextField; private javax.swing.JComboBox signatureTypeComboBox; private javax.swing.JLabel signatureTypeLabel; - private javax.swing.JList typesList; + private javax.swing.JList typesList; private javax.swing.JScrollPane typesScrollPane; // End of variables declaration//GEN-END:variables diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/UserDefinedFileTypesManager.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/UserDefinedFileTypesManager.java index d5777cb281..47a3a0f97b 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/UserDefinedFileTypesManager.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/UserDefinedFileTypesManager.java @@ -25,10 +25,7 @@ import java.io.UnsupportedEncodingException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; import java.util.List; -import java.util.Map; import java.util.logging.Level; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; @@ -82,7 +79,7 @@ final class UserDefinedFileTypesManager { * map is guarded by the intrinsic lock of the user-defined file types * manager for thread-safety. */ - private final Map userDefinedFileTypes = new HashMap<>(); + private final List userDefinedFileTypes = new ArrayList<>(); /** * The combined set of user-defined file types and file types predefined by @@ -91,7 +88,7 @@ final class UserDefinedFileTypesManager { * the intrinsic lock of the user-defined file types manager for * thread-safety. */ - private final Map fileTypes = new HashMap<>(); + private final List fileTypes = new ArrayList<>(); /** * Gets the singleton manager of user-defined file types characterized by @@ -122,7 +119,7 @@ final class UserDefinedFileTypesManager { * @throws * org.sleuthkit.autopsy.modules.filetypeid.UserDefinedFileTypesManager.UserDefinedFileTypesException */ - synchronized Map getFileTypes() throws UserDefinedFileTypesException { + synchronized List getFileTypes() throws UserDefinedFileTypesException { loadFileTypes(); /** @@ -131,7 +128,7 @@ final class UserDefinedFileTypesManager { * Collections.unmodifiableCollection() is not used here because this * view of the file types is a snapshot. */ - return new HashMap<>(fileTypes); + return new ArrayList<>(fileTypes); } /** @@ -142,7 +139,7 @@ final class UserDefinedFileTypesManager { * @throws * org.sleuthkit.autopsy.modules.filetypeid.UserDefinedFileTypesManager.UserDefinedFileTypesException */ - synchronized Map getUserDefinedFileTypes() throws UserDefinedFileTypesException { + synchronized List getUserDefinedFileTypes() throws UserDefinedFileTypesException { loadFileTypes(); /** @@ -151,7 +148,7 @@ final class UserDefinedFileTypesManager { * Collections.unmodifiableCollection() is not used here because this * view of the file types is a snapshot. */ - return new HashMap<>(userDefinedFileTypes); + return new ArrayList<>(userDefinedFileTypes); } /** @@ -186,44 +183,44 @@ final class UserDefinedFileTypesManager { try { // Add rule for xml fileType = new FileType("text/xml", new Signature(" newFileTypes) throws UserDefinedFileTypesException { + synchronized void setUserDefinedFileTypes(List newFileTypes) throws UserDefinedFileTypesException { try { String filePath = getFileTypeDefinitionsFilePath(USER_DEFINED_TYPE_DEFINITIONS_FILE); - XmlWriter.writeFileTypes(newFileTypes.values(), filePath); + XmlWriter.writeFileTypes(newFileTypes, filePath); } catch (ParserConfigurationException | FileNotFoundException | UnsupportedEncodingException | TransformerException ex) { throwUserDefinedFileTypesException(ex, "UserDefinedFileTypesManager.saveFileTypes.errorMessage"); } catch (IOException ex) { @@ -308,7 +305,7 @@ final class UserDefinedFileTypesManager { * Writes a set of file type definitions to an XML file. * * @param fileTypes A collection of file types. - * @param filePath The path to the destination file. + * @param filePath The path to the destination file. * * @throws ParserConfigurationException * @throws IOException @@ -316,7 +313,7 @@ final class UserDefinedFileTypesManager { * @throws UnsupportedEncodingException * @throws TransformerException */ - private static void writeFileTypes(Collection fileTypes, String filePath) throws ParserConfigurationException, IOException, FileNotFoundException, UnsupportedEncodingException, TransformerException { + private static void writeFileTypes(List fileTypes, String filePath) throws ParserConfigurationException, IOException, FileNotFoundException, UnsupportedEncodingException, TransformerException { Document doc = XMLUtil.createDocument(); Element fileTypesElem = doc.createElement(FILE_TYPES_TAG_NAME); doc.appendChild(fileTypesElem); @@ -331,7 +328,7 @@ final class UserDefinedFileTypesManager { * Creates an XML representation of a file type. * * @param fileType The file type object. - * @param doc The WC3 DOM object to use to create the XML. + * @param doc The WC3 DOM object to use to create the XML. * * @return An XML element. */ @@ -347,9 +344,9 @@ final class UserDefinedFileTypesManager { /** * Add a MIME type child element to a file type XML element. * - * @param fileType The file type to use as a content source. + * @param fileType The file type to use as a content source. * @param fileTypeElem The parent file type element. - * @param doc The WC3 DOM object to use to create the XML. + * @param doc The WC3 DOM object to use to create the XML. */ private static void addMimeTypeElement(FileType fileType, Element fileTypeElem, Document doc) { Element typeNameElem = doc.createElement(MIME_TYPE_TAG_NAME); @@ -360,9 +357,9 @@ final class UserDefinedFileTypesManager { /** * Add a signature child element to a file type XML element. * - * @param fileType The file type to use as a content source. + * @param fileType The file type to use as a content source. * @param fileTypeElem The parent file type element. - * @param doc The WC3 DOM object to use to create the XML. + * @param doc The WC3 DOM object to use to create the XML. */ private static void addSignatureElement(FileType fileType, Element fileTypeElem, Document doc) { Signature signature = fileType.getSignature(); @@ -383,9 +380,9 @@ final class UserDefinedFileTypesManager { /** * Add an interesting files set element to a file type XML element. * - * @param fileType The file type to use as a content source. + * @param fileType The file type to use as a content source. * @param fileTypeElem The parent file type element. - * @param doc The WC3 DOM object to use to create the XML. + * @param doc The WC3 DOM object to use to create the XML. */ private static void addInterestingFilesSetElement(FileType fileType, Element fileTypeElem, Document doc) { if (!fileType.getFilesSetName().isEmpty()) { @@ -398,7 +395,7 @@ final class UserDefinedFileTypesManager { /** * Add an alert attribute to a file type XML element. * - * @param fileType The file type to use as a content source. + * @param fileType The file type to use as a content source. * @param fileTypeElem The parent file type element. */ private static void addAlertAttribute(FileType fileType, Element fileTypeElem) { @@ -521,7 +518,7 @@ final class UserDefinedFileTypesManager { /** * Gets the text content of a single child element. * - * @param elem The parent element. + * @param elem The parent element. * @param tagName The tag name of the child element. * * @return The text content. @@ -538,9 +535,9 @@ final class UserDefinedFileTypesManager { * Logs an exception, bundles the exception with a simple message in a * uniform exception type, and throws the wrapper exception. * - * @param ex The exception to wrap. + * @param ex The exception to wrap. * @param messageKey A key into the bundle file that maps to the desired - * message. + * message. * * @throws * org.sleuthkit.autopsy.modules.filetypeid.UserDefinedFileTypesManager.UserDefinedFileTypesException