Skip to content
Snippets Groups Projects
Commit 718e13d3 authored by Richard Cordovano's avatar Richard Cordovano
Browse files

Merge pull request #1684 from millmanorama/dont-abort-tagging

don't check for duplicate tags at all
parents 53013054 a191c73e
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,6 @@
package org.sleuthkit.autopsy.actions;
import java.util.Collection;
import java.util.List;
import java.util.logging.Level;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
......@@ -30,7 +29,6 @@
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.ContentTag;
import org.sleuthkit.datamodel.TagName;
import org.sleuthkit.datamodel.TskCoreException;
......@@ -120,25 +118,8 @@ protected void addTag(TagName tagName, String comment) {
continue;
}
}
// check if the same tag is being added for the same abstract file.
TagsManager tagsManager = Case.getCurrentCase().getServices().getTagsManager();
List<ContentTag> contentTagList = tagsManager.getContentTagsByContent(file);
for (ContentTag contentTag : contentTagList) {
if (contentTag.getName().getDisplayName().equals(tagName.getDisplayName())) {
AbstractFile fileCopy = file;
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null,
NbBundle.getMessage(this.getClass(),
"AddContentTagAction.tagExists",
fileCopy.getName(), tagName.getDisplayName()),
NbBundle.getMessage(this.getClass(),
"AddContentTagAction.cannotApplyTagErr"),
JOptionPane.WARNING_MESSAGE);
});
return;
}
}
tagsManager.addContentTag(file, tagName, comment);
Case.getCurrentCase().getServices().getTagsManager().addContentTag(file, tagName, comment);
} catch (TskCoreException ex) {
Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS
AbstractFile fileCopy = file;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment