mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 19:14:55 +00:00
Merge pull request #1684 from millmanorama/dont-abort-tagging
don't check for duplicate tags at all
This commit is contained in:
commit
718e13d32b
@ -19,7 +19,6 @@
|
|||||||
package org.sleuthkit.autopsy.actions;
|
package org.sleuthkit.autopsy.actions;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import javax.swing.JOptionPane;
|
import javax.swing.JOptionPane;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
@ -30,7 +29,6 @@ import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
|||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.Content;
|
import org.sleuthkit.datamodel.Content;
|
||||||
import org.sleuthkit.datamodel.ContentTag;
|
|
||||||
import org.sleuthkit.datamodel.TagName;
|
import org.sleuthkit.datamodel.TagName;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
|
|
||||||
@ -120,25 +118,8 @@ public class AddContentTagAction extends AddTagAction {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check if the same tag is being added for the same abstract file.
|
|
||||||
TagsManager tagsManager = Case.getCurrentCase().getServices().getTagsManager();
|
Case.getCurrentCase().getServices().getTagsManager().addContentTag(file, tagName, comment);
|
||||||
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);
|
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS
|
Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS
|
||||||
AbstractFile fileCopy = file;
|
AbstractFile fileCopy = file;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user