mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 18:17:43 +00:00
Merge pull request #1098 from sidheshenator/duplicate_tagging_isue
Duplicate tagging isue
This commit is contained in:
commit
d1ed1c526a
@ -19,15 +19,19 @@
|
|||||||
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 org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.Utilities;
|
import org.openide.util.Utilities;
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||||
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;
|
||||||
|
|
||||||
@ -109,8 +113,22 @@ public class AddContentTagAction extends AddTagAction {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// check if the same tag is being added for the same abstract file.
|
||||||
Case.getCurrentCase().getServices().getTagsManager().addContentTag(file, tagName, comment);
|
TagsManager tagsManager = Case.getCurrentCase().getServices().getTagsManager();
|
||||||
|
List<ContentTag> contentTagList = tagsManager.getContentTagsByContent(file);
|
||||||
|
for (ContentTag contentTag : contentTagList) {
|
||||||
|
if (contentTag.getName().getDisplayName().equals(tagName.getDisplayName())) {
|
||||||
|
JOptionPane.showMessageDialog(null,
|
||||||
|
NbBundle.getMessage(this.getClass(),
|
||||||
|
"AddContentTagAction.tagExists",
|
||||||
|
file.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
|
||||||
|
@ -24,6 +24,7 @@ AddContentTagAction.unableToTag.msg=Unable to tag {0}, not a regular file.
|
|||||||
AddContentTagAction.cannotApplyTagErr=Cannot Apply Tag
|
AddContentTagAction.cannotApplyTagErr=Cannot Apply Tag
|
||||||
AddContentTagAction.unableToTag.msg2=Unable to tag {0}.
|
AddContentTagAction.unableToTag.msg2=Unable to tag {0}.
|
||||||
AddContentTagAction.taggingErr=Tagging Error
|
AddContentTagAction.taggingErr=Tagging Error
|
||||||
|
AddContentTagAction.tagExists={0} has been tagged as {1}. Cannot reapply the same tag.
|
||||||
AddTagAction.quickTag=Quick Tag
|
AddTagAction.quickTag=Quick Tag
|
||||||
AddTagAction.noTags=No tags
|
AddTagAction.noTags=No tags
|
||||||
AddTagAction.newTag=New Tag...
|
AddTagAction.newTag=New Tag...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user