Make IngestManager.isRunningINteractiveyl public again

This commit is contained in:
Richard Cordovano 2015-06-18 11:54:40 -04:00
parent a37ed4814f
commit e641d14f7e
14 changed files with 192 additions and 181 deletions

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2013-2014 Basis Technology Corp. * Copyright 2013-2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -180,17 +180,16 @@ public class DeletedContent implements AutopsyVisitableItem {
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
String eventType = evt.getPropertyName(); String eventType = evt.getPropertyName();
// new file was added
if (eventType.equals(IngestManager.IngestModuleEvent.CONTENT_CHANGED.toString())) { if (eventType.equals(IngestManager.IngestModuleEvent.CONTENT_CHANGED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure
* handling the closing of cases is worked out. * until a different way of handling the closing of
* Currently, remote events may be received for a case * cases is worked out. Currently, remote events may be
* that is already closed. * received for a case that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
// new file was added
// @@@ COULD CHECK If the new file is deleted before notifying... // @@@ COULD CHECK If the new file is deleted before notifying...
update(); update();
} catch (IllegalStateException notUsed) { } catch (IllegalStateException notUsed) {
@ -202,10 +201,10 @@ public class DeletedContent implements AutopsyVisitableItem {
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString()) || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())
|| eventType.equals(Case.Events.DATA_SOURCE_ADDED.toString())) { || eventType.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure
* handling the closing of cases is worked out. * until a different way of handling the closing of
* Currently, remote events may be received for a case * cases is worked out. Currently, remote events may be
* that is already closed. * received for a case that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();

View File

@ -206,18 +206,19 @@ public class EmailExtracted implements AutopsyVisitableItem {
String eventType = evt.getPropertyName(); String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) { if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
/** /**
* Due to some unresolved issues with how cases are * Even with the check above, it is still possible that the
* closed, it is possible for the event to have a null * case will be closed in a different thread before this
* oldValue if the event is a remote event. * code executes. If that happens, it is possible for the
*/ * event to have a null oldValue.
*/
ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue(); ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue();
if (null != eventData && eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG) { if (null != eventData && eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG) {
emailResults.update(); emailResults.update();
@ -230,10 +231,10 @@ public class EmailExtracted implements AutopsyVisitableItem {
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString()) } else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) { || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
@ -243,8 +244,7 @@ public class EmailExtracted implements AutopsyVisitableItem {
* Case is closed, do nothing. * Case is closed, do nothing.
*/ */
} }
} } else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
// case was closed. Remove listeners so that we don't get called with a stale case handle // case was closed. Remove listeners so that we don't get called with a stale case handle
if (evt.getNewValue() == null) { if (evt.getNewValue() == null) {
removeNotify(); removeNotify();

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2014 Basis Technology Corp. * Copyright 2011-2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -126,7 +126,7 @@ public class ExtractedContent implements AutopsyVisitableItem {
* more specific form elsewhere in the tree. * more specific form elsewhere in the tree.
*/ */
private class TypeFactory extends ChildFactory.Detachable<BlackboardArtifact.ARTIFACT_TYPE> { private class TypeFactory extends ChildFactory.Detachable<BlackboardArtifact.ARTIFACT_TYPE> {
private final ArrayList<BlackboardArtifact.ARTIFACT_TYPE> doNotShow; private final ArrayList<BlackboardArtifact.ARTIFACT_TYPE> doNotShow = new ArrayList<>();
// maps the artifact type to its child node // maps the artifact type to its child node
private final HashMap<BlackboardArtifact.ARTIFACT_TYPE, TypeNode> typeNodeList = new HashMap<>(); private final HashMap<BlackboardArtifact.ARTIFACT_TYPE, TypeNode> typeNodeList = new HashMap<>();
@ -134,7 +134,6 @@ public class ExtractedContent implements AutopsyVisitableItem {
super(); super();
// these are shown in other parts of the UI tree // these are shown in other parts of the UI tree
doNotShow = new ArrayList<>();
doNotShow.add(BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO); doNotShow.add(BlackboardArtifact.ARTIFACT_TYPE.TSK_GEN_INFO);
doNotShow.add(BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG); doNotShow.add(BlackboardArtifact.ARTIFACT_TYPE.TSK_EMAIL_MSG);
doNotShow.add(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT); doNotShow.add(BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT);
@ -143,56 +142,53 @@ public class ExtractedContent implements AutopsyVisitableItem {
doNotShow.add(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT); doNotShow.add(BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT);
} }
private final PropertyChangeListener pcl = new PropertyChangeListener() { private final PropertyChangeListener pcl = (PropertyChangeEvent evt) -> {
@Override String eventType = evt.getPropertyName();
public void propertyChange(PropertyChangeEvent evt) { if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
String eventType = evt.getPropertyName(); /**
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) { * This is a stop gap measure until a different way of
* handling the closing of cases is worked out. Currently,
* remote events may be received for a case that is already
* closed.
*/
try {
Case.getCurrentCase();
/** /**
* This is a stop gap measure until a different way of * Due to some unresolved issues with how cases are
* handling the closing of cases is worked out. Currently, * closed, it is possible for the event to have a null
* remote events may be received for a case that is already * oldValue if the event is a remote event.
* closed.
*/ */
try { final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue();
Case.getCurrentCase(); if (null != event && doNotShow.contains(event.getArtifactType()) == false) {
/**
* Due to some unresolved issues with how cases are
* closed, it is possible for the event to have a null
* oldValue if the event is a remote event.
*/
final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue();
if (null != event && doNotShow.contains(event.getArtifactType()) == false) {
refresh(true);
}
} catch (IllegalStateException notUsed) {
/**
* Case is closed, do nothing.
*/
}
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
/**
* This is a stop gap measure until a different way of
* handling the closing of cases is worked out. Currently,
* remote events may be received for a case that is already
* closed.
*/
try {
Case.getCurrentCase();
refresh(true); refresh(true);
} catch (IllegalStateException notUsed) {
/**
* Case is closed, do nothing.
*/
} }
} catch (IllegalStateException notUsed) {
/**
* Case is closed, do nothing.
*/
} }
else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) { } else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
// case was closed. Remove listeners so that we don't get called with a stale case handle || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
if (evt.getNewValue() == null) { /**
removeNotify(); * This is a stop gap measure until a different way of
skCase = null; * handling the closing of cases is worked out. Currently,
} * remote events may be received for a case that is already
* closed.
*/
try {
Case.getCurrentCase();
refresh(true);
} catch (IllegalStateException notUsed) {
/**
* Case is closed, do nothing.
*/
}
}
else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
// case was closed. Remove listeners so that we don't get called with a stale case handle
if (evt.getNewValue() == null) {
removeNotify();
skCase = null;
} }
} }
}; };
@ -394,17 +390,18 @@ public class ExtractedContent implements AutopsyVisitableItem {
String eventType = evt.getPropertyName(); String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) { if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
/** /**
* Due to some unresolved issues with how cases are * Even with the check above, it is still possible that
* closed, it is possible for the event to have a null * the case will be closed in a different thread before
* oldValue if the event is a remote event. * this code executes. If that happens, it is possible
* for the event to have a null oldValue.
*/ */
final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue(); final ModuleDataEvent event = (ModuleDataEvent) evt.getOldValue();
if (null != event && event.getArtifactType() == type) { if (null != event && event.getArtifactType() == type) {
@ -418,10 +415,10 @@ public class ExtractedContent implements AutopsyVisitableItem {
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString()) } else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) { || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2013-2014 Basis Technology Corp. * Copyright 2013-2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -178,15 +178,15 @@ public class FileSize implements AutopsyVisitableItem {
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
String eventType = evt.getPropertyName(); String eventType = evt.getPropertyName();
// new file was added
if (eventType.equals(IngestManager.IngestModuleEvent.CONTENT_CHANGED.toString())) { if (eventType.equals(IngestManager.IngestModuleEvent.CONTENT_CHANGED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure
* handling the closing of cases is worked out. * until a different way of handling the closing of
* Currently, remote events may be received for a case * cases is worked out. Currently, remote events may be
* that is already closed. * received for a case that is already closed.
*/ */
try { try {
// new file was added
// @@@ could check the size here and only fire off updates if we know the file meets the min size criteria // @@@ could check the size here and only fire off updates if we know the file meets the min size criteria
Case.getCurrentCase(); Case.getCurrentCase();
update(); update();
@ -199,10 +199,10 @@ public class FileSize implements AutopsyVisitableItem {
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString()) || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())
|| eventType.equals(Case.Events.DATA_SOURCE_ADDED.toString())) { || eventType.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure
* handling the closing of cases is worked out. * until a different way of handling the closing of
* Currently, remote events may be received for a case * cases is worked out. Currently, remote events may be
* that is already closed. * received for a case that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2014 Basis Technology Corp. * Copyright 2011-2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -157,10 +157,10 @@ public class FileTypesNode extends DisplayableItemNode {
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString()) || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())
|| eventType.equals(Case.Events.DATA_SOURCE_ADDED.toString())) { || eventType.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure
* handling the closing of cases is worked out. * until a different way of handling the closing of
* Currently, remote events may be received for a case * cases is worked out. Currently, remote events may be
* that is already closed. * received for a case that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2014 Basis Technology Corp. * Copyright 2011-2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -180,13 +180,13 @@ public class HashsetHits implements AutopsyVisitableItem {
private final PropertyChangeListener pcl = new PropertyChangeListener() { private final PropertyChangeListener pcl = new PropertyChangeListener() {
@Override @Override
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())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
@ -207,10 +207,10 @@ public class HashsetHits implements AutopsyVisitableItem {
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString()) } else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) { || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
@ -220,8 +220,7 @@ public class HashsetHits implements AutopsyVisitableItem {
* Case is closed, do nothing. * Case is closed, do nothing.
*/ */
} }
} } else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
// case was closed. Remove listeners so that we don't get called with a stale case handle // case was closed. Remove listeners so that we don't get called with a stale case handle
if (evt.getNewValue() == null) { if (evt.getNewValue() == null) {
removeNotify(); removeNotify();

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011 Basis Technology Corp. * Copyright 2011-2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -177,17 +177,18 @@ public class InterestingHits implements AutopsyVisitableItem {
String eventType = evt.getPropertyName(); String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) { if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
/** /**
* Due to some unresolved issues with how cases are * Even with the check above, it is still possible that
* closed, it is possible for the event to have a null * the case will be closed in a different thread before
* oldValue if the event is a remote event. * this code executes. If that happens, it is possible
* for the event to have a null oldValue.
*/ */
ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue(); ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue();
if (null != eventData && (eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT if (null != eventData && (eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT
@ -202,10 +203,10 @@ public class InterestingHits implements AutopsyVisitableItem {
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString()) } else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) { || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2011-2014 Basis Technology Corp. * Copyright 2011-2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -248,17 +248,18 @@ public class KeywordHits implements AutopsyVisitableItem {
String eventType = evt.getPropertyName(); String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) { if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
/** /**
* Due to some unresolved issues with how cases are * Even with the check above, it is still possible that
* closed, it is possible for the event to have a null * the case will be closed in a different thread before
* oldValue if the event is a remote event. * this code executes. If that happens, it is possible
* for the event to have a null oldValue.
*/ */
ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue(); ModuleDataEvent eventData = (ModuleDataEvent) evt.getOldValue();
if (null != eventData && eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT) { if (null != eventData && eventData.getArtifactType() == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT) {
@ -272,10 +273,10 @@ public class KeywordHits implements AutopsyVisitableItem {
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString()) } else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString())
|| eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) { || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
@ -285,8 +286,7 @@ public class KeywordHits implements AutopsyVisitableItem {
* Case is closed, do nothing. * Case is closed, do nothing.
*/ */
} }
} } else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
else if (eventType.equals(Case.Events.CURRENT_CASE.toString())) {
// case was closed. Remove listeners so that we don't get called with a stale case handle // case was closed. Remove listeners so that we don't get called with a stale case handle
if (evt.getNewValue() == null) { if (evt.getNewValue() == null) {
removeNotify(); removeNotify();

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2014 Basis Technology Corp. * Copyright 2011-2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -99,10 +99,10 @@ public final class Reports implements AutopsyVisitableItem {
String eventType = evt.getPropertyName(); String eventType = evt.getPropertyName();
if (eventType.equals(Case.Events.REPORT_ADDED.toString())) { if (eventType.equals(Case.Events.REPORT_ADDED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure
* handling the closing of cases is worked out. * until a different way of handling the closing of
* Currently, remote events may be received for a case * cases is worked out. Currently, remote events may be
* that is already closed. * received for a case that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();

View File

@ -1,7 +1,7 @@
/* /*
* Autopsy Forensic Browser * Autopsy Forensic Browser
* *
* Copyright 2013 Basis Technology Corp. * Copyright 2011-2015 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org * Contact: carrier <at> sleuthkit <dot> org
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
@ -121,19 +121,20 @@ public class Tags implements AutopsyVisitableItem {
String eventType = evt.getPropertyName(); String eventType = evt.getPropertyName();
if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) { if (eventType.equals(IngestManager.IngestModuleEvent.DATA_ADDED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
/** /**
* There are two things to note here. It is possible for * There are two things to note here. * First, even with
* the event to have a null oldValue if the event is a * the check above, it is still possible that the case
* remote event and the case is closed after the above * will be closed in a different thread before this code
* call, but before this code executes. Second, the use * executes. If that happens, it is possible for the
* of deprecated artifact types here is explained by the * event to have a null oldValue. Second, the use of
* deprecated artifact types here is explained by the
* fact that in an ideal world, the TagsManager would * fact that in an ideal world, the TagsManager would
* fire tag-related events so that the tags tree would * fire tag-related events so that the tags tree would
* refresh. But, we haven't had a chance to add that, so * refresh. But, we haven't had a chance to add that, so
@ -154,10 +155,10 @@ public class Tags implements AutopsyVisitableItem {
} }
} else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString()) || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) { } else if (eventType.equals(IngestManager.IngestJobEvent.COMPLETED.toString()) || eventType.equals(IngestManager.IngestJobEvent.CANCELLED.toString())) {
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();

View File

@ -34,7 +34,6 @@ import java.util.logging.Level;
import java.util.prefs.PreferenceChangeEvent; import java.util.prefs.PreferenceChangeEvent;
import java.util.prefs.PreferenceChangeListener; import java.util.prefs.PreferenceChangeListener;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.JPanel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerManager;
@ -560,9 +559,10 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
} // if the image is added to the case } // if the image is added to the case
else if (changed.equals(Case.Events.DATA_SOURCE_ADDED.toString())) { else if (changed.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
/** /**
* This is a stop gap measure until a different way of handling the * Checking for a current case is a stop gap measure until a
* closing of cases is worked out. Currently, remote events may be * different way of handling the closing of cases is worked out.
* received for a case that is already closed. * Currently, remote events may be received for a case that is
* already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
@ -585,9 +585,10 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
|| changed.equals(IngestManager.IngestJobEvent.CANCELLED.toString()) || changed.equals(IngestManager.IngestJobEvent.CANCELLED.toString())
|| changed.equals(IngestManager.IngestModuleEvent.CONTENT_CHANGED.toString())) { || changed.equals(IngestManager.IngestModuleEvent.CONTENT_CHANGED.toString())) {
/** /**
* This is a stop gap measure until a different way of handling the * Checking for a current case is a stop gap measure until a
* closing of cases is worked out. Currently, remote events may be * different way of handling the closing of cases is worked out.
* received for a case that is already closed. * Currently, remote events may be received for a case that is
* already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();

View File

@ -254,10 +254,10 @@ class DateSearchFilter extends AbstractFileSearchFilter<DateSearchPanel> {
case DATA_SOURCE_ADDED: case DATA_SOURCE_ADDED:
case DATA_SOURCE_DELETED: case DATA_SOURCE_DELETED:
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();

View File

@ -362,7 +362,7 @@ public class IngestManager {
* ingest message box, NetBeans progress handles, etc. Running interactively * ingest message box, NetBeans progress handles, etc. Running interactively
* is the default. * is the default.
*/ */
synchronized boolean isRunningInteractively() { public synchronized boolean isRunningInteractively() {
return this.runInteractively; return this.runInteractively;
} }

View File

@ -680,10 +680,23 @@ public class TimeLineController {
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
switch (IngestManager.IngestModuleEvent.valueOf(evt.getPropertyName())) { switch (IngestManager.IngestModuleEvent.valueOf(evt.getPropertyName())) {
case FILE_DONE: case FILE_DONE:
Platform.runLater(() -> { /**
newEventsFlag.set(true); * Checking for a current case is a stop gap measure until a
}); * different way of handling the closing of cases is worked
break; * out. Currently, remote events may be received for a case
* that is already closed.
*/
try {
Case.getCurrentCase();
Platform.runLater(() -> {
newEventsFlag.set(true);
});
break;
} catch (IllegalStateException notUsed) {
/**
* Case is closed, do nothing.
*/
}
} }
} }
} }
@ -697,10 +710,10 @@ public class TimeLineController {
case CANCELLED: case CANCELLED:
case COMPLETED: case COMPLETED:
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();
@ -725,10 +738,10 @@ public class TimeLineController {
switch (Case.Events.valueOf(evt.getPropertyName())) { switch (Case.Events.valueOf(evt.getPropertyName())) {
case DATA_SOURCE_ADDED: case DATA_SOURCE_ADDED:
/** /**
* This is a stop gap measure until a different way of * Checking for a current case is a stop gap measure until a
* handling the closing of cases is worked out. Currently, * different way of handling the closing of cases is worked
* remote events may be received for a case that is already * out. Currently, remote events may be received for a case
* closed. * that is already closed.
*/ */
try { try {
Case.getCurrentCase(); Case.getCurrentCase();