mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-16 09:47:42 +00:00
Removed old Tags class from datamodel package
This commit is contained in:
parent
bee91a40ce
commit
d992fbe2f7
@ -24,7 +24,6 @@ import javax.swing.JOptionPane;
|
||||
import org.openide.util.Utilities;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.datamodel.Tags;
|
||||
import org.sleuthkit.datamodel.TagName;
|
||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
|
@ -24,7 +24,6 @@ import javax.swing.JOptionPane;
|
||||
import org.openide.util.Utilities;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.datamodel.Tags;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
import org.sleuthkit.datamodel.TagName;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
|
@ -98,8 +98,6 @@ public class RootContentChildren extends AbstractContentChildren<Object> {
|
||||
this.refreshKey(o);
|
||||
else if (o instanceof EmailExtracted)
|
||||
this.refreshKey(o);
|
||||
else if (o instanceof Tags)
|
||||
this.refreshKey(o);
|
||||
else if (o instanceof TagsNodeKey)
|
||||
this.refreshKey(o);
|
||||
else if (o instanceof ExtractedContent)
|
||||
|
@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2013 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.sleuthkit.autopsy.datamodel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.logging.Level;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||
import org.sleuthkit.datamodel.BlackboardAttribute;
|
||||
import org.sleuthkit.datamodel.BlackboardAttribute.ATTRIBUTE_TYPE;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
|
||||
public class Tags {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(Tags.class.getName());
|
||||
public static final String BOOKMARK_TAG_NAME = "Bookmark";
|
||||
|
||||
/**
|
||||
* Looks up the tag names associated with either a tagged artifact or a tag artifact.
|
||||
*
|
||||
* @param artifact The artifact
|
||||
* @return A set of unique tag names
|
||||
*/
|
||||
public static HashSet<String> getUniqueTagNamesForArtifact(BlackboardArtifact artifact) {
|
||||
return getUniqueTagNamesForArtifact(artifact.getArtifactID(), artifact.getArtifactTypeID());
|
||||
}
|
||||
|
||||
/**
|
||||
* Looks up the tag names associated with either a tagged artifact or a tag artifact.
|
||||
*
|
||||
* @param artifactID The ID of the artifact
|
||||
* @param artifactTypeID The ID of the artifact type
|
||||
* @return A set of unique tag names
|
||||
*/
|
||||
public static HashSet<String> getUniqueTagNamesForArtifact(long artifactID, int artifactTypeID) {
|
||||
HashSet<String> tagNames = new HashSet<>();
|
||||
|
||||
try {
|
||||
ArrayList<Long> tagArtifactIDs = new ArrayList<>();
|
||||
if (artifactTypeID == ARTIFACT_TYPE.TSK_TAG_FILE.getTypeID() ||
|
||||
artifactTypeID == ARTIFACT_TYPE.TSK_TAG_ARTIFACT.getTypeID()) {
|
||||
tagArtifactIDs.add(artifactID);
|
||||
} else {
|
||||
List<BlackboardArtifact> tags = Case.getCurrentCase().getSleuthkitCase().getBlackboardArtifacts(ATTRIBUTE_TYPE.TSK_TAGGED_ARTIFACT, artifactID);
|
||||
for (BlackboardArtifact tag : tags) {
|
||||
tagArtifactIDs.add(tag.getArtifactID());
|
||||
}
|
||||
}
|
||||
|
||||
for (Long tagArtifactID : tagArtifactIDs) {
|
||||
String whereClause = "WHERE artifact_id = " + tagArtifactID + " AND attribute_type_id = " + ATTRIBUTE_TYPE.TSK_TAG_NAME.getTypeID();
|
||||
List<BlackboardAttribute> attributes = Case.getCurrentCase().getSleuthkitCase().getMatchingAttributes(whereClause);
|
||||
for (BlackboardAttribute attr : attributes) {
|
||||
tagNames.add(attr.getValueString());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (TskCoreException ex) {
|
||||
logger.log(Level.SEVERE, "Failed to get tags for artifact " + artifactID, ex);
|
||||
}
|
||||
|
||||
return tagNames;
|
||||
}
|
||||
}
|
@ -24,7 +24,6 @@ import org.openide.nodes.ChildFactory;
|
||||
import org.openide.nodes.Children;
|
||||
import org.openide.nodes.Node;
|
||||
import org.openide.nodes.Sheet;
|
||||
import org.sleuthkit.autopsy.actions.GetTagNameAndCommentDialog;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.datamodel.TagName;
|
||||
|
@ -23,7 +23,7 @@ package org.sleuthkit.autopsy.datamodel;
|
||||
* RootContentChildren class. RootContentChildren is a NetBeans child node
|
||||
* factory built on top of the NetBeans Children.Keys class.
|
||||
*/
|
||||
public class TagsNodeKey implements AutopsyVisitableItem { // RJCTODO: Rename to Tags when old Tags class is deleted (for the sake of consistency). Add comments to similar classes.
|
||||
public class TagsNodeKey implements AutopsyVisitableItem {
|
||||
// Creation of a TagsNode object corresponding to a TagsNodeKey object is done
|
||||
// by a CreateAutopsyNodeVisitor dispatched from the AbstractContentChildren
|
||||
// override of Children.Keys<T>.createNodes().
|
||||
|
@ -35,7 +35,6 @@ import java.io.Writer;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
@ -45,7 +44,6 @@ import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.datamodel.ContentUtils.ExtractFscContentVisitor;
|
||||
import org.sleuthkit.autopsy.datamodel.Tags;
|
||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
import org.sleuthkit.datamodel.Image;
|
||||
@ -53,7 +51,6 @@ import org.sleuthkit.datamodel.SleuthkitCase;
|
||||
import org.sleuthkit.datamodel.TskCoreException;
|
||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
|
||||
import org.sleuthkit.datamodel.Content;
|
||||
import org.sleuthkit.datamodel.ContentTag;
|
||||
import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user