suppress warning about deprecated use of TSK_TAG_ARTIFACT/FILE in documented legacy/hack cases

This commit is contained in:
jmillman 2014-08-26 14:23:21 -04:00
parent e058f766ff
commit d0ce887e66
3 changed files with 14 additions and 4 deletions

View File

@ -48,6 +48,7 @@ import org.sleuthkit.datamodel.BlackboardArtifact;
* Derived classes should call this method any time a tag is created, updated * Derived classes should call this method any time a tag is created, updated
* or deleted outside of an actionPerformed() call. * or deleted outside of an actionPerformed() call.
*/ */
@SuppressWarnings("deprecation")
protected void refreshDirectoryTree() { protected void refreshDirectoryTree() {
/* Note: this is a hack. In an ideal world, TagsManager would fire events so /* Note: this is a hack. In an ideal world, TagsManager would fire events so

View File

@ -119,10 +119,16 @@ public class Tags implements AutopsyVisitableItem {
private final PropertyChangeListener pcl = new PropertyChangeListener() { private final PropertyChangeListener pcl = new PropertyChangeListener() {
@Override @Override
@SuppressWarnings("deprecation")
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
String eventType = evt.getPropertyName(); String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) { if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
if ((((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_ARTIFACT) || ((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_FILE) { /* Note: this is a hack. In an ideal world, TagsManager
* would fire events so that the directory tree would
* refresh. But, we haven't had a chance to add that so, we
* fire these events and the tree refreshes based on them. */
if ((((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_ARTIFACT)
|| ((ModuleDataEvent) evt.getOldValue()).getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_TAG_FILE) {
refresh(true); refresh(true);
tagResults.update(); tagResults.update();
} }

View File

@ -36,18 +36,17 @@ import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.HashSet;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import org.openide.filesystems.FileUtil; import org.openide.filesystems.FileUtil;
import org.openide.util.Exceptions;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.EscapeUtil;
@ -540,6 +539,7 @@ import org.sleuthkit.datamodel.TskData;
/** /**
* Make table for tagged files * Make table for tagged files
*/ */
@SuppressWarnings("deprecation")
private void makeContentTagsTables() { private void makeContentTagsTables() {
// Check for cancellaton. // Check for cancellaton.
removeCancelledTableReportModules(); removeCancelledTableReportModules();
@ -638,6 +638,7 @@ import org.sleuthkit.datamodel.TskData;
/** /**
* Generate the tables for the tagged artifacts * Generate the tables for the tagged artifacts
*/ */
@SuppressWarnings("deprecation")
private void makeBlackboardArtifactTagsTables() { private void makeBlackboardArtifactTagsTables() {
// Check for cancellaton. // Check for cancellaton.
removeCancelledTableReportModules(); removeCancelledTableReportModules();
@ -1686,7 +1687,8 @@ import org.sleuthkit.datamodel.TskData;
* @param artifactId * @param artifactId
* @return hash set of tag display names * @return hash set of tag display names
* @throws SQLException * @throws SQLException
*/ */
@SuppressWarnings("deprecation")
private HashSet<String> getUniqueTagNames(long artifactId) throws SQLException { private HashSet<String> getUniqueTagNames(long artifactId) throws SQLException {
HashSet<String> uniqueTagNames = new HashSet<>(); HashSet<String> uniqueTagNames = new HashSet<>();
ResultSet tagNameRows = skCase.runQuery("SELECT display_name, artifact_id FROM tag_names AS tn, blackboard_artifact_tags AS bat " + //NON-NLS ResultSet tagNameRows = skCase.runQuery("SELECT display_name, artifact_id FROM tag_names AS tn, blackboard_artifact_tags AS bat " + //NON-NLS
@ -1694,6 +1696,7 @@ import org.sleuthkit.datamodel.TskData;
while (tagNameRows.next()) { while (tagNameRows.next()) {
uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS uniqueTagNames.add(tagNameRows.getString("display_name")); //NON-NLS
} }
skCase.closeRunQuery(tagNameRows);
return uniqueTagNames; return uniqueTagNames;
} }