From e5d6d05fac553f697c598efd4a936628083bcb1b Mon Sep 17 00:00:00 2001 From: "U-BASIS\\oliver" Date: Thu, 7 Jan 2016 09:20:29 -0500 Subject: [PATCH 1/6] Fixed unhandled IllegalStateException by transferring it into a TskCoreException --- .../core/core.jar/org/netbeans/core/startup/Bundle.properties | 2 +- .../org/netbeans/core/windows/view/ui/Bundle.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties index a4c8f7f8cf..399e457755 100644 --- a/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties +++ b/branding/core/core.jar/org/netbeans/core/startup/Bundle.properties @@ -1,5 +1,5 @@ #Updated by build script -#Wed, 18 Nov 2015 20:51:12 -0500 +#Tue, 05 Jan 2016 16:31:20 -0500 LBL_splash_window_title=Starting Autopsy SPLASH_HEIGHT=314 SPLASH_WIDTH=538 diff --git a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties index 4792059f24..7d5d84b830 100644 --- a/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties +++ b/branding/modules/org-netbeans-core-windows.jar/org/netbeans/core/windows/view/ui/Bundle.properties @@ -1,4 +1,4 @@ #Updated by build script -#Wed, 18 Nov 2015 20:51:12 -0500 +#Tue, 05 Jan 2016 16:31:20 -0500 CTL_MainWindow_Title=Autopsy 4.0.0 CTL_MainWindow_Title_No_Project=Autopsy 4.0.0 From 32a6d5e392f52d9bcebaa7954aca33101429b5db Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Thu, 7 Jan 2016 09:33:10 -0500 Subject: [PATCH 2/6] Fixed unhandled IllegalStateException by throwing a TskCoreException --- .../autopsy/modules/filetypeid/FileTypeDetector.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java index a0da674723..e7b2a9e4da 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java @@ -45,7 +45,6 @@ public class FileTypeDetector { private static final int BUFFER_SIZE = 64 * 1024; private final byte buffer[] = new byte[BUFFER_SIZE]; private final List userDefinedFileTypes; - private static Blackboard blackboard; private static final Logger logger = Logger.getLogger(FileTypeDetector.class.getName()); /** @@ -174,7 +173,6 @@ public class FileTypeDetector { * @throws TskCoreException */ public String detect(AbstractFile file) throws TskCoreException { - blackboard = Case.getCurrentCase().getServices().getBlackboard(); // consistently mark non-regular files (refer TskData.TSK_FS_META_TYPE_ENUM), // 0 sized files, unallocated, and unused blocks (refer TskData.TSK_DB_FILES_TYPE_ENUM) // as octet-stream. @@ -247,11 +245,13 @@ public class FileTypeDetector { try { // index the artifact for keyword search - blackboard.indexArtifact(artifact); + Case.getCurrentCase().getServices().getBlackboard().indexArtifact(artifact); } catch (Blackboard.BlackboardException ex) { logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", artifact.getDisplayName()), ex); //NON-NLS MessageNotifyUtil.Notify.error( NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), artifact.getDisplayName()); + } catch (IllegalStateException ex) { + throw new TskCoreException("There is no current case."); } } return fileType.getMimeType(); From ef5f0db76c39dadc93933ef11e983f153aec3538 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Thu, 7 Jan 2016 10:35:40 -0500 Subject: [PATCH 3/6] Logged the error instead of throwing the exception. --- .../autopsy/modules/filetypeid/FileTypeDetector.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java index e7b2a9e4da..714c585c4d 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java @@ -251,7 +251,9 @@ public class FileTypeDetector { MessageNotifyUtil.Notify.error( NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), artifact.getDisplayName()); } catch (IllegalStateException ex) { - throw new TskCoreException("There is no current case."); + logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", artifact.getDisplayName()), ex); //NON-NLS + MessageNotifyUtil.Notify.error( + NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), artifact.getDisplayName()); } } return fileType.getMimeType(); From 6cc0a9d6a9be36d19cd6a1a42f768242b173d8e6 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Thu, 7 Jan 2016 15:30:30 -0500 Subject: [PATCH 4/6] Fixed error message to be more specific, not use NbBundle --- .../autopsy/modules/filetypeid/FileTypeDetector.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java index 714c585c4d..dfc92ef0de 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java +++ b/Core/src/org/sleuthkit/autopsy/modules/filetypeid/FileTypeDetector.java @@ -247,11 +247,11 @@ public class FileTypeDetector { // index the artifact for keyword search Case.getCurrentCase().getServices().getBlackboard().indexArtifact(artifact); } catch (Blackboard.BlackboardException ex) { - logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", artifact.getDisplayName()), ex); //NON-NLS + logger.log(Level.SEVERE, String.format("Unable to index blackboard artifact %d", artifact.getArtifactID()), ex); //NON-NLS MessageNotifyUtil.Notify.error( NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), artifact.getDisplayName()); } catch (IllegalStateException ex) { - logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", artifact.getDisplayName()), ex); //NON-NLS + logger.log(Level.SEVERE, String.format("Unable to index blackboard artifact %d", artifact.getArtifactID()), ex); MessageNotifyUtil.Notify.error( NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), artifact.getDisplayName()); } From be1b38dd99a06926f64e7ea1b120e83fdc3dc973 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Thu, 7 Jan 2016 17:00:23 -0500 Subject: [PATCH 5/6] Updated TypeFactory to test for new changes to the sleuthkit regarding handling ArtifactTypeIds rather thatn ArtifactTypes. --- .../org/sleuthkit/autopsy/datamodel/ExtractedContent.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java index d14a1fc912..30a0d43dbb 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java @@ -215,7 +215,11 @@ public class ExtractedContent implements AutopsyVisitableItem { protected boolean createKeys(List list) { if (skCase != null) { try { - List inUse = skCase.getBlackboardArtifactTypesInUse(); + List inUse = new ArrayList<>(); + List types = skCase.getArtifactTypesInUse(); + for (Integer i: types) { + inUse.add(BlackboardArtifact.ARTIFACT_TYPE.fromID(i)); + } inUse.removeAll(doNotShow); Collections.sort(inUse, new Comparator() { From 1be09d7ac77036e6f020f40674fc9957473497a3 Mon Sep 17 00:00:00 2001 From: Oliver Spohngellert Date: Fri, 8 Jan 2016 08:56:48 -0500 Subject: [PATCH 6/6] Changes to ExtractedContent to reflect updated sleuthkit --- Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java index 30a0d43dbb..4dd61aa643 100644 --- a/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java +++ b/Core/src/org/sleuthkit/autopsy/datamodel/ExtractedContent.java @@ -213,6 +213,7 @@ public class ExtractedContent implements AutopsyVisitableItem { @Override protected boolean createKeys(List list) { + //TEST COMMENT if (skCase != null) { try { List inUse = new ArrayList<>();