diff --git a/BUILDING.txt b/BUILDING.txt
index 6a53ff870a..1f928252e6 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -58,7 +58,7 @@ the needed places (i.e. '/usr/local').
3) For 32-bit targets, get GStreamer Setup. GStreamer is used to view video files.
You can either download it and install it or manually by unzipping the
version that is included in the 'thirdparty/gstreamer' folder. You
-will need the 'bin' and 'lib/gstreamer-1.0' folders to be in your
+will need the 'bin' and 'lib/gstreamer-0.10' folders to be in your
Windows PATH environment variable.
NOTE: This has not been fully tested in non-Windows environments
diff --git a/Core/nbproject/project.xml b/Core/nbproject/project.xml
index 3f1e5f172d..216a8e0f82 100644
--- a/Core/nbproject/project.xml
+++ b/Core/nbproject/project.xml
@@ -15,6 +15,22 @@
1.28.1
+
+ org.netbeans.api.progress.compat8
+
+
+
+ 1.46.1
+
+
+
+ org.netbeans.api.progress.nb
+
+
+
+ 1.46.1
+
+ org.netbeans.core
@@ -123,6 +139,22 @@
7.62.1
+
+ org.openide.filesystems.compat8
+
+
+
+ 9.7.1
+
+
+
+ org.openide.filesystems.nb
+
+
+
+ 9.7.1
+
+ org.openide.modules
@@ -163,6 +195,14 @@
8.15.1
+
+ org.openide.util.ui
+
+
+
+ 9.4.1
+
+ org.openide.windows
diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java
index 2111f3a554..28ce44b3c7 100755
--- a/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java
+++ b/Core/src/org/sleuthkit/autopsy/actions/AddBlackboardArtifactTagAction.java
@@ -1,15 +1,15 @@
/*
* Autopsy Forensic Browser
- *
- * Copyright 2013-2015 Basis Technology Corp.
+ *
+ * Copyright 2011-2016 Basis Technology Corp.
* Contact: carrier sleuthkit 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.
@@ -19,6 +19,7 @@
package org.sleuthkit.autopsy.actions;
import java.util.Collection;
+import java.util.HashSet;
import java.util.logging.Level;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
@@ -26,8 +27,8 @@ import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
-import org.sleuthkit.datamodel.TagName;
import org.sleuthkit.datamodel.BlackboardArtifact;
+import org.sleuthkit.datamodel.TagName;
import org.sleuthkit.datamodel.TskCoreException;
/**
@@ -38,7 +39,6 @@ public class AddBlackboardArtifactTagAction extends AddTagAction {
// This class is a singleton to support multi-selection of nodes, since
// org.openide.nodes.NodeOp.findActions(Node[] nodes) will only pick up an Action if every
// node in the array returns a reference to the same action object from Node.getActions(boolean).
-
private static AddBlackboardArtifactTagAction instance;
public static synchronized AddBlackboardArtifactTagAction getInstance() {
@@ -63,7 +63,14 @@ public class AddBlackboardArtifactTagAction extends AddTagAction {
@Override
protected void addTag(TagName tagName, String comment) {
- final Collection extends BlackboardArtifact> selectedArtifacts = Utilities.actionsGlobalContext().lookupAll(BlackboardArtifact.class);
+ /*
+ * The documentation for Lookup.lookupAll() explicitly says that the
+ * collection it returns may contain duplicates. Within this invocation
+ * of addTag(), we don't want to tag the same BlackboardArtifact more
+ * than once, so we dedupe the BlackboardArtifacts by stuffing them into
+ * a HashSet.
+ */
+ final Collection selectedArtifacts = new HashSet<>(Utilities.actionsGlobalContext().lookupAll(BlackboardArtifact.class));
new Thread(() -> {
for (BlackboardArtifact artifact : selectedArtifacts) {
diff --git a/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java b/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java
index d504600446..e32f9df902 100755
--- a/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java
+++ b/Core/src/org/sleuthkit/autopsy/actions/AddContentTagAction.java
@@ -1,15 +1,15 @@
/*
* Autopsy Forensic Browser
- *
- * Copyright 2013-2015 Basis Technology Corp.
+ *
+ * Copyright 2011-2016 Basis Technology Corp.
* Contact: carrier sleuthkit 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.
@@ -19,13 +19,13 @@
package org.sleuthkit.autopsy.actions;
import java.util.Collection;
+import java.util.HashSet;
import java.util.logging.Level;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.sleuthkit.autopsy.casemodule.Case;
-import org.sleuthkit.autopsy.casemodule.services.TagsManager;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content;
@@ -40,7 +40,6 @@ public class AddContentTagAction extends AddTagAction {
// This class is a singleton to support multi-selection of nodes, since
// org.openide.nodes.NodeOp.findActions(Node[] nodes) will only pick up an Action if every
// node in the array returns a reference to the same action object from Node.getActions(boolean).
-
private static AddContentTagAction instance;
public static synchronized AddContentTagAction getInstance() {
@@ -63,7 +62,13 @@ public class AddContentTagAction extends AddTagAction {
@Override
protected void addTag(TagName tagName, String comment) {
- final Collection extends AbstractFile> selectedFiles = Utilities.actionsGlobalContext().lookupAll(AbstractFile.class);
+ /*
+ * The documentation for Lookup.lookupAll() explicitly says that the
+ * collection it returns may contain duplicates. Within this invocation
+ * of addTag(), we don't want to tag the same AbstractFile more than
+ * once, so we dedupe the AbstractFiles by stuffing them into a HashSet.
+ */
+ final Collection selectedFiles = new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
new Thread(() -> {
for (AbstractFile file : selectedFiles) {
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java
index d5064e3b4e..70b10b0f0e 100644
--- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Blackboard.java
@@ -25,17 +25,30 @@ import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute;
+import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskDataException;
/**
- * Represents the blackboard, a place where artifacts and their attributes are
- * posted.
+ * A representation of the blackboard, a place where artifacts and their
+ * attributes are posted.
*
* NOTE: This API of this class is under development.
*/
public final class Blackboard implements Closeable {
+ private SleuthkitCase caseDb;
+
+ /**
+ * Constructs a representation of the blackboard, a place where artifacts
+ * and their attributes are posted.
+ *
+ * @param casedb The case database.
+ */
+ Blackboard(SleuthkitCase casedb) {
+ this.caseDb = casedb;
+ }
+
/**
* Indexes the text associated with the an artifact.
*
@@ -43,7 +56,10 @@ public final class Blackboard implements Closeable {
*
* @throws BlackboardException If there is a problem indexing the artifact.
*/
- public void indexArtifact(BlackboardArtifact artifact) throws BlackboardException {
+ public synchronized void indexArtifact(BlackboardArtifact artifact) throws BlackboardException {
+ if (null == caseDb) {
+ throw new BlackboardException("Blackboard has been closed");
+ }
KeywordSearchService searchService = Lookup.getDefault().lookup(KeywordSearchService.class);
if (null == searchService) {
throw new BlackboardException("Keyword search service not found");
@@ -67,12 +83,15 @@ public final class Blackboard implements Closeable {
* @throws BlackboardBlackboardException If there is a problem getting or
* adding the artifact type.
*/
- public BlackboardArtifact.Type getOrAddArtifactType(String typeName, String displayName) throws BlackboardException {
+ public synchronized BlackboardArtifact.Type getOrAddArtifactType(String typeName, String displayName) throws BlackboardException {
+ if (null == caseDb) {
+ throw new BlackboardException("Blackboard has been closed");
+ }
try {
- return Case.getCurrentCase().getSleuthkitCase().addBlackboardArtifactType(typeName, displayName);
+ return caseDb.addBlackboardArtifactType(typeName, displayName);
} catch (TskDataException typeExistsEx) {
try {
- return Case.getCurrentCase().getSleuthkitCase().getArtifactType(typeName);
+ return caseDb.getArtifactType(typeName);
} catch (TskCoreException ex) {
throw new BlackboardException("Failed to get or add artifact type", ex);
}
@@ -94,12 +113,15 @@ public final class Blackboard implements Closeable {
* @throws BlackboardBlackboardException If there is a problem getting or
* adding the attribute type.
*/
- public BlackboardAttribute.Type getOrAddAttributeType(String typeName, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType, String displayName) throws BlackboardException {
+ public synchronized BlackboardAttribute.Type getOrAddAttributeType(String typeName, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType, String displayName) throws BlackboardException {
+ if (null == caseDb) {
+ throw new BlackboardException("Blackboard has been closed");
+ }
try {
- return Case.getCurrentCase().getSleuthkitCase().addArtifactAttributeType(typeName, valueType, displayName);
+ return caseDb.addArtifactAttributeType(typeName, valueType, displayName);
} catch (TskDataException typeExistsEx) {
try {
- return Case.getCurrentCase().getSleuthkitCase().getAttributeType(typeName);
+ return caseDb.getAttributeType(typeName);
} catch (TskCoreException ex) {
throw new BlackboardException("Failed to get or add attribute type", ex);
}
@@ -109,13 +131,16 @@ public final class Blackboard implements Closeable {
}
/**
- * Cloese this blackboard and releases any resources associated with it.
- * @throws IOException
+ * Closes the blackboard.
+ *
+ * @throws IOException If there is a problem closing the blackboard.
*/
@Override
- public void close() throws IOException {
+ public synchronized void close() throws IOException {
+ caseDb = null;
}
+
/**
* A blackboard exception.
*/
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle.properties b/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle.properties
index 9353ca914b..1a3be9454f 100644
--- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle.properties
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle.properties
@@ -1,16 +1,3 @@
-FileManager.findFiles.exception.msg=Attempted to use FileManager after it was closed.
-FileManager.findFiles2.exception.msg=Attempted to use FileManager after it was closed.
-FileManager.findFiles3.exception.msg=Attempted to use FileManager after it was closed.
-FileManager.openFiles.exception.msg=Attempted to use FileManager after it was closed.
-FileManager.addDerivedFile.exception.msg=Attempted to use FileManager after it was closed.
-FileManager.addCarvedFile.exception.msg=Attempted to use FileManager after it was closed.
-FileManager.addLocalFilesDirs.exception.notReadable.msg=One of the local files/dirs to add is not readable\: {0}, aborting the process before any files added
-FileManager.addLocalFilesDirs.exception.cantAdd.msg=One of the local files/dirs could not be added\: {0}
-FileManager.addLocalFileSetRootDir.exception.errCreateDir.msg=Error creating local file set dir\: {0}
-FileManager.addLocalDirInt.exception.closed.msg=Attempted to use FileManager after it was closed.
-FileManager.addLocalDirInt.exception.doesntExist.msg=Attempted to add a local dir that does not exist\: {0}
-FileManager.addLocalDirInt.exception.notReadable.msg=Attempted to add a local dir that is not readable\: {0}
-FileManager.addLocalDirInt2.exception.closed.msg=Attempted to use FileManager after it was closed.
TagsManager.addContentTag.exception.beginByteOffsetOOR.msg=beginByteOffset \= {0} out of content size range (0 - {1})
TagsManager.addContentTag.exception.endByteOffsetOOR.msg=endByteOffset \= {0} out of content size range (0 - {1})
TagsManager.addContentTag.exception.endLTbegin.msg=endByteOffset < beginByteOffset
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle_ja.properties
index 956a5e6169..ca8ed3431a 100644
--- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle_ja.properties
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Bundle_ja.properties
@@ -1,16 +1,3 @@
-FileManager.findFiles.exception.msg=FileManager\u3092\u9589\u3058\u305f\u5f8c\u306b\u4f7f\u7528\u3092\u8a66\u307f\u307e\u3057\u305f\u3002
-FileManager.findFiles2.exception.msg=FileManager\u3092\u9589\u3058\u305f\u5f8c\u306b\u4f7f\u7528\u3092\u8a66\u307f\u307e\u3057\u305f\u3002
-FileManager.findFiles3.exception.msg=FileManager\u3092\u9589\u3058\u305f\u5f8c\u306b\u4f7f\u7528\u3092\u8a66\u307f\u307e\u3057\u305f\u3002
-FileManager.openFiles.exception.msg=FileManager\u3092\u9589\u3058\u305f\u5f8c\u306b\u4f7f\u7528\u3092\u8a66\u307f\u307e\u3057\u305f\u3002
-FileManager.addDerivedFile.exception.msg=FileManager\u3092\u9589\u3058\u305f\u5f8c\u306b\u4f7f\u7528\u3092\u8a66\u307f\u307e\u3057\u305f\u3002
-FileManager.addCarvedFile.exception.msg=FileManager\u3092\u9589\u3058\u305f\u5f8c\u306b\u4f7f\u7528\u3092\u8a66\u307f\u307e\u3057\u305f\u3002
-FileManager.addLocalFilesDirs.exception.notReadable.msg=\u8ffd\u52a0\u3059\u308b\u30ed\u30fc\u30ab\u30eb\u30d5\u30a1\u30a4\u30eb\uff0f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4e2d\u306b\u8aad\u307f\u53d6\u308c\u306a\u3044\u3082\u306e\u304c\uff11\u500b\u3042\u308a\u307e\u3059\uff1a{0}\u3001\u30d5\u30a1\u30a4\u30eb\u304c\u8ffd\u52a0\u3055\u308c\u308b\u524d\u306b\u51e6\u7406\u3092\u4e2d\u6b62\u3057\u307e\u3059
-FileManager.addLocalFilesDirs.exception.cantAdd.msg=\u30ed\u30fc\u30ab\u30eb\u30d5\u30a1\u30a4\u30eb\uff0f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\uff11\u500b\u306f\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\uff1a{0}
-FileManager.addLocalFileSetRootDir.exception.errCreateDir.msg=\u30ed\u30fc\u30ab\u30eb\u30d5\u30a1\u30a4\u30eb\u30bb\u30c3\u30c8\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u8d77\u3053\u308a\u307e\u3057\u305f\uff1a {0}
-FileManager.addLocalDirInt.exception.closed.msg=FileManager\u3092\u9589\u3058\u305f\u5f8c\u306b\u4f7f\u7528\u3092\u8a66\u307f\u307e\u3057\u305f\u3002
-FileManager.addLocalDirInt.exception.doesntExist.msg=\u5b58\u5728\u3057\u306a\u3044\u30ed\u30fc\u30ab\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u8ffd\u52a0\u3092\u8a66\u307f\u307e\u3057\u305f\: {0}
-FileManager.addLocalDirInt.exception.notReadable.msg=\u8aad\u307f\u53d6\u308a\u3067\u304d\u306a\u3044\u30ed\u30fc\u30ab\u30eb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u8ffd\u52a0\u3092\u8a66\u307f\u307e\u3057\u305f\: {0}
-FileManager.addLocalDirInt2.exception.closed.msg=FileManager\u3092\u9589\u3058\u305f\u5f8c\u306b\u4f7f\u7528\u3092\u8a66\u307f\u307e\u3057\u305f\u3002
TagsManager.addContentTag.exception.beginByteOffsetOOR.msg=beginByteOffset \= {0} \u30b3\u30f3\u30c6\u30f3\u30c4\u30b5\u30a4\u30ba\u7bc4\u56f2(0 - {1})\u306e\u5916\u3067\u3059
TagsManager.addContentTag.exception.endByteOffsetOOR.msg=endByteOffset \= {0} \u30b3\u30f3\u30c6\u30f3\u30c4\u30b5\u30a4\u30ba\u7bc4\u56f2(0 - {1})\u306e\u5916\u3067\u3059
TagsManager.addContentTag.exception.endLTbegin.msg=endByteOffset < beginByteOffset
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java
index 5b958cd5a7..b840634420 100644
--- a/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/FileManager.java
@@ -1,19 +1,19 @@
/*
*
* Autopsy Forensic Browser
- *
+ *
* Copyright 2011-2016 Basis Technology Corp.
- *
+ *
* Copyright 2012 42six Solutions.
* Contact: aebadirad 42six com
* Project Contact/Architect: carrier sleuthkit 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.
@@ -25,10 +25,9 @@ package org.sleuthkit.autopsy.casemodule.services;
import java.io.Closeable;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.List;
-import java.util.logging.Level;
import org.openide.util.NbBundle;
-import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.datamodel.VirtualDirectoryNode;
import org.sleuthkit.autopsy.ingest.IngestServices;
import org.sleuthkit.autopsy.ingest.ModuleContentEvent;
@@ -36,7 +35,6 @@ import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.DerivedFile;
import org.sleuthkit.datamodel.LayoutFile;
-import org.sleuthkit.datamodel.LocalFile;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.SleuthkitCase.CaseDbTransaction;
import org.sleuthkit.datamodel.TskCoreException;
@@ -45,58 +43,94 @@ import org.sleuthkit.datamodel.VirtualDirectory;
import org.sleuthkit.datamodel.CarvedFileContainer;
import org.sleuthkit.datamodel.LocalFilesDataSource;
import org.sleuthkit.datamodel.TskDataException;
+import org.apache.commons.lang3.StringUtils;
/**
- * Abstraction to facilitate access to localFiles and directories.
+ * A manager that provides methods for retrieving files from the current case
+ * and for adding local files, carved files, and derived files to the current
+ * case.
*/
public class FileManager implements Closeable {
- private SleuthkitCase tskCase;
- private static final Logger logger = Logger.getLogger(FileManager.class.getName());
- private volatile int curNumFileSets; //current number of filesets (root virt dir objects)
-
- public FileManager(SleuthkitCase tskCase) {
- this.tskCase = tskCase;
- init();
- }
-
+ private SleuthkitCase caseDb;
+
/**
- * initialize the file manager for the case
+ * Constructs a manager that provides methods for retrieving files from the
+ * current case and for adding local files, carved files, and derived files
+ * to the current case.
+ *
+ * @param caseDb The case database.
*/
- private synchronized void init() {
- //get the number of local file sets in db
- List virtRoots;
- curNumFileSets = 0;
- try {
- virtRoots = tskCase.getVirtualDirectoryRoots();
- for (VirtualDirectory vd : virtRoots) {
- if (vd.getName().startsWith(VirtualDirectoryNode.LOGICAL_FILE_SET_PREFIX)) {
- ++curNumFileSets;
- }
- }
- } catch (TskCoreException ex) {
- logger.log(Level.SEVERE, "Error initializing FileManager and getting number of local file sets"); //NON-NLS
- }
-
+ public FileManager(SleuthkitCase caseDb) {
+ this.caseDb = caseDb;
}
/**
- * Finds a set of localFiles that meets the name criteria in all data
- * sources in the current case.
+ * Finds all files with types that match one of a collection of MIME types.
*
- * @param fileName Pattern of the name of the file or directory to match
- * (case insensitive, used in LIKE SQL statement).
+ * @param mimeTypes The MIME types.
*
- * @return a list of AbstractFile for localFiles/directories whose name
- * matches the given fileName
+ * @return The files.
+ *
+ * @throws TskCoreException If there is a problem querying the case
+ * database.
+ */
+ public synchronized List findFilesByMimeType(Collection mimeTypes) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
+ }
+ return caseDb.findAllFilesWhere(createFileTypeInCondition(mimeTypes));
+ }
+
+ /**
+ * Finds all files in a given data source (image, local/logical files set,
+ * etc.) with types that match one of a collection of MIME types.
+ *
+ * @param dataSource The data source.
+ * @param mimeTypes The MIME types.
+ *
+ * @return The files.
+ *
+ * @throws TskCoreException If there is a problem querying the case
+ * database.
+ */
+ public synchronized List findFilesByMimeType(Content dataSource, Collection mimeTypes) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
+ }
+ return caseDb.findAllFilesWhere("data_source_obj_id = " + dataSource.getId() + " AND " + createFileTypeInCondition(mimeTypes));
+ }
+
+ /**
+ * Converts a list of MIME types into an SQL "mime_type IN" condition.
+ *
+ * @param mimeTypes The MIIME types.
+ *
+ * @return The condition string.
+ */
+ private static String createFileTypeInCondition(Collection mimeTypes) {
+ String types = StringUtils.join(mimeTypes, "', '");
+ return "mime_type IN ('" + types + "')";
+ }
+
+ /**
+ * Finds all files and directories with a given file name. The name search
+ * is for full or partial matches and is case insensitive (a case
+ * insensitive SQL LIKE clause is used to query the case database).
+ *
+ * @param fileName The full or partial file name.
+ *
+ * @return The matching files and directories.
+ *
+ * @throws TskCoreException if there is a problem querying the case
+ * database.
*/
public synchronized List findFiles(String fileName) throws TskCoreException {
- List result = new ArrayList<>();
-
- if (tskCase == null) {
- throw new TskCoreException(NbBundle.getMessage(this.getClass(), "FileManager.findFiles.exception.msg"));
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
}
- List dataSources = tskCase.getRootObjects();
+ List result = new ArrayList<>();
+ List dataSources = caseDb.getRootObjects();
for (Content dataSource : dataSources) {
result.addAll(findFiles(dataSource, fileName));
}
@@ -104,113 +138,122 @@ public class FileManager implements Closeable {
}
/**
- * Finds a set of localFiles that meets the name criteria in all data
- * sources in the current case.
+ * Finds all files and directories with a given file name and parent file or
+ * directory name. The name searches are for full or partial matches and are
+ * case insensitive (a case insensitive SQL LIKE clause is used to query the
+ * case database).
*
- * @param fileName Pattern of the name of the file or directory to match
- * (case insensitive, used in LIKE SQL statement).
- * @param dirName Pattern of the name of the parent directory to use as the
- * root of the search (case insensitive, used in LIKE SQL
- * statement).
+ * @param fileName The full or partial file name.
+ * @param parentName The full or partial parent file or directory name.
*
- * @return a list of AbstractFile for localFiles/directories whose name
- * matches fileName and whose parent directory contains dirName.
+ * @return The matching files and directories.
+ *
+ * @throws TskCoreException if there is a problem querying the case
+ * database.
*/
- public synchronized List findFiles(String fileName, String dirName) throws TskCoreException {
- List result = new ArrayList<>();
-
- if (tskCase == null) {
- throw new TskCoreException(NbBundle.getMessage(this.getClass(), "FileManager.findFiles2.exception.msg"));
+ public synchronized List findFiles(String fileName, String parentName) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
}
- List dataSources = tskCase.getRootObjects();
+ List result = new ArrayList<>();
+ List dataSources = caseDb.getRootObjects();
for (Content dataSource : dataSources) {
- result.addAll(findFiles(dataSource, fileName, dirName));
+ result.addAll(findFiles(dataSource, fileName, parentName));
}
return result;
}
/**
- * Finds a set of localFiles that meets the name criteria in all data
- * sources in the current case.
+ * Finds all files and directories with a given file name and parent file or
+ * directory. The name search is for full or partial matches and is case
+ * insensitive (a case insensitive SQL LIKE clause is used to query the case
+ * database).
*
- * @param fileName Pattern of the name of the file or directory to match
- * (case insensitive, used in LIKE SQL statement).
- * @param parentFile Object of root/parent directory to restrict search to.
+ * @param fileName The full or partial file name.
+ * @param parent The parent file or directory.
*
- * @return a list of AbstractFile for localFiles/directories whose name
- * matches fileName and that were inside a directory described by
- * parentFsContent.
+ * @return The matching files and directories.
+ *
+ * @throws TskCoreException if there is a problem querying the case
+ * database.
*/
- public synchronized List findFiles(String fileName, AbstractFile parentFile) throws TskCoreException {
- List result = new ArrayList<>();
-
- if (tskCase == null) {
- throw new TskCoreException(NbBundle.getMessage(this.getClass(), "FileManager.findFiles3.exception.msg"));
+ public synchronized List findFiles(String fileName, AbstractFile parent) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
}
- List dataSources = tskCase.getRootObjects();
+ List result = new ArrayList<>();
+ List dataSources = caseDb.getRootObjects();
for (Content dataSource : dataSources) {
- result.addAll(findFiles(dataSource, fileName, parentFile));
+ result.addAll(findFiles(dataSource, fileName, parent));
}
return result;
}
/**
- * Finds a set of localFiles that meets the name criteria.
+ * Finds all files and directories with a given file name in a given data
+ * source (image, local/logical files set, etc.). The name search is for
+ * full or partial matches and is case insensitive (a case insensitive SQL
+ * LIKE clause is used to query the case database).
*
- * @param dataSource Root data source to limit search results to (Image,
- * VirtualDirectory, etc.).
- * @param fileName Pattern of the name of the file or directory to match
- * (case insensitive, used in LIKE SQL statement).
+ * @param dataSource The data source.
+ * @param fileName The full or partial file name.
*
- * @return a list of AbstractFile for localFiles/directories whose name
- * matches the given fileName
+ * @return The matching files and directories.
+ *
+ * @throws TskCoreException if there is a problem querying the case
+ * database.
*/
public synchronized List findFiles(Content dataSource, String fileName) throws TskCoreException {
- if (tskCase == null) {
- throw new TskCoreException(NbBundle.getMessage(this.getClass(), "FileManager.findFiles.exception.msg"));
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
}
- return tskCase.findFiles(dataSource, fileName);
+ return caseDb.findFiles(dataSource, fileName);
}
/**
- * Finds a set of localFiles that meets the name criteria.
+ * Finds all files and directories with a given file name and parent file or
+ * directory name in a given data source (image, local/logical files set,
+ * etc.). The name searches are for full or partial matches and are case
+ * insensitive (a case insensitive SQL LIKE clause is used to query the case
+ * database).
*
- * @param dataSource Root data source to limit search results to (Image,
- * VirtualDirectory, etc.).
- * @param fileName Pattern of the name of the file or directory to match
- * (case insensitive, used in LIKE SQL statement).
- * @param dirName Pattern of the name of the parent directory to use as
- * the root of the search (case insensitive, used in LIKE
- * SQL statement).
+ * @param dataSource The data source.
+ * @param fileName The full or partial file name.
+ * @param parentName The full or partial parent file or directory name.
*
- * @return a list of AbstractFile for localFiles/directories whose name
- * matches fileName and whose parent directory contains dirName.
+ * @return The matching files and directories.
+ *
+ * @throws TskCoreException if there is a problem querying the case
+ * database.
*/
- public synchronized List findFiles(Content dataSource, String fileName, String dirName) throws TskCoreException {
- if (tskCase == null) {
- throw new TskCoreException(NbBundle.getMessage(this.getClass(), "FileManager.findFiles2.exception.msg"));
+ public synchronized List findFiles(Content dataSource, String fileName, String parentName) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
}
- return tskCase.findFiles(dataSource, fileName, dirName);
+ return caseDb.findFiles(dataSource, fileName, parentName);
}
/**
- * Finds a set of localFiles that meets the name criteria.
+ * Finds all files and directories with a given file name and given parent
+ * file or directory in a given data source (image, local/logical files set,
+ * etc.). The name search is for full or partial matches and is case
+ * insensitive (a case insensitive SQL LIKE clause is used to query the case
+ * database).
*
- * @param dataSource Root data source to limit search results to (Image,
- * VirtualDirectory, etc.).
- * @param fileName Pattern of the name of the file or directory to match
- * (case insensitive, used in LIKE SQL statement).
- * @param parentFile Object of root/parent directory to restrict search to.
+ * @param dataSource The data source.
+ * @param fileName The full or partial file name.
+ * @param parent The parent file or directory.
*
- * @return a list of AbstractFile for localFiles/directories whose name
- * matches fileName and that were inside a directory described by
- * parentFsContent.
+ * @return The matching files and directories.
+ *
+ * @throws TskCoreException if there is a problem querying the case
+ * database.
*/
- public synchronized List findFiles(Content dataSource, String fileName, AbstractFile parentFile) throws TskCoreException {
- if (tskCase == null) {
- throw new TskCoreException(NbBundle.getMessage(this.getClass(), "FileManager.findFiles3.exception.msg"));
+ public synchronized List findFiles(Content dataSource, String fileName, AbstractFile parent) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
}
- return findFiles(dataSource, fileName, parentFile.getName());
+ return findFiles(dataSource, fileName, parent.getName());
}
/**
@@ -221,173 +264,127 @@ public class FileManager implements Closeable {
*
* @return a list of AbstractFile that have the given file path.
*/
+ /**
+ * Finds all files and directories with a given file name and path in a
+ * given data source (image, local/logical files set, etc.). The name search
+ * is for full or partial matches and is case insensitive (a case
+ * insensitive SQL LIKE clause is used to query the case database). Any path
+ * components at the volume level and above are removed for the search.
+ *
+ * @param dataSource The data source.
+ * @param fileName The full or partial file name.
+ * @param filePath The file path (path components volume at the volume
+ * level or above will be removed).
+ *
+ * @return The matching files and directories.
+ *
+ * @throws TskCoreException if there is a problem querying the case
+ * database.
+ */
public synchronized List openFiles(Content dataSource, String filePath) throws TskCoreException {
- if (tskCase == null) {
- throw new TskCoreException(NbBundle.getMessage(this.getClass(), "FileManager.openFiles.exception.msg"));
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
}
- return tskCase.openFiles(dataSource, filePath);
+ return caseDb.openFiles(dataSource, filePath);
}
/**
- * Creates a derived file, adds it to the database and returns it.
+ * Adds a derived file to the case.
*
- * @param fileName file name the derived file
- * @param localPath local path of the derived file, including the file
- * name. The path is relative to the case folder.
- * @param size size of the derived file in bytes
- * @param ctime
- * @param crtime
- * @param atime
- * @param mtime
- * @param isFile whether a file or directory, true if a file
- * @param parentFile the parent file object this the new file was
- * derived from, either a fs file or parent derived
- * file/dikr\\r
- * @param rederiveDetails details needed to re-derive file (will be specific
- * to the derivation method), currently unused
- * @param toolName name of derivation method/tool, currently unused
- * @param toolVersion version of derivation method/tool, currently
- * unused
- * @param otherDetails details of derivation method/tool, currently
- * unused
+ * @param fileName The name of the file.
+ * @param localPath The local path of the file, relative to the case
+ * folder and including the file name.
+ * @param size The size of the file in bytes.
+ * @param ctime The change time of the file.
+ * @param crtime The create time of the file
+ * @param atime The accessed time of the file.
+ * @param mtime The modified time of the file.
+ * @param isFile True if a file, false if a directory.
+ * @param parentFile The parent file from which the file was derived.
+ * @param rederiveDetails The details needed to re-derive file (will be
+ * specific to the derivation method), currently
+ * unused.
+ * @param toolName The name of the derivation method or tool,
+ * currently unused.
+ * @param toolVersion The version of the derivation method or tool,
+ * currently unused.
+ * @param otherDetails Other details of the derivation method or tool,
+ * currently unused.
*
- * @return newly created derived file object added to the database
- *
- * @throws TskCoreException exception thrown if the object creation failed
- * due to a critical system error or of the file
- * manager has already been closed
+ * @return A DerivedFile object representing the derived file.
*
+ * @throws TskCoreException if there is a problem adding the file to the
+ * case database.
*/
- public synchronized DerivedFile addDerivedFile(String fileName, String localPath, long size,
+ public synchronized DerivedFile addDerivedFile(String fileName,
+ String localPath,
+ long size,
long ctime, long crtime, long atime, long mtime,
- boolean isFile, AbstractFile parentFile,
+ boolean isFile,
+ AbstractFile parentFile,
String rederiveDetails, String toolName, String toolVersion, String otherDetails) throws TskCoreException {
-
- if (tskCase == null) {
- throw new TskCoreException(NbBundle.getMessage(this.getClass(), "FileManager.addDerivedFile.exception.msg"));
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
}
-
- return tskCase.addDerivedFile(fileName, localPath, size,
+ return caseDb.addDerivedFile(fileName, localPath, size,
ctime, crtime, atime, mtime,
isFile, parentFile, rederiveDetails, toolName, toolVersion, otherDetails);
}
/**
- * Adds a carved file to the VirtualDirectory '$CarvedFiles' in the volume
- * or image given by systemId.
+ * Adds a carved file to the '$CarvedFiles' virtual directory of a data
+ * source, volume or file system.
*
- * @param carvedFileName the name of the carved file (containing appropriate
- * extension)
- * @param carvedFileSize size of the carved file to add
- * @param systemId the ID of the parent volume or file system
- * @param sectors a list of SectorGroups giving this sectors that
- * make up this carved file.
+ * @param fileName The name of the file.
+ * @param fileSize The size of the file.
+ * @param parentObjId The object id of the parent data source, volume or
+ * file system.
+ * @param layout A list of the offsets and sizes that gives the layout
+ * of the file within its parent.
*
- * @throws TskCoreException exception thrown when critical tsk error
- * occurred and carved file could not be added
+ * @return A LayoutFile object representing the carved file.
+ *
+ * @throws TskCoreException if there is a problem adding the file to the
+ * case database.
*/
- public synchronized LayoutFile addCarvedFile(String carvedFileName, long carvedFileSize,
- long systemId, List sectors) throws TskCoreException {
-
- if (tskCase == null) {
- throw new TskCoreException(NbBundle.getMessage(this.getClass(), "FileManager.addCarvedFile.exception.msg"));
+ public synchronized LayoutFile addCarvedFile(String fileName, long fileSize, long parentObjId, List layout) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
}
-
- return tskCase.addCarvedFile(carvedFileName, carvedFileSize, systemId, sectors);
+ return caseDb.addCarvedFile(fileName, fileSize, parentObjId, layout);
}
/**
- * Adds a collection of carved localFiles to the VirtualDirectory
- * '$CarvedFiles' in the volume or image given by systemId. Creates
- * $CarvedFiles if it does not exist already.
+ * Adds a collection of carved files to the '$CarvedFiles' virtual directory
+ * of a data source, volume or file system.
*
- * @param filesToAdd a list of CarvedFileContainer localFiles to add as
- * carved localFiles
+ * @param A collection of CarvedFileContainer objects, one per carved file,
+ * all of which must have the same parent object id.
*
- * @return List This is a list of the localFiles added to the
- * database
+ * @return A collection of LayoutFile object representing the carved files.
*
- * @throws org.sleuthkit.datamodel.TskCoreException
+ * @throws TskCoreException if there is a problem adding the files to the
+ * case database.
*/
- public List addCarvedFiles(List filesToAdd) throws TskCoreException {
- if (tskCase == null) {
- throw new TskCoreException(NbBundle.getMessage(this.getClass(), "FileManager.addCarvedFile.exception.msg"));
- } else {
- return tskCase.addCarvedFiles(filesToAdd);
+ public synchronized List addCarvedFiles(List filesToAdd) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
}
+ return caseDb.addCarvedFiles(filesToAdd);
}
/**
- *
- * Interface for receiving notifications on folders being added via a
- * callback
+ * Interface for receiving a notification for each file or directory added
+ * to the case database by a FileManager add files operation.
*/
public interface FileAddProgressUpdater {
/**
- * Called when new folders has been added
+ * Called after a file or directory is added to the case database.
*
- * @param newFile the file/folder added to the Case
+ * @param An AbstractFile represeting the added file or directory.
*/
- public void fileAdded(AbstractFile newFile);
- }
-
- /**
- * Add a set of local/logical localFiles and dirs.
- *
- * @param localAbsPaths list of absolute paths to local localFiles and
- * dirs
- * @param addProgressUpdater notifier to receive progress notifications on
- * folders added, or null if not used
- *
- * @return file set root VirtualDirectory contained containing all
- * AbstractFile objects added
- *
- * @throws TskCoreException exception thrown if the object creation failed
- * due to a critical system error or of the file
- * manager has already been closed. There is no
- * "revert" logic if one of the additions fails.
- * The addition stops with the first error
- * encountered.
- */
- public synchronized VirtualDirectory addLocalFilesDirs(List localAbsPaths, FileAddProgressUpdater addProgressUpdater) throws TskCoreException {
- List rootsToAdd;
- try {
- rootsToAdd = getFilesAndDirectories(localAbsPaths);
- } catch (TskDataException ex) {
- throw new TskCoreException(ex.getLocalizedMessage(), ex);
- }
-
- CaseDbTransaction trans = tskCase.beginTransaction();
- // make a virtual top-level directory for this set of localFiles/dirs
- final VirtualDirectory fileSetRootDir = addLocalFileSetRootDir(trans);
-
- try {
- // recursively add each item in the set
- for (java.io.File localRootToAdd : rootsToAdd) {
- AbstractFile localFileAdded = addLocalDirInt(trans, fileSetRootDir, localRootToAdd, addProgressUpdater);
-
- if (localFileAdded == null) {
- String msg = NbBundle
- .getMessage(this.getClass(), "FileManager.addLocalFilesDirs.exception.cantAdd.msg",
- localRootToAdd.getAbsolutePath());
- logger.log(Level.SEVERE, msg);
- throw new TskCoreException(msg);
- } else {
- //added.add(localFileAdded);
- //send new content event
- //for now reusing ingest events, in future this will be replaced by datamodel / observer sending out events
- // @@@ Is this the right place for this? A directory tree refresh will be triggered, so this may be creating a race condition
- // since the transaction is not yet committed.
- IngestServices.getInstance().fireModuleContentEvent(new ModuleContentEvent(localFileAdded));
- }
- }
-
- trans.commit();
- } catch (TskCoreException ex) {
- trans.rollback();
- }
- return fileSetRootDir;
+ void fileAdded(AbstractFile newFile);
}
/**
@@ -419,20 +416,27 @@ public class FileManager implements Closeable {
* directory that does not exist or cannot be read.
*/
public synchronized LocalFilesDataSource addLocalFilesDataSource(String deviceId, String rootVirtualDirectoryName, String timeZone, List localFilePaths, FileAddProgressUpdater progressUpdater) throws TskCoreException, TskDataException {
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
+ }
List localFiles = getFilesAndDirectories(localFilePaths);
CaseDbTransaction trans = null;
try {
String rootDirectoryName = rootVirtualDirectoryName;
- int newLocalFilesSetCount = curNumFileSets + 1;
- if (rootVirtualDirectoryName.isEmpty()) {
- rootDirectoryName = VirtualDirectoryNode.LOGICAL_FILE_SET_PREFIX + newLocalFilesSetCount;
+ if (rootDirectoryName.isEmpty()) {
+ rootDirectoryName = generateFilesDataSourceName(caseDb);
}
- trans = tskCase.beginTransaction();
- LocalFilesDataSource dataSource = tskCase.addLocalFilesDataSource(deviceId, rootDirectoryName, timeZone, trans);
+
+ /*
+ * Add the root virtual directory and its local/logical file
+ * children to the case database.
+ */
+ trans = caseDb.beginTransaction();
+ LocalFilesDataSource dataSource = caseDb.addLocalFilesDataSource(deviceId, rootDirectoryName, timeZone, trans);
VirtualDirectory rootDirectory = dataSource.getRootDirectory();
List filesAdded = new ArrayList<>();
for (java.io.File localFile : localFiles) {
- AbstractFile fileAdded = addLocalDirInt(trans, rootDirectory, localFile, progressUpdater);
+ AbstractFile fileAdded = addLocalFile(trans, rootDirectory, localFile, progressUpdater);
if (null != fileAdded) {
filesAdded.add(fileAdded);
} else {
@@ -440,13 +444,16 @@ public class FileManager implements Closeable {
}
}
trans.commit();
- if (rootVirtualDirectoryName.isEmpty()) {
- curNumFileSets = newLocalFilesSetCount;
- }
+
+ /*
+ * Publish content added events for the added files and directories.
+ */
for (AbstractFile fileAdded : filesAdded) {
IngestServices.getInstance().fireModuleContentEvent(new ModuleContentEvent(fileAdded));
}
+
return dataSource;
+
} catch (TskCoreException ex) {
if (null != trans) {
trans.rollback();
@@ -455,6 +462,34 @@ public class FileManager implements Closeable {
}
}
+ /**
+ * Generates a name for the root virtual directory for the data source.
+ *
+ * NOTE: Although this method is guarded by the file manager's monitor,
+ * there is currently a minimal chance of default name duplication for
+ * multi-user cases with multiple FileManagers running on different nodes.
+ *
+ * @return A default name for a local/logical files data source of the form:
+ * LogicalFileSet[N].
+ *
+ * @throws TskCoreException If there is a problem querying the case
+ * database.
+ */
+ private static synchronized String generateFilesDataSourceName(SleuthkitCase caseDb) throws TskCoreException {
+ int localFileDataSourcesCounter = 0;
+ try {
+ List localFileDataSources = caseDb.getVirtualDirectoryRoots();
+ for (VirtualDirectory vd : localFileDataSources) {
+ if (vd.getName().startsWith(VirtualDirectoryNode.LOGICAL_FILE_SET_PREFIX)) {
+ ++localFileDataSourcesCounter;
+ }
+ }
+ return VirtualDirectoryNode.LOGICAL_FILE_SET_PREFIX + (localFileDataSourcesCounter + 1);
+ } catch (TskCoreException ex) {
+ throw new TskCoreException("Error querying for existing local file data sources with defualt names", ex);
+ }
+ }
+
/**
* Converts a list of local/logical file and/or directory paths to a list of
* file objects.
@@ -472,7 +507,7 @@ public class FileManager implements Closeable {
for (String path : localFilePaths) {
java.io.File localFile = new java.io.File(path);
if (!localFile.exists() || !localFile.canRead()) {
- throw new TskDataException(NbBundle.getMessage(this.getClass(), "FileManager.addLocalFilesDirs.exception.notReadable.msg", localFile.getAbsolutePath()));
+ throw new TskDataException(String.format("File at %s does not exist or cannot be read", localFile.getAbsolutePath()));
}
localFiles.add(localFile);
}
@@ -480,130 +515,89 @@ public class FileManager implements Closeable {
}
/**
- * Adds a new virtual directory root object with FileSet X name and
- * consecutive sequence number characteristic to every add operation
- *
- * @return the virtual dir root container created
- *
- * @throws TskCoreException
- */
- private VirtualDirectory addLocalFileSetRootDir(CaseDbTransaction trans) throws TskCoreException {
-
- VirtualDirectory created = null;
-
- int newFileSetCount = curNumFileSets + 1;
- final String fileSetName = VirtualDirectoryNode.LOGICAL_FILE_SET_PREFIX + newFileSetCount;
-
- try {
- created = tskCase.addVirtualDirectory(0, fileSetName, trans);
- curNumFileSets = newFileSetCount;
- } catch (TskCoreException ex) {
- String msg = NbBundle
- .getMessage(this.getClass(), "FileManager.addLocalFileSetRootDir.exception.errCreateDir.msg",
- fileSetName);
- logger.log(Level.SEVERE, msg, ex);
- throw new TskCoreException(msg, ex);
- }
-
- return created;
- }
-
- /**
- * Helper (internal) method to recursively add contents of a folder. Node
- * passed in can be a file or directory. Children of directories are added.
+ * Adds a file or directory of logical/local files data source to the case
+ * database, recursively adding the contents of directories.
*
* @param trans A case database transaction.
- * @param parentVd Dir that is the parent of localFile
- * @param localFile File/Dir that we are adding
+ * @param parentDirectory The root virtual direcotry of the data source.
+ * @param localFile The local/logical file or directory.
* @param addProgressUpdater notifier to receive progress notifications on
* folders added, or null if not used
*
* @returns File object of file added or new virtualdirectory for the
* directory.
- * @throws TskCoreException
+ * @param progressUpdater Called after each file/directory is added to
+ * the case database.
+ *
+ * @return An AbstractFile representation of the local/logical file.
+ *
+ * @throws TskCoreException If there is a problem completing a database
+ * operation.
*/
- private AbstractFile addLocalDirInt(CaseDbTransaction trans, VirtualDirectory parentVd,
- java.io.File localFile, FileAddProgressUpdater addProgressUpdater) throws TskCoreException {
-
- if (tskCase == null) {
- throw new TskCoreException(
- NbBundle.getMessage(this.getClass(), "FileManager.addLocalDirInt.exception.closed.msg"));
- }
-
- //final String localName = localDir.getName();
- if (!localFile.exists()) {
- throw new TskCoreException(
- NbBundle.getMessage(this.getClass(), "FileManager.addLocalDirInt.exception.doesntExist.msg",
- localFile.getAbsolutePath()));
- }
- if (!localFile.canRead()) {
- throw new TskCoreException(
- NbBundle.getMessage(this.getClass(), "FileManager.addLocalDirInt.exception.notReadable.msg",
- localFile.getAbsolutePath()));
- }
-
+ private AbstractFile addLocalFile(CaseDbTransaction trans, VirtualDirectory parentDirectory, java.io.File localFile, FileAddProgressUpdater progressUpdater) throws TskCoreException {
if (localFile.isDirectory()) {
- //create virtual folder (we don't have a notion of a 'local folder')
- final VirtualDirectory childVd = tskCase.addVirtualDirectory(parentVd.getId(), localFile.getName(), trans);
- if (childVd != null && addProgressUpdater != null) {
- addProgressUpdater.fileAdded(childVd);
- }
- //add children recursively
- final java.io.File[] childrenFiles = localFile.listFiles();
- if (childrenFiles != null) {
- for (java.io.File childFile : childrenFiles) {
- addLocalDirInt(trans, childVd, childFile, addProgressUpdater);
+ /*
+ * Add the directory as a virtual directory.
+ */
+ VirtualDirectory virtualDirectory = caseDb.addVirtualDirectory(parentDirectory.getId(), localFile.getName(), trans);
+ progressUpdater.fileAdded(virtualDirectory);
+
+ /*
+ * Add its children, if any.
+ */
+ final java.io.File[] childFiles = localFile.listFiles();
+ if (childFiles != null && childFiles.length > 0) {
+ for (java.io.File childFile : childFiles) {
+ addLocalFile(trans, virtualDirectory, childFile, progressUpdater);
}
}
- return childVd;
+
+ return virtualDirectory;
} else {
- //add leaf file, base case
- return this.addLocalFileInt(parentVd, localFile, trans);
+ return caseDb.addLocalFile(localFile.getName(), localFile.getAbsolutePath(), localFile.length(),
+ 0, 0, 0, 0,
+ localFile.isFile(), parentDirectory, trans);
}
}
/**
- * Adds a single local/logical file to the case. Adds it to the database.
- * Does not refresh the views of data. Assumes that the local file exists
- * and can be read. This checking is done by addLocalDirInt().
+ * Adds a set of local/logical files and/or directories to the case database
+ * as data source.
*
- * @param parentFile parent file object container (such as virtual
- * directory, another local file, or fscontent File),
- * @param localFile File that we are adding
- * @param trans A case database transaction.
+ * @param localFilePaths A list of local/logical file and/or directory
+ * localFilePaths.
+ * @param progressUpdater Called after each file/directory is added to the
+ * case database.
*
- * @return newly created local file object added to the database
+ * @return The root virtual directory for the local/logical files data
+ * source.
*
- * @throws TskCoreException exception thrown if the object creation failed
- * due to a critical system error or of the file
- * manager has already been closed
+ * @throws TskCoreException If any of the local file paths is for a file or
+ * directory that does not exist or cannot be read,
+ * or there is a problem completing a database
+ * operation.
+ * @deprecated Use addLocalFilesDataSource instead.
*/
- private synchronized LocalFile addLocalFileInt(AbstractFile parentFile, java.io.File localFile, CaseDbTransaction trans) throws TskCoreException {
-
- if (tskCase == null) {
- throw new TskCoreException(
- NbBundle.getMessage(this.getClass(), "FileManager.addLocalDirInt2.exception.closed.msg"));
+ @Deprecated
+ public synchronized VirtualDirectory addLocalFilesDirs(List localFilePaths, FileAddProgressUpdater progressUpdater) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("File manager has been closed");
+ }
+ try {
+ return addLocalFilesDataSource("", "", "", localFilePaths, progressUpdater).getRootDirectory();
+ } catch (TskDataException ex) {
+ throw new TskCoreException(ex.getLocalizedMessage(), ex);
}
-
- long size = localFile.length();
- boolean isFile = localFile.isFile();
-
- long ctime = 0;
- long crtime = 0;
- long atime = 0;
- long mtime = 0;
-
- String fileName = localFile.getName();
-
- LocalFile lf = tskCase.addLocalFile(fileName, localFile.getAbsolutePath(), size,
- ctime, crtime, atime, mtime,
- isFile, parentFile, trans);
-
- return lf;
}
+ /**
+ * Closes the file manager.
+ *
+ * @throws IOException If there is a problem closing the file manager.
+ */
@Override
public synchronized void close() throws IOException {
- tskCase = null;
+ caseDb = null;
}
+
}
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/Services.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/Services.java
index 880bc8008e..a8d11d184c 100755
--- a/Core/src/org/sleuthkit/autopsy/casemodule/services/Services.java
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/Services.java
@@ -1,19 +1,18 @@
/*
*
* Autopsy Forensic Browser
- *
- * Copyright 2012-2015 Basis Technology Corp.
- *
+ *
+ * Copyright 2011-2016 Basis Technology Corp.
+ * Contact: carrier sleuthkit org
* Copyright 2012 42six Solutions.
* Contact: aebadirad 42six com
- * Project Contact/Architect: carrier sleuthkit 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.
@@ -31,7 +30,8 @@ import org.sleuthkit.autopsy.keywordsearchservice.KeywordSearchService;
import org.sleuthkit.datamodel.SleuthkitCase;
/**
- * A class to manage various services.
+ * A collection of case-level services (e.g., file manager, tags manager,
+ * keyword search, blackboard).
*/
public class Services implements Closeable {
@@ -41,36 +41,67 @@ public class Services implements Closeable {
private final KeywordSearchService keywordSearchService;
private final Blackboard blackboard;
- public Services(SleuthkitCase tskCase) {
- fileManager = new FileManager(tskCase);
+ /**
+ * Constructs a collection of case-level services (e.g., file manager, tags
+ * manager, keyword search, blackboard).
+ *
+ * @param caseDb The case database for the current case.
+ */
+ public Services(SleuthkitCase caseDb) {
+ fileManager = new FileManager(caseDb);
services.add(fileManager);
- tagsManager = new TagsManager(tskCase);
+ tagsManager = new TagsManager(caseDb);
services.add(tagsManager);
keywordSearchService = Lookup.getDefault().lookup(KeywordSearchService.class);
services.add(keywordSearchService);
-
- blackboard = new Blackboard();
+
+ blackboard = new Blackboard(caseDb);
services.add(blackboard);
}
+ /**
+ * Gets the file manager service for the current case.
+ *
+ * @return The file manager service for the current case.
+ */
public FileManager getFileManager() {
return fileManager;
}
+ /**
+ * Gets the tags manager service for the current case.
+ *
+ * @return The tags manager service for the current case.
+ */
public TagsManager getTagsManager() {
return tagsManager;
}
+ /**
+ * Gets the keyword search service for the current case.
+ *
+ * @return The keyword search service for the current case.
+ */
public KeywordSearchService getKeywordSearchService() {
return keywordSearchService;
}
-
+
+ /**
+ * Gets the blackboard service for the current case.
+ *
+ * @return The blackboard service for the current case.
+ */
public Blackboard getBlackboard() {
return blackboard;
}
+ /**
+ * Closes the services for the current case.
+ *
+ * @throws IOException if there is a problem closing the services.
+ */
@Override
public void close() throws IOException {
for (Closeable service : services) {
diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java
index 963f54e51f..e8d61bdeba 100755
--- a/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java
+++ b/Core/src/org/sleuthkit/autopsy/casemodule/services/TagsManager.java
@@ -45,7 +45,7 @@ public class TagsManager implements Closeable {
private static final Logger logger = Logger.getLogger(TagsManager.class.getName());
private static final String TAGS_SETTINGS_NAME = "Tags"; //NON-NLS
private static final String TAG_NAMES_SETTING_KEY = "TagNames"; //NON-NLS
- private final SleuthkitCase caseDb;
+ private SleuthkitCase caseDb;
private final HashMap uniqueTagNames = new HashMap<>();
private boolean tagNamesLoaded = false;
@@ -53,8 +53,8 @@ public class TagsManager implements Closeable {
* Constructs a per case Autopsy service that manages the creation,
* updating, and deletion of tags applied to content and blackboard
* artifacts by users.
- *
- * @param caseDb The case database for the current case.
+ *
+ * @param caseDb The case database.
*/
TagsManager(SleuthkitCase caseDb) {
this.caseDb = caseDb;
@@ -70,6 +70,9 @@ public class TagsManager implements Closeable {
* database.
*/
public synchronized List getAllTagNames() throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getAllTagNames();
}
@@ -84,6 +87,9 @@ public class TagsManager implements Closeable {
* database.
*/
public synchronized List getTagNamesInUse() throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getTagNamesInUse();
}
@@ -114,6 +120,9 @@ public class TagsManager implements Closeable {
* to the case database.
*/
public TagName addTagName(String displayName) throws TagNameAlreadyExistsException, TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
return addTagName(displayName, "", TagName.HTML_COLOR.NONE);
}
@@ -132,6 +141,9 @@ public class TagsManager implements Closeable {
* to the case database.
*/
public TagName addTagName(String displayName, String description) throws TagNameAlreadyExistsException, TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
return addTagName(displayName, description, TagName.HTML_COLOR.NONE);
}
@@ -151,6 +163,9 @@ public class TagsManager implements Closeable {
* to the case database.
*/
public synchronized TagName addTagName(String displayName, String description, TagName.HTML_COLOR color) throws TagNameAlreadyExistsException, TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
if (uniqueTagNames.containsKey(displayName)) {
throw new TagNameAlreadyExistsException();
@@ -182,6 +197,9 @@ public class TagsManager implements Closeable {
* database.
*/
public ContentTag addContentTag(Content content, TagName tagName) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
return addContentTag(content, tagName, "", -1, -1);
}
@@ -198,6 +216,9 @@ public class TagsManager implements Closeable {
* database.
*/
public ContentTag addContentTag(Content content, TagName tagName, String comment) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
return addContentTag(content, tagName, comment, -1, -1);
}
@@ -218,6 +239,9 @@ public class TagsManager implements Closeable {
* the case database.
*/
public ContentTag addContentTag(Content content, TagName tagName, String comment, long beginByteOffset, long endByteOffset) throws IllegalArgumentException, TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
ContentTag tag;
synchronized (this) {
lazyLoadExistingTagNames();
@@ -265,6 +289,9 @@ public class TagsManager implements Closeable {
* case database.
*/
public void deleteContentTag(ContentTag tag) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
synchronized (this) {
lazyLoadExistingTagNames();
caseDb.deleteContentTag(tag);
@@ -286,6 +313,9 @@ public class TagsManager implements Closeable {
* case database.
*/
public synchronized List getAllContentTags() throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getAllContentTags();
}
@@ -301,6 +331,9 @@ public class TagsManager implements Closeable {
* the case database.
*/
public synchronized long getContentTagsCountByTagName(TagName tagName) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getContentTagsCountByTagName(tagName);
}
@@ -316,6 +349,9 @@ public class TagsManager implements Closeable {
* case database.
*/
public synchronized ContentTag getContentTagByTagID(long tagID) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getContentTagByID(tagID);
}
@@ -332,6 +368,9 @@ public class TagsManager implements Closeable {
* case database.
*/
public synchronized List getContentTagsByTagName(TagName tagName) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getContentTagsByTagName(tagName);
}
@@ -348,6 +387,9 @@ public class TagsManager implements Closeable {
* case database.
*/
public synchronized List getContentTagsByContent(Content content) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getContentTagsByContent(content);
}
@@ -365,6 +407,9 @@ public class TagsManager implements Closeable {
* database.
*/
public BlackboardArtifactTag addBlackboardArtifactTag(BlackboardArtifact artifact, TagName tagName) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
return addBlackboardArtifactTag(artifact, tagName, "");
}
@@ -382,12 +427,15 @@ public class TagsManager implements Closeable {
* database.
*/
public BlackboardArtifactTag addBlackboardArtifactTag(BlackboardArtifact artifact, TagName tagName, String comment) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
BlackboardArtifactTag tag;
synchronized (this) {
lazyLoadExistingTagNames();
if (null == comment) {
throw new IllegalArgumentException("Passed null comment argument");
- }
+ }
tag = caseDb.addBlackboardArtifactTag(artifact, tagName, comment);
}
@@ -408,6 +456,9 @@ public class TagsManager implements Closeable {
* case database.
*/
public void deleteBlackboardArtifactTag(BlackboardArtifactTag tag) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
synchronized (this) {
lazyLoadExistingTagNames();
caseDb.deleteBlackboardArtifactTag(tag);
@@ -429,6 +480,9 @@ public class TagsManager implements Closeable {
* case database.
*/
public synchronized List getAllBlackboardArtifactTags() throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getAllBlackboardArtifactTags();
}
@@ -445,6 +499,9 @@ public class TagsManager implements Closeable {
* the case database.
*/
public synchronized long getBlackboardArtifactTagsCountByTagName(TagName tagName) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getBlackboardArtifactTagsCountByTagName(tagName);
}
@@ -460,6 +517,9 @@ public class TagsManager implements Closeable {
* case database.
*/
public synchronized BlackboardArtifactTag getBlackboardArtifactTagByTagID(long tagID) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getBlackboardArtifactTagByID(tagID);
}
@@ -476,6 +536,9 @@ public class TagsManager implements Closeable {
* case database.
*/
public synchronized List getBlackboardArtifactTagsByTagName(TagName tagName) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getBlackboardArtifactTagsByTagName(tagName);
}
@@ -492,16 +555,25 @@ public class TagsManager implements Closeable {
* case database.
*/
public synchronized List getBlackboardArtifactTagsByArtifact(BlackboardArtifact artifact) throws TskCoreException {
+ if (null == caseDb) {
+ throw new TskCoreException("Tags manager has been closed");
+ }
lazyLoadExistingTagNames();
return caseDb.getBlackboardArtifactTagsByArtifact(artifact);
}
/**
- * Saves the avaialble tag names to secondary storage.
+ * Closes the tags manager, saving the avaialble tag names to secondary
+ * storage.
+ *
+ * @throws IOException If there is a problem closing the tags manager.
+ * @deprecated Tags manager clients should not close the tags manager.
*/
@Override
+ @Deprecated
public synchronized void close() throws IOException {
saveTagNamesToTagsSettings();
+ caseDb = null;
}
/**
diff --git a/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java b/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java
index 9deeb0e841..24255057d0 100644
--- a/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java
+++ b/Core/src/org/sleuthkit/autopsy/externalresults/ExternalResultsImporter.java
@@ -27,6 +27,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.logging.Level;
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.casemodule.services.FileManager;
@@ -127,6 +128,7 @@ public final class ExternalResultsImporter {
}
}
+ @Messages({"ExternalResultsImporter.indexError.message=Failed to index imported artifact for keyword search."})
private void importArtifacts(ExternalResults results) {
SleuthkitCase caseDb = Case.getCurrentCase().getSleuthkitCase();
for (ExternalResults.Artifact artifactData : results.getArtifacts()) {
@@ -200,9 +202,9 @@ public final class ExternalResultsImporter {
// index the artifact for keyword search
blackboard.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, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), artifact.getDisplayName());
+ Bundle.ExternalResultsImporter_indexError_message(), artifact.getDisplayName());
}
if (standardArtifactTypeIds.contains(artifactTypeId)) {
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/Bundle.properties b/Core/src/org/sleuthkit/autopsy/filesearch/Bundle.properties
index d946e2f9c2..c5fd4d48e4 100644
--- a/Core/src/org/sleuthkit/autopsy/filesearch/Bundle.properties
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/Bundle.properties
@@ -53,6 +53,6 @@ SearchNode.getName.text=Search Result
SizeSearchPanel.sizeCompareComboBox.equalTo=equal to
SizeSearchPanel.sizeCompareComboBox.greaterThan=greater than
SizeSearchPanel.sizeCompareComboBox.lessThan=less than
-MimeTypePanel.jCheckBox1.text=MIME Type:
MimeTypePanel.jLabel1.text=*Note: Multiple MIME types can be selected
FileSearchPanel.searchButton.text=Search
+MimeTypePanel.mimeTypeCheckBox.text=MIME Type:
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchPanel.form b/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchPanel.form
index 4b253ff1e6..2d09e16507 100644
--- a/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchPanel.form
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchPanel.form
@@ -180,6 +180,9 @@
+
+
+
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchPanel.java
index b2bb6d295c..ea3642a65d 100644
--- a/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchPanel.java
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchPanel.java
@@ -74,6 +74,7 @@ class DateSearchPanel extends javax.swing.JPanel {
copyMenuItem.addActionListener(actList);
pasteMenuItem.addActionListener(actList);
selectAllMenuItem.addActionListener(actList);
+ this.setComponentsEnabled();
}
JCheckBox getAccessedCheckBox() {
@@ -116,6 +117,23 @@ class DateSearchPanel extends javax.swing.JPanel {
}
}
+ private void setComponentsEnabled() {
+ boolean enable = this.dateCheckBox.isSelected();
+ this.dateFromTextField.setEnabled(enable);
+ this.dateFromButtonCalendar.setEnabled(enable);
+ this.jLabel1.setEnabled(enable);
+ this.dateToTextField.setEnabled(enable);
+ this.dateToButtonCalendar.setEnabled(enable);
+ this.jLabel2.setEnabled(enable);
+ this.jLabel3.setEnabled(enable);
+ this.jLabel4.setEnabled(enable);
+ this.timeZoneComboBox.setEnabled(enable);
+ this.modifiedCheckBox.setEnabled(enable);
+ this.accessedCheckBox.setEnabled(enable);
+ this.changedCheckBox.setEnabled(enable);
+ this.createdCheckBox.setEnabled(enable);
+ }
+
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
@@ -170,6 +188,11 @@ class DateSearchPanel extends javax.swing.JPanel {
jLabel4.setText(org.openide.util.NbBundle.getMessage(DateSearchPanel.class, "DateSearchPanel.jLabel4.text")); // NOI18N
dateCheckBox.setText(org.openide.util.NbBundle.getMessage(DateSearchPanel.class, "DateSearchPanel.dateCheckBox.text")); // NOI18N
+ dateCheckBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ dateCheckBoxActionPerformed(evt);
+ }
+ });
jLabel3.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
jLabel3.setText(org.openide.util.NbBundle.getMessage(DateSearchPanel.class, "DateSearchPanel.jLabel3.text")); // NOI18N
@@ -324,6 +347,10 @@ class DateSearchPanel extends javax.swing.JPanel {
}
}//GEN-LAST:event_dateToPopupChanged
+ private void dateCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dateCheckBoxActionPerformed
+ this.setComponentsEnabled();
+ }//GEN-LAST:event_dateCheckBoxActionPerformed
+
/**
* Validate and set the datetime field on the screen given a datetime
* string.
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchPanel.form b/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchPanel.form
index 3de5bd4680..beb7227419 100644
--- a/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchPanel.form
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchPanel.form
@@ -53,6 +53,9 @@
+
+
+
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchPanel.java
index 9a564fcdbc..291ced32e7 100644
--- a/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchPanel.java
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/KnownStatusSearchPanel.java
@@ -37,6 +37,7 @@ class KnownStatusSearchPanel extends javax.swing.JPanel {
*/
KnownStatusSearchPanel() {
initComponents();
+ setComponentsEnabled();
}
JCheckBox getKnownCheckBox() {
@@ -54,6 +55,13 @@ class KnownStatusSearchPanel extends javax.swing.JPanel {
JCheckBox getUnknownOptionCheckBox() {
return unknownOptionCheckBox;
}
+
+ private void setComponentsEnabled() {
+ boolean enabled = this.knownCheckBox.isSelected();
+ this.unknownOptionCheckBox.setEnabled(enabled);
+ this.knownOptionCheckBox.setEnabled(enabled);
+ this.knownBadOptionCheckBox.setEnabled(enabled);
+ }
/**
* This method is called from within the constructor to initialize the form.
@@ -70,6 +78,11 @@ class KnownStatusSearchPanel extends javax.swing.JPanel {
knownBadOptionCheckBox = new javax.swing.JCheckBox();
knownCheckBox.setText(org.openide.util.NbBundle.getMessage(KnownStatusSearchPanel.class, "KnownStatusSearchPanel.knownCheckBox.text")); // NOI18N
+ knownCheckBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ knownCheckBoxActionPerformed(evt);
+ }
+ });
unknownOptionCheckBox.setSelected(true);
unknownOptionCheckBox.setText(org.openide.util.NbBundle.getMessage(KnownStatusSearchPanel.class, "KnownStatusSearchPanel.unknownOptionCheckBox.text")); // NOI18N
@@ -117,6 +130,10 @@ class KnownStatusSearchPanel extends javax.swing.JPanel {
// TODO add your handling code here:
}//GEN-LAST:event_knownOptionCheckBoxActionPerformed
+ private void knownCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_knownCheckBoxActionPerformed
+ setComponentsEnabled();
+ }//GEN-LAST:event_knownCheckBoxActionPerformed
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JCheckBox knownBadOptionCheckBox;
private javax.swing.JCheckBox knownCheckBox;
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/MimeTypePanel.form b/Core/src/org/sleuthkit/autopsy/filesearch/MimeTypePanel.form
index 9221d39633..a8c7fa65f9 100755
--- a/Core/src/org/sleuthkit/autopsy/filesearch/MimeTypePanel.form
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/MimeTypePanel.form
@@ -25,13 +25,13 @@
-
+
-
+
@@ -44,12 +44,12 @@
-
+
-
+
@@ -62,7 +62,7 @@
-
+
@@ -77,12 +77,15 @@
-
+
-
+
+
+
+
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/MimeTypePanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/MimeTypePanel.java
index 8a90761946..b4172354a4 100755
--- a/Core/src/org/sleuthkit/autopsy/filesearch/MimeTypePanel.java
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/MimeTypePanel.java
@@ -5,17 +5,16 @@
*/
package org.sleuthkit.autopsy.filesearch;
-import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.SortedSet;
import java.util.logging.Level;
-import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
import org.apache.tika.mime.MediaType;
import org.apache.tika.mime.MimeTypes;
import org.sleuthkit.autopsy.coreutils.Logger;
+import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
/**
*
@@ -32,6 +31,7 @@ public class MimeTypePanel extends javax.swing.JPanel {
*/
public MimeTypePanel() {
initComponents();
+ setComponentsEnabled();
}
private String[] getMimeTypeArray() {
@@ -63,11 +63,17 @@ public class MimeTypePanel extends javax.swing.JPanel {
}
List getMimeTypesSelected() {
- return this.jList1.getSelectedValuesList();
+ return this.mimeTypeList.getSelectedValuesList();
}
boolean isSelected() {
- return this.jCheckBox1.isSelected();
+ return this.mimeTypeCheckBox.isSelected();
+ }
+
+ void setComponentsEnabled() {
+ boolean enabled = this.isSelected();
+ this.mimeTypeList.setEnabled(enabled);
+ this.jLabel1.setEnabled(enabled);
}
/**
@@ -80,22 +86,27 @@ public class MimeTypePanel extends javax.swing.JPanel {
private void initComponents() {
jScrollPane1 = new javax.swing.JScrollPane();
- jList1 = new javax.swing.JList();
- jCheckBox1 = new javax.swing.JCheckBox();
+ mimeTypeList = new javax.swing.JList<>();
+ mimeTypeCheckBox = new javax.swing.JCheckBox();
jLabel1 = new javax.swing.JLabel();
setMinimumSize(new java.awt.Dimension(150, 150));
setPreferredSize(new java.awt.Dimension(100, 100));
- jList1.setModel(new javax.swing.AbstractListModel() {
+ mimeTypeList.setModel(new javax.swing.AbstractListModel() {
String[] strings = getMimeTypeArray();
public int getSize() { return strings.length; }
public String getElementAt(int i) { return strings[i]; }
});
- jList1.setMinimumSize(new java.awt.Dimension(0, 200));
- jScrollPane1.setViewportView(jList1);
+ mimeTypeList.setMinimumSize(new java.awt.Dimension(0, 200));
+ jScrollPane1.setViewportView(mimeTypeList);
- org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1, org.openide.util.NbBundle.getMessage(MimeTypePanel.class, "MimeTypePanel.jCheckBox1.text")); // NOI18N
+ org.openide.awt.Mnemonics.setLocalizedText(mimeTypeCheckBox, org.openide.util.NbBundle.getMessage(MimeTypePanel.class, "MimeTypePanel.mimeTypeCheckBox.text")); // NOI18N
+ mimeTypeCheckBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ mimeTypeCheckBoxActionPerformed(evt);
+ }
+ });
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(MimeTypePanel.class, "MimeTypePanel.jLabel1.text")); // NOI18N
@@ -105,12 +116,12 @@ public class MimeTypePanel extends javax.swing.JPanel {
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
- .addComponent(jCheckBox1)
+ .addComponent(mimeTypeCheckBox)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
+ .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
@@ -119,20 +130,24 @@ public class MimeTypePanel extends javax.swing.JPanel {
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addComponent(jCheckBox1)
+ .addComponent(mimeTypeCheckBox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1)
- .addGap(0, 0, 0))
+ .addContainerGap())
);
}// //GEN-END:initComponents
+ private void mimeTypeCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mimeTypeCheckBoxActionPerformed
+ setComponentsEnabled();
+ }//GEN-LAST:event_mimeTypeCheckBoxActionPerformed
+
// Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JLabel jLabel1;
- private javax.swing.JList jList1;
private javax.swing.JScrollPane jScrollPane1;
+ private javax.swing.JCheckBox mimeTypeCheckBox;
+ private javax.swing.JList mimeTypeList;
// End of variables declaration//GEN-END:variables
}
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.form b/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.form
index 7b5e61f5e1..2dfc5af1c3 100644
--- a/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.form
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.form
@@ -94,6 +94,9 @@
+
+
+
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.java
index dc68c320de..1ae2842947 100644
--- a/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.java
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/NameSearchPanel.java
@@ -24,7 +24,6 @@
*/
package org.sleuthkit.autopsy.filesearch;
-import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBox;
@@ -43,6 +42,7 @@ class NameSearchPanel extends javax.swing.JPanel {
NameSearchPanel() {
initComponents();
customizeComponents();
+ setComponentsEnabled();
}
private void customizeComponents() {
@@ -77,6 +77,12 @@ class NameSearchPanel extends javax.swing.JPanel {
JTextField getSearchTextField() {
return searchTextField;
}
+
+ void setComponentsEnabled() {
+ boolean enabled = nameCheckBox.isSelected();
+ this.searchTextField.setEnabled(enabled);
+ this.noteNameLabel.setEnabled(enabled);
+ }
/**
* This method is called from within the constructor to initialize the form.
@@ -110,6 +116,11 @@ class NameSearchPanel extends javax.swing.JPanel {
nameCheckBox.setFont(nameCheckBox.getFont().deriveFont(nameCheckBox.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
nameCheckBox.setText(org.openide.util.NbBundle.getMessage(NameSearchPanel.class, "NameSearchPanel.nameCheckBox.text")); // NOI18N
+ nameCheckBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ nameCheckBoxActionPerformed(evt);
+ }
+ });
searchTextField.setFont(searchTextField.getFont().deriveFont(searchTextField.getFont().getStyle() & ~java.awt.Font.BOLD, 11));
searchTextField.setText(org.openide.util.NbBundle.getMessage(NameSearchPanel.class, "NameSearchPanel.searchTextField.text")); // NOI18N
@@ -154,6 +165,11 @@ class NameSearchPanel extends javax.swing.JPanel {
private void searchTextFieldMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_searchTextFieldMouseClicked
this.nameCheckBox.setSelected(true); }//GEN-LAST:event_searchTextFieldMouseClicked
+
+ private void nameCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nameCheckBoxActionPerformed
+ setComponentsEnabled();
+ }//GEN-LAST:event_nameCheckBoxActionPerformed
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenuItem copyMenuItem;
private javax.swing.JMenuItem cutMenuItem;
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.form b/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.form
index 26a8e904bc..7987a8a031 100644
--- a/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.form
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.form
@@ -116,6 +116,9 @@
+
+
+
diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.java b/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.java
index e530ba7b42..4a0bc91d5e 100644
--- a/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.java
+++ b/Core/src/org/sleuthkit/autopsy/filesearch/SizeSearchPanel.java
@@ -18,8 +18,6 @@
*/
package org.sleuthkit.autopsy.filesearch;
-import org.openide.util.NbBundle;
-
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.NumberFormat;
@@ -40,6 +38,7 @@ class SizeSearchPanel extends javax.swing.JPanel {
SizeSearchPanel() {
initComponents();
customizeComponents();
+ setComponentsEnabled();
}
private void customizeComponents() {
@@ -82,6 +81,13 @@ class SizeSearchPanel extends javax.swing.JPanel {
JComboBox getSizeUnitComboBox() {
return sizeUnitComboBox;
}
+
+ void setComponentsEnabled() {
+ boolean enabled = this.sizeCheckBox.isSelected();
+ this.sizeCompareComboBox.setEnabled(enabled);
+ this.sizeUnitComboBox.setEnabled(enabled);
+ this.sizeTextField.setEnabled(enabled);
+ }
/**
* This method is called from within the constructor to initialize the form.
@@ -97,9 +103,9 @@ class SizeSearchPanel extends javax.swing.JPanel {
copyMenuItem = new javax.swing.JMenuItem();
pasteMenuItem = new javax.swing.JMenuItem();
selectAllMenuItem = new javax.swing.JMenuItem();
- sizeUnitComboBox = new javax.swing.JComboBox();
+ sizeUnitComboBox = new javax.swing.JComboBox<>();
sizeTextField = new JFormattedTextField(NumberFormat.getIntegerInstance());
- sizeCompareComboBox = new javax.swing.JComboBox();
+ sizeCompareComboBox = new javax.swing.JComboBox<>();
sizeCheckBox = new javax.swing.JCheckBox();
cutMenuItem.setText(org.openide.util.NbBundle.getMessage(SizeSearchPanel.class, "SizeSearchPanel.cutMenuItem.text")); // NOI18N
@@ -114,7 +120,7 @@ class SizeSearchPanel extends javax.swing.JPanel {
selectAllMenuItem.setText(org.openide.util.NbBundle.getMessage(SizeSearchPanel.class, "SizeSearchPanel.selectAllMenuItem.text")); // NOI18N
rightClickMenu.add(selectAllMenuItem);
- sizeUnitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Byte(s)", "KB", "MB", "GB", "TB" })); //NON-NLS
+ sizeUnitComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Byte(s)", "KB", "MB", "GB", "TB" }));
sizeTextField.setValue(0);
sizeTextField.addMouseListener(new java.awt.event.MouseAdapter() {
@@ -123,12 +129,14 @@ class SizeSearchPanel extends javax.swing.JPanel {
}
});
- sizeCompareComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
- NbBundle.getMessage(this.getClass(), "SizeSearchPanel.sizeCompareComboBox.equalTo"),
- NbBundle.getMessage(this.getClass(), "SizeSearchPanel.sizeCompareComboBox.greaterThan"),
- NbBundle.getMessage(this.getClass(), "SizeSearchPanel.sizeCompareComboBox.lessThan") }));
+ sizeCompareComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "equal to", "greater than", "less than" }));
sizeCheckBox.setText(org.openide.util.NbBundle.getMessage(SizeSearchPanel.class, "SizeSearchPanel.sizeCheckBox.text")); // NOI18N
+ sizeCheckBox.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ sizeCheckBoxActionPerformed(evt);
+ }
+ });
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
@@ -157,6 +165,11 @@ class SizeSearchPanel extends javax.swing.JPanel {
this.sizeCheckBox.setSelected(true);
this.sizeTextField.selectAll(); // select all so user can change it easily
}//GEN-LAST:event_sizeTextFieldMouseClicked
+
+ private void sizeCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sizeCheckBoxActionPerformed
+ setComponentsEnabled();
+ }//GEN-LAST:event_sizeCheckBoxActionPerformed
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenuItem copyMenuItem;
private javax.swing.JMenuItem cutMenuItem;
diff --git a/Core/src/org/sleuthkit/autopsy/keywordsearchservice/KeywordSearchService.java b/Core/src/org/sleuthkit/autopsy/keywordsearchservice/KeywordSearchService.java
index 69b7c57f4f..af43facec9 100644
--- a/Core/src/org/sleuthkit/autopsy/keywordsearchservice/KeywordSearchService.java
+++ b/Core/src/org/sleuthkit/autopsy/keywordsearchservice/KeywordSearchService.java
@@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
- * Copyright 2014 Basis Technology Corp.
+ * Copyright 2011-2016 Basis Technology Corp.
* Contact: carrier sleuthkit org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -23,7 +23,9 @@ import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.TskCoreException;
/**
- *
+ * An implementation of a keyword search service.
+ *
+ * TODO (AUT-2158: This interface should not extend Closeable.
*/
public interface KeywordSearchService extends Closeable {
@@ -49,4 +51,4 @@ public interface KeywordSearchService extends Closeable {
*/
public void tryConnect(String host, int port) throws KeywordSearchServiceException;
- }
+}
diff --git a/Core/src/org/sleuthkit/autopsy/modules/android/BrowserLocationAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/android/BrowserLocationAnalyzer.java
index d7f0543c49..d76abda578 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/android/BrowserLocationAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/android/BrowserLocationAnalyzer.java
@@ -26,7 +26,6 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.logging.Level;
-
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
@@ -72,6 +71,7 @@ class BrowserLocationAnalyzer {
}
}
+ @NbBundle.Messages({"BrowserLocationAnalyzer.indexError.message=Failed to index GPS trackpoint artifact for keyword search."})
private static void findGeoLocationsInDB(String DatabasePath, AbstractFile f) {
Connection connection = null;
ResultSet resultSet = null;
@@ -110,9 +110,9 @@ class BrowserLocationAnalyzer {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactTypeName(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.BrowserLocationAnalyzer_indexError_message(), bba.getDisplayName());
}
}
} catch (Exception e) {
diff --git a/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java
index 266bf09469..9f36f3cf83 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/android/CacheLocationAnalyzer.java
@@ -25,8 +25,8 @@ import java.math.BigInteger;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.logging.Level;
-
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.casemodule.services.FileManager;
@@ -78,6 +78,7 @@ class CacheLocationAnalyzer {
}
}
+ @Messages({"CacheLocationAnalyzer.indexError.message=Failed to index GPS trackpoint artifact for keyword search."})
private static void findGeoLocationsInFile(File file, AbstractFile f) {
byte[] bytes; // will temporarily hold bytes to be converted into the correct data types
@@ -140,14 +141,13 @@ class CacheLocationAnalyzer {
//Not storing these for now.
// bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_VALUE.getTypeID(),moduleName, accuracy));
// bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_COMMENT.getTypeID(),moduleName, confidence));
-
try {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.CacheLocationAnalyzer_indexError_message(), bba.getDisplayName());
}
}
diff --git a/Core/src/org/sleuthkit/autopsy/modules/android/CallLogAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/android/CallLogAnalyzer.java
index 7df25e15ff..198a503e4a 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/android/CallLogAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/android/CallLogAnalyzer.java
@@ -28,7 +28,7 @@ import java.sql.Statement;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Level;
-import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.casemodule.services.FileManager;
@@ -58,7 +58,7 @@ class CallLogAnalyzer {
private static final Iterable tableNames = Arrays.asList("calls", "logs"); //NON-NLS
public static void findCallLogs(Content dataSource, FileManager fileManager) {
- blackboard = Case.getCurrentCase().getServices().getBlackboard();
+ blackboard = Case.getCurrentCase().getServices().getBlackboard();
try {
List absFiles = fileManager.findFiles(dataSource, "logs.db"); //NON-NLS
absFiles.addAll(fileManager.findFiles(dataSource, "contacts.db")); //NON-NLS
@@ -77,6 +77,7 @@ class CallLogAnalyzer {
}
}
+ @Messages({"CallLogAnalyzer.indexError.message=Failed to index call log artifact for keyword search."})
private static void findCallLogsInDB(String DatabasePath, AbstractFile f) {
if (DatabasePath == null || DatabasePath.isEmpty()) {
@@ -113,16 +114,16 @@ class CallLogAnalyzer {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.CallLogAnalyzer_indexError_message(), bba.getDisplayName());
}
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Error posting call log record to the Blackboard", ex); //NON-NLS
}
}
} catch (SQLException e) {
- logger.log(Level.WARNING, "Could not read table {0} in db {1}", new Object[]{tableName, DatabasePath}); //NON-NLS
+ logger.log(Level.WARNING, String.format("Could not read table %s in db %s", tableName, DatabasePath), e); //NON-NLS
}
}
} catch (SQLException e) {
diff --git a/Core/src/org/sleuthkit/autopsy/modules/android/ContactAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/android/ContactAnalyzer.java
index 25affa740f..9eb8ac0ae9 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/android/ContactAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/android/ContactAnalyzer.java
@@ -27,7 +27,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.logging.Level;
-import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.casemodule.services.FileManager;
@@ -79,6 +79,7 @@ class ContactAnalyzer {
* path The fileId will be the Abstract file associated
* with the artifacts
*/
+ @Messages({"ContactAnalyzer.indexError.message=Failed to index contact artifact for keyword search."})
private static void findContactsInDB(String databasePath, AbstractFile f) {
Connection connection = null;
ResultSet resultSet = null;
@@ -154,9 +155,9 @@ class ContactAnalyzer {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.ContactAnalyzer_indexError_message(), bba.getDisplayName());
}
}
diff --git a/Core/src/org/sleuthkit/autopsy/modules/android/GoogleMapLocationAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/android/GoogleMapLocationAnalyzer.java
index d7889257dc..fbb6c9befd 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/android/GoogleMapLocationAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/android/GoogleMapLocationAnalyzer.java
@@ -26,8 +26,8 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.logging.Level;
-
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.casemodule.services.FileManager;
@@ -71,6 +71,7 @@ class GoogleMapLocationAnalyzer {
}
}
+ @Messages({"GoogleMapLocationAnalyzer.indexError.message=Failed to index GPS route artifact for keyword search."})
private static void findGeoLocationsInDB(String DatabasePath, AbstractFile f) {
Connection connection = null;
ResultSet resultSet = null;
@@ -136,9 +137,9 @@ class GoogleMapLocationAnalyzer {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.GoogleMapLocationAnalyzer_indexError_message(), bba.getDisplayName());
}
}
} catch (Exception e) {
diff --git a/Core/src/org/sleuthkit/autopsy/modules/android/TangoMessageAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/android/TangoMessageAnalyzer.java
index 09dba30821..41d8676eed 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/android/TangoMessageAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/android/TangoMessageAnalyzer.java
@@ -28,6 +28,7 @@ import java.util.List;
import java.util.logging.Level;
import org.apache.commons.codec.binary.Base64;
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.casemodule.services.FileManager;
@@ -68,6 +69,7 @@ class TangoMessageAnalyzer {
}
}
+ @Messages({"TangoMessageAnalyzer.indexError.message=Failed to index Tango message artifact for keyword search."})
private static void findTangoMessagesInDB(String DatabasePath, AbstractFile f) {
Connection connection = null;
ResultSet resultSet = null;
@@ -110,14 +112,14 @@ class TangoMessageAnalyzer {
bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_MESSAGE_TYPE, moduleName,
NbBundle.getMessage(TangoMessageAnalyzer.class,
"TangoMessageAnalyzer.bbAttribute.tangoMessage")));
-
+
try {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.TangoMessageAnalyzer_indexError_message(), bba.getDisplayName());
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
}
}
} catch (Exception e) {
diff --git a/Core/src/org/sleuthkit/autopsy/modules/android/TextMessageAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/android/TextMessageAnalyzer.java
index edf12e0b66..71139690da 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/android/TextMessageAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/android/TextMessageAnalyzer.java
@@ -26,8 +26,8 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.logging.Level;
-
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.casemodule.services.FileManager;
@@ -68,6 +68,7 @@ class TextMessageAnalyzer {
}
}
+ @Messages({"TextMessageAnalyzer.indexError.message=Failed to index text message artifact for keyword search."})
private static void findTextsInDB(String DatabasePath, AbstractFile f) {
Connection connection = null;
ResultSet resultSet = null;
@@ -123,14 +124,14 @@ class TextMessageAnalyzer {
bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_MESSAGE_TYPE, moduleName,
NbBundle.getMessage(TextMessageAnalyzer.class,
"TextMessageAnalyzer.bbAttribute.smsMessage")));
-
+
try {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.TextMessageAnalyzer_indexError_message(), bba.getDisplayName());
}
}
} catch (Exception e) {
diff --git a/Core/src/org/sleuthkit/autopsy/modules/android/WWFMessageAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/android/WWFMessageAnalyzer.java
index 87bbd8dc4d..8db7132bf0 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/android/WWFMessageAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/android/WWFMessageAnalyzer.java
@@ -26,8 +26,8 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.logging.Level;
-
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.casemodule.services.FileManager;
@@ -71,6 +71,7 @@ class WWFMessageAnalyzer {
}
}
+ @Messages({"WWFMessageAnalyzer.indexError.message=Failed to index WWF message artifact for keyword search."})
private static void findWWFMessagesInDB(String DatabasePath, AbstractFile f) {
Connection connection = null;
ResultSet resultSet = null;
@@ -110,14 +111,14 @@ class WWFMessageAnalyzer {
bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_MESSAGE_TYPE, moduleName,
NbBundle.getMessage(WWFMessageAnalyzer.class,
"WWFMessageAnalyzer.bbAttribute.wordsWithFriendsMsg")));
-
+
try {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.WWFMessageAnalyzer_indexError_message(), bba.getDisplayName());
}
}
} catch (Exception e) {
diff --git a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java
index 8e25feaa23..18a81126fa 100644
--- a/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/embeddedfileextractor/SevenZipExtractor.java
@@ -42,6 +42,7 @@ import net.sf.sevenzipjbinding.simple.ISimpleInArchive;
import net.sf.sevenzipjbinding.simple.ISimpleInArchiveItem;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.casemodule.services.FileManager;
@@ -50,7 +51,6 @@ import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.ingest.IngestJobContext;
import org.sleuthkit.autopsy.ingest.IngestMessage;
-import org.sleuthkit.autopsy.ingest.IngestModule.IngestModuleException;
import org.sleuthkit.autopsy.ingest.IngestMonitor;
import org.sleuthkit.autopsy.ingest.IngestServices;
import org.sleuthkit.autopsy.ingest.ModuleContentEvent;
@@ -267,6 +267,7 @@ class SevenZipExtractor {
*
* @return list of unpacked derived files
*/
+ @Messages({"SevenZipExtractor.indexError.message=Failed to index encryption detected artifact for keyword search."})
void unpack(AbstractFile archiveFile) {
blackboard = Case.getCurrentCase().getServices().getBlackboard();
String archiveFilePath;
@@ -586,9 +587,9 @@ class SevenZipExtractor {
// index the artifact for keyword search
blackboard.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, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), artifact.getDisplayName());
+ Bundle.SevenZipExtractor_indexError_message(), artifact.getDisplayName());
}
services.fireModuleDataEvent(new ModuleDataEvent(EmbeddedFileExtractorModuleFactory.getModuleName(), BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED));
diff --git a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java
index 2534d376f7..1fd1bd9116 100644
--- a/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/exif/ExifParserFileIngestModule.java
@@ -38,15 +38,16 @@ import java.util.TimeZone;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.logging.Level;
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestJobContext;
+import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter;
import org.sleuthkit.autopsy.ingest.IngestServices;
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
-import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter;
import org.sleuthkit.autopsy.modules.filetypeid.FileTypeDetector;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.BlackboardArtifact;
@@ -133,6 +134,7 @@ public final class ExifParserFileIngestModule implements FileIngestModule {
return processFile(content);
}
+ @Messages({"ExifParserFileIngestModule.indexError.message=Failed to index EXIF Metadata artifact for keyword search."})
ProcessResult processFile(AbstractFile f) {
InputStream in = null;
BufferedInputStream bin = null;
@@ -206,9 +208,9 @@ public final class ExifParserFileIngestModule implements FileIngestModule {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.ExifParserFileIngestModule_indexError_message(), bba.getDisplayName());
}
filesToFire = true;
}
diff --git a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java
index 6f9a9ea98c..07d2a9a5bd 100644
--- a/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/fileextmismatch/FileExtMismatchIngestModule.java
@@ -23,6 +23,7 @@ import java.util.HashMap;
import java.util.Set;
import java.util.logging.Level;
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.coreutils.Logger;
@@ -105,6 +106,7 @@ public class FileExtMismatchIngestModule implements FileIngestModule {
}
@Override
+ @Messages({"FileExtMismatchIngestModule.indexError.message=Failed to index file extension mismatch artifact for keyword search."})
public ProcessResult process(AbstractFile abstractFile) {
blackboard = Case.getCurrentCase().getServices().getBlackboard();
if (this.settings.skipKnownFiles() && (abstractFile.getKnown() == FileKnown.KNOWN)) {
@@ -139,9 +141,9 @@ public class FileExtMismatchIngestModule implements FileIngestModule {
// index the artifact for keyword search
blackboard.indexArtifact(bart);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bart.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bart.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bart.getDisplayName());
+ Bundle.FileExtMismatchIngestModule_indexError_message(), bart.getDisplayName());
}
services.fireModuleDataEvent(new ModuleDataEvent(FileExtMismatchDetectorModuleFactory.getModuleName(), ARTIFACT_TYPE.TSK_EXT_MISMATCH_DETECTED, Collections.singletonList(bart)));
diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbImportDatabaseDialog.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbImportDatabaseDialog.java
index 18fd2c6202..337fa49f0b 100644
--- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbImportDatabaseDialog.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbImportDatabaseDialog.java
@@ -22,6 +22,7 @@ import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
+import java.nio.file.Paths;
import java.util.logging.Level;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
@@ -31,6 +32,7 @@ import org.apache.commons.io.FilenameUtils;
import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
+import org.sleuthkit.autopsy.coreutils.PlatformUtil;
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb.KnownFilesType;
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDbManagerException;
@@ -249,9 +251,16 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
}// //GEN-END:initComponents
private void openButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openButtonActionPerformed
+ String lastBaseDirectory = Paths.get(PlatformUtil.getUserConfigDirectory(), "HashDatabases").toString();
if (ModuleSettings.settingExists(ModuleSettings.MAIN_SETTINGS, LAST_FILE_PATH_KEY)) {
- fileChooser.setCurrentDirectory(new File(ModuleSettings.getConfigSetting(ModuleSettings.MAIN_SETTINGS, LAST_FILE_PATH_KEY)));
+ lastBaseDirectory = ModuleSettings.getConfigSetting(ModuleSettings.MAIN_SETTINGS, LAST_FILE_PATH_KEY);
}
+ File hashDbFolder = new File(lastBaseDirectory);
+ // create the folder if it doesn't exist
+ if (!hashDbFolder.exists()) {
+ hashDbFolder.mkdir();
+ }
+ fileChooser.setCurrentDirectory(hashDbFolder);
if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
File databaseFile = fileChooser.getSelectedFile();
try {
diff --git a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java
index 0199727cb2..13f0d9914d 100644
--- a/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/hashdatabase/HashDbIngestModule.java
@@ -26,27 +26,28 @@ import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import java.util.logging.Level;
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
+import org.sleuthkit.autopsy.ingest.FileIngestModule;
import org.sleuthkit.autopsy.ingest.IngestMessage;
+import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter;
import org.sleuthkit.autopsy.ingest.IngestServices;
import org.sleuthkit.autopsy.ingest.ModuleDataEvent;
+import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
import org.sleuthkit.datamodel.AbstractFile;
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.HashHitInfo;
import org.sleuthkit.datamodel.HashUtility;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException;
import org.sleuthkit.datamodel.TskData;
import org.sleuthkit.datamodel.TskException;
-import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
-import org.sleuthkit.autopsy.ingest.FileIngestModule;
-import org.sleuthkit.autopsy.ingest.IngestModuleReferenceCounter;
-import org.sleuthkit.datamodel.HashHitInfo;
@NbBundle.Messages({
"HashDbIngestModule.noKnownBadHashDbSetMsg=No known bad hash database set.",
@@ -285,6 +286,7 @@ public class HashDbIngestModule implements FileIngestModule {
return ret;
}
+ @Messages({"HashDbIngestModule.indexError.message=Failed to index hashset hit artifact for keyword search."})
private void postHashSetHitToBlackboard(AbstractFile abstractFile, String md5Hash, String hashSetName, String comment, boolean showInboxMessage) {
try {
String MODULE_NAME = NbBundle.getMessage(HashDbIngestModule.class, "HashDbIngestModule.moduleName");
@@ -303,9 +305,9 @@ public class HashDbIngestModule implements FileIngestModule {
// index the artifact for keyword search
blackboard.indexArtifact(badFile);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", badFile.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + badFile.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), badFile.getDisplayName());
+ Bundle.HashDbIngestModule_indexError_message(), badFile.getDisplayName());
}
if (showInboxMessage) {
diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java
index 22ca91c064..b3627c3ef3 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/CallLogAnalyzer.java
@@ -25,7 +25,7 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.logging.Level;
-import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.coreutils.Logger;
@@ -74,6 +74,7 @@ class CallLogAnalyzer {
}
}
+ @Messages({"CallLogAnalyzer.indexError.message=Failed to index call log artifact for keyword search."})
private void findCallLogsInDB(String DatabasePath, long fId) {
if (DatabasePath == null || DatabasePath.isEmpty()) {
return;
@@ -128,9 +129,9 @@ class CallLogAnalyzer {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.CallLogAnalyzer_indexError_message(), bba.getDisplayName());
}
}
} catch (Exception e) {
diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java
index 7c63e28a8d..8741f4077b 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/ContactAnalyzer.java
@@ -30,18 +30,18 @@ import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import java.util.logging.Level;
-import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
+import org.sleuthkit.autopsy.datamodel.ContentUtils;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.BlackboardAttribute;
+import org.sleuthkit.datamodel.ReadContentInputStream;
import org.sleuthkit.datamodel.SleuthkitCase;
import org.sleuthkit.datamodel.TskCoreException;
-import org.sleuthkit.autopsy.datamodel.ContentUtils;
-import org.sleuthkit.datamodel.ReadContentInputStream;
class ContactAnalyzer {
@@ -91,6 +91,7 @@ class ContactAnalyzer {
* path The fileId will be the Abstract file associated
* with the artifacts
*/
+ @Messages({"ContactAnalyzer.indexError.message=Failed to index contact artifact for keyword search."})
private void findContactsInDB(String DatabasePath, long fId) {
if (DatabasePath == null || DatabasePath.isEmpty()) {
return;
@@ -149,9 +150,9 @@ class ContactAnalyzer {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.ContactAnalyzer_indexError_message(), bba.getDisplayName());
}
}
diff --git a/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java b/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java
index 44c08ae0cf..9ef547f4d9 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/iOS/TextMessageAnalyzer.java
@@ -26,6 +26,7 @@ import java.sql.Statement;
import java.util.List;
import java.util.logging.Level;
import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.coreutils.Logger;
@@ -74,6 +75,7 @@ class TextMessageAnalyzer {
}
}
+ @Messages({"TextMessageAnalyzer.indexError.message=Failed to index text message artifact for keyword search."})
private void findTextsInDB(String DatabasePath, long fId) {
if (DatabasePath == null || DatabasePath.isEmpty()) {
return;
@@ -127,14 +129,14 @@ class TextMessageAnalyzer {
bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SUBJECT, moduleName, subject));
bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TEXT, moduleName, body));
bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_MESSAGE_TYPE, moduleName, NbBundle.getMessage(this.getClass(), "TextMessageAnalyzer.bbAttribute.smsMessage")));
-
+
try {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ Bundle.TextMessageAnalyzer_indexError_message(), bba.getDisplayName());
}
}
diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java
index 62b423015b..95f52b06e1 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesIdentifierIngestModule.java
@@ -24,7 +24,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Level;
-import org.openide.util.Exceptions;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
@@ -100,6 +99,7 @@ final class FilesIdentifierIngestModule implements FileIngestModule {
* @inheritDoc
*/
@Override
+ @Messages({"FilesIdentifierIngestModule.indexError.message=Failed to index interesting file hit artifact for keyword search."})
public ProcessResult process(AbstractFile file) {
blackboard = Case.getCurrentCase().getServices().getBlackboard();
@@ -131,9 +131,8 @@ final class FilesIdentifierIngestModule implements FileIngestModule {
// index the artifact for keyword search
blackboard.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());
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + artifact.getArtifactID(), ex); //NON-NLS
+ MessageNotifyUtil.Notify.error(Bundle.FilesIdentifierIngestModule_indexError_message(), artifact.getDisplayName());
}
IngestServices.getInstance().fireModuleDataEvent(new ModuleDataEvent(moduleName, BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_FILE_HIT, Collections.singletonList(artifact)));
diff --git a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java
index 4709a3986b..9ee7f1a172 100755
--- a/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/interestingitems/FilesSetRulePanel.java
@@ -543,7 +543,9 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
this.mimeCheck.setSelected(false);
} else {
- this.extensionRadioButton.setEnabled(true);
+ if (this.nameCheck.isSelected()) {
+ this.extensionRadioButton.setEnabled(true);
+ }
this.fileSizeCheck.setEnabled(true);
this.mimeCheck.setEnabled(true);
}
@@ -814,7 +816,9 @@ final class FilesSetRulePanel extends javax.swing.JPanel {
} else {
this.nameTextField.setEnabled(true);
this.fullNameRadioButton.setEnabled(true);
- this.extensionRadioButton.setEnabled(true);
+ if (this.filesRadioButton.isSelected()) {
+ this.extensionRadioButton.setEnabled(true);
+ }
this.nameRegexCheckbox.setEnabled(true);
}
this.setOkButton();
diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java b/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java
index 9a19e4cedf..8a8466d89f 100644
--- a/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java
+++ b/Core/src/org/sleuthkit/autopsy/modules/stix/StixArtifactData.java
@@ -19,7 +19,7 @@
package org.sleuthkit.autopsy.modules.stix;
import java.util.logging.Level;
-import org.openide.util.NbBundle;
+import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.Blackboard;
import org.sleuthkit.autopsy.coreutils.Logger;
@@ -58,6 +58,7 @@ class StixArtifactData {
objType = a_objType;
}
+ @Messages({"StixArtifactData.indexError.message=Failed to index STIX interesting file hit artifact for keyword search."})
public void createArtifact(String a_title) throws TskCoreException {
Blackboard blackboard = Case.getCurrentCase().getServices().getBlackboard();
@@ -72,14 +73,13 @@ class StixArtifactData {
bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME, "Stix", setName)); //NON-NLS
bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_TITLE, "Stix", observableId)); //NON-NLS
bba.addAttribute(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_CATEGORY, "Stix", objType)); //NON-NLS
-
+
try {
// index the artifact for keyword search
blackboard.indexArtifact(bba);
} catch (Blackboard.BlackboardException ex) {
- logger.log(Level.SEVERE, NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.error.msg", bba.getDisplayName()), ex); //NON-NLS
- MessageNotifyUtil.Notify.error(
- NbBundle.getMessage(Blackboard.class, "Blackboard.unableToIndexArtifact.exception.msg"), bba.getDisplayName());
+ logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
+ MessageNotifyUtil.Notify.error(Bundle.StixArtifactData_indexError_message(), bba.getDisplayName());
}
}
diff --git a/Core/src/org/sleuthkit/autopsy/report/Bundle.properties b/Core/src/org/sleuthkit/autopsy/report/Bundle.properties
index ba477498c3..6e920ad631 100644
--- a/Core/src/org/sleuthkit/autopsy/report/Bundle.properties
+++ b/Core/src/org/sleuthkit/autopsy/report/Bundle.properties
@@ -225,7 +225,8 @@ ReportHTML.writeSum.noCaseNum=No case number
ReportBodyFile.generateReport.srcModuleName.text=TSK Body File
ReportExcel.endReport.srcModuleName.text=Excel Report
ReportHTML.writeIndex.srcModuleName.text=HTML Report
-ReportKML.genReport.srcModuleName.text=KML Report
+ReportKML.genReport.srcModuleName.text=Geospatial Data
+ReportKML.genReport.reportName=KML Report
ReportGenerator.artTableColHdr.extension.text=Extension
ReportGenerator.artTableColHdr.mimeType.text=MIME Type
ReportGenerator.artTableColHdr.processorArchitecture.text=Processor Architecture
diff --git a/Core/src/org/sleuthkit/autopsy/report/Bundle_ja.properties b/Core/src/org/sleuthkit/autopsy/report/Bundle_ja.properties
index 6ff657b68a..a877c52899 100644
--- a/Core/src/org/sleuthkit/autopsy/report/Bundle_ja.properties
+++ b/Core/src/org/sleuthkit/autopsy/report/Bundle_ja.properties
@@ -188,7 +188,7 @@ ReportExcel.endReport.srcModuleName.text=Excel\u30ec\u30dd\u30fc\u30c8
ReportGenerator.artTableColHdr.extension.text=\u62e1\u5f35\u5b50
ReportGenerator.artTableColHdr.mimeType.text=MIME\u30bf\u30a4\u30d7
ReportHTML.writeIndex.srcModuleName.text=HTML\u30ec\u30dd\u30fc\u30c8
-ReportKML.genReport.srcModuleName.text=KML\u30ec\u30dd\u30fc\u30c8
+ReportKML.genReport.reportName=KML\u30ec\u30dd\u30fc\u30c8
ReportGenerator.artTableColHdr.associatedArtifact=\u95a2\u4fc2\u3059\u308b\u30a2\u30fc\u30c6\u30a3\u30d5\u30a1\u30af\u30c8
ReportGenerator.artTableColHdr.count=\u30ab\u30a6\u30f3\u30c8
ReportGenerator.artTableColHdr.devMake=\u6a5f\u5668\u578b\u540d
diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java
index 5af71effae..54fa7b6b7e 100644
--- a/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java
+++ b/Core/src/org/sleuthkit/autopsy/report/ReportHTML.java
@@ -839,10 +839,16 @@ class ReportHTML implements TableReportModule {
indexOut = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(indexFilePath), "UTF-8")); //NON-NLS
StringBuilder index = new StringBuilder();
final String reportTitle = reportBranding.getReportTitle();
+ String iconPath = reportBranding.getAgencyLogoPath();
+ if (iconPath == null){
+ // use default Autopsy icon if custom icon is not set
+ iconPath = "favicon.ico";
+ }
index.append("\n").append(reportTitle).append(" ").append(
NbBundle.getMessage(this.getClass(), "ReportHTML.writeIndex.title", currentCase.getName())).append(
"\n"); //NON-NLS
- index.append("\n"); //NON-NLS
+ index.append("\n"); //NON-NLS
index.append("\n"); //NON-NLS
index.append("\n"); //NON-NLS
index.append("