Merge branch 'develop' of https://github.com/sleuthkit/autopsy into core-filesearch

This commit is contained in:
Nick Davis 2014-03-04 13:20:44 -05:00
commit 3854041c1f
38 changed files with 293 additions and 184 deletions

View File

@ -37,7 +37,7 @@ import org.sleuthkit.datamodel.TskDataException;
import org.sleuthkit.datamodel.TskException; import org.sleuthkit.datamodel.TskException;
/* /*
* A background task (swingworker) that adds the given image to * A background task that adds the given image to
* database using the Sleuthkit JNI interface. * database using the Sleuthkit JNI interface.
* *
* It updates the given ProgressMonitor as it works through adding the image, * It updates the given ProgressMonitor as it works through adding the image,
@ -74,7 +74,7 @@ import org.sleuthkit.datamodel.TskException;
boolean noFatOrphans; boolean noFatOrphans;
/* /*
* A Swingworker that updates the progressMonitor with the name of the * A thread that updates the progressMonitor with the name of the
* directory currently being processed by the AddImageTask * directory currently being processed by the AddImageTask
*/ */
private class CurrentDirectoryFetcher implements Runnable { private class CurrentDirectoryFetcher implements Runnable {

View File

@ -61,47 +61,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
private static final String autopsyVer = Version.getVersion(); // current version of autopsy. Change it when the version is changed private static final String autopsyVer = Version.getVersion(); // current version of autopsy. Change it when the version is changed
private static String appName = null; private static String appName = null;
/**
* Property name that indicates the name of the current case has changed.
* When a case is opened, "old name" is empty string and "new name" is the name.
* When a case is closed, "old name" is the case name and "new name" is empty string.
* When a case is renamed, "old name" has the original name and "new name" has the new name.
*/
public static final String CASE_NAME = "caseName";
/**
* Property name that indicates the number of the current case has changed.
* Fired with the case number is changed. The value is an int: the number of
* the case. -1 is used for no case number set.
*/
public static final String CASE_NUMBER = "caseNumber";
/**
* Property name that indicates the examiner of the current case has
* changed. Fired with the case examiner is changed. The value is a String:
* the name of the examiner. The empty string ("") is used for no examiner
* set.
*/
public static final String CASE_EXAMINER = "caseExaminer";
/**
* Property name that indicates a new data source (image, disk or local
* file) has been added to the current case. The new value is the
* newly-added instance of the new data source, and the old value is always
* null.
*/
public static final String CASE_ADD_DATA_SOURCE = "addDataSource";
/**
* Property name that indicates a data source has been removed from the
* current case. The "old value" is the (int) content ID of the data source
* that was removed, the new value is the instance of the data source.
*/
public static final String CASE_DEL_DATA_SOURCE = "removeDataSource";
/**
* Property name that indicates the currently open case has changed.
* When a case is opened, the "new value" will be an instance of the opened
* Case object and the "old value" will be null.
* When a case is closed, the "new value" will be null and the "old value"
* will be the instance of the Case object being closed.
*/
public static final String CASE_CURRENT_CASE = "currentCase";
/** /**
* Name for the property that determines whether to show the dialog at * Name for the property that determines whether to show the dialog at
* startup * startup
@ -114,69 +74,53 @@ public class Case implements SleuthkitCase.ErrorObserver {
* Events that the case module will fire. Event listeners can get the event * Events that the case module will fire. Event listeners can get the event
* name by using String returned by toString() method on a specific event. * name by using String returned by toString() method on a specific event.
*/ */
/* @@@ BC: I added this as a place holder for what I want this to be, but public enum Events {
* this is not the time to change it. We'll start using this at a major release
* version.
*/
private enum CaseModuleEvent_DoNotUse {
/**
* Property name that indicates the name of the current case has changed.
* Fired with the case is renamed, and when the current case is
* opened/closed/changed. The value is a String: the name of the case. The
* empty string ("") is used for no open case.
*/
// @@@ BC: I propose that this is no longer called for case open/close.
CASE_NAME("caseName"),
/**
* Property name that indicates the number of the current case has changed.
* Fired with the case number is changed. The value is an int: the number of
* the case. -1 is used for no case number set.
*/
CASE_NUMBER("caseNumber"),
/**
* Property name that indicates the examiner of the current case has
* changed. Fired with the case examiner is changed. The value is a String:
* the name of the examiner. The empty string ("") is used for no examiner
* set.
*/
CASE_EXAMINER("caseExaminer"),
/**
* Property name that indicates a new data source (image, disk or local
* file) has been added to the current case. The new value is the
* newly-added instance of the new data source, and the old value is always
* null.
*/
CASE_ADD_DATA_SOURCE("addDataSource"),
/**
* Property name that indicates a data source has been removed from the
* current case. The "old value" is the (int) content ID of the data source
* that was removed, the new value is the instance of the data source.
*/
CASE_DEL_DATA_SOURCE("removeDataSource"),
/** /**
* Property name that indicates the currently open case has changed. The new * Property name that indicates the name of the current case has
* value is the instance of the opened Case, or null if there is no open * changed. When a case is opened, "old name" is empty string and "new
* case. The old value is the instance of the closed Case, or null if there * name" is the name. When a case is closed, "old name" is the case name
* was no open case. * and "new name" is empty string. When a case is renamed, "old name"
* has the original name and "new name" has the new name.
*/ */
CASE_CURRENT_CASE("currentCase"); // @@@ BC: I propose that this is no longer called for case open/close.
NAME,
private String name; /**
CaseModuleEvent_DoNotUse(String name) { * Property name that indicates the number of the current case has
this.name = name; * changed. Fired with the case number is changed. The value is an int:
} * the number of the case. -1 is used for no case number set.
*/
public String getName() { NUMBER,
return this.name; /**
} * Property name that indicates the examiner of the current case has
* changed. Fired with the case examiner is changed. The value is a
* String: the name of the examiner. The empty string ("") is used for
* no examiner set.
*/
EXAMINER,
/**
* Property name that indicates a new data source (image, disk or local
* file) has been added to the current case. The new value is the
* newly-added instance of the new data source, and the old value is
* always null.
*/
DATA_SOURCE_ADDED,
/**
* Property name that indicates a data source has been removed from the
* current case. The "old value" is the (int) content ID of the data
* source that was removed, the new value is the instance of the data
* source.
*/
DATA_SOURCE_DELETED,
/**
* Property name that indicates the currently open case has changed.
* When a case is opened, the "new value" will be an instance of the
* opened Case object and the "old value" will be null. When a case is
* closed, the "new value" will be null and the "old value" will be the
* instance of the Case object being closed.
*/
CURRENT_CASE;
}; };
private String name; private String name;
private String number; private String number;
private String examiner; private String examiner;
@ -244,7 +188,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
doCaseChange(null); //closes windows, etc doCaseChange(null); //closes windows, etc
try { try {
pcs.firePropertyChange(CASE_CURRENT_CASE, oldCase, null); pcs.firePropertyChange(Events.CURRENT_CASE.toString(), oldCase, null);
} }
catch (Exception e) { catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); logger.log(Level.SEVERE, "Case listener threw exception", e);
@ -253,7 +197,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
doCaseNameChange(""); doCaseNameChange("");
try { try {
pcs.firePropertyChange(CASE_NAME, oldCase.name, ""); pcs.firePropertyChange(Events.NAME.toString(), oldCase.name, "");
} }
catch (Exception e) { catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); logger.log(Level.SEVERE, "Case listener threw exception", e);
@ -266,7 +210,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
try { try {
pcs.firePropertyChange(CASE_CURRENT_CASE, null, currentCase); pcs.firePropertyChange(Events.CURRENT_CASE.toString(), null, currentCase);
} }
catch (Exception e) { catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); logger.log(Level.SEVERE, "Case listener threw exception", e);
@ -276,7 +220,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
try { try {
pcs.firePropertyChange(CASE_NAME, "", currentCase.name); pcs.firePropertyChange(Events.NAME.toString(), "", currentCase.name);
} }
catch (Exception e) { catch (Exception e) {
logger.log(Level.SEVERE, "Case threw exception", e); logger.log(Level.SEVERE, "Case threw exception", e);
@ -441,7 +385,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
Image newImage = db.getImageById(imgId); Image newImage = db.getImageById(imgId);
try { try {
pcs.firePropertyChange(CASE_ADD_DATA_SOURCE, null, newImage); // the new value is the instance of the image pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newImage); // the new value is the instance of the image
} }
catch (Exception e) { catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); logger.log(Level.SEVERE, "Case listener threw exception", e);
@ -475,7 +419,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
void notifyNewDataSource(Content newDataSource) { void notifyNewDataSource(Content newDataSource) {
try { try {
pcs.firePropertyChange(CASE_ADD_DATA_SOURCE, null, newDataSource); pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newDataSource);
} }
catch (Exception e) { catch (Exception e) {
logger.log(Level.SEVERE, "Case threw exception", e); logger.log(Level.SEVERE, "Case threw exception", e);
@ -556,7 +500,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
name = newCaseName; // change the local value name = newCaseName; // change the local value
RecentCases.getInstance().updateRecentCase(oldCaseName, oldPath, newCaseName, newPath); // update the recent case RecentCases.getInstance().updateRecentCase(oldCaseName, oldPath, newCaseName, newPath); // update the recent case
try { try {
pcs.firePropertyChange(CASE_NAME, oldCaseName, newCaseName); pcs.firePropertyChange(Events.NAME.toString(), oldCaseName, newCaseName);
} }
catch (Exception e) { catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); logger.log(Level.SEVERE, "Case listener threw exception", e);
@ -580,7 +524,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
xmlcm.setCaseExaminer(newExaminer); // set the examiner xmlcm.setCaseExaminer(newExaminer); // set the examiner
examiner = newExaminer; examiner = newExaminer;
try { try {
pcs.firePropertyChange(CASE_EXAMINER, oldExaminer, newExaminer); pcs.firePropertyChange(Events.EXAMINER.toString(), oldExaminer, newExaminer);
} }
catch (Exception e) { catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); logger.log(Level.SEVERE, "Case listener threw exception", e);
@ -603,7 +547,7 @@ public class Case implements SleuthkitCase.ErrorObserver {
number = newCaseNumber; number = newCaseNumber;
try { try {
pcs.firePropertyChange(CASE_NUMBER, oldCaseNumber, newCaseNumber); pcs.firePropertyChange(Events.NUMBER.toString(), oldCaseNumber, newCaseNumber);
} }
catch (Exception e) { catch (Exception e) {
logger.log(Level.SEVERE, "Case listener threw exception", e); logger.log(Level.SEVERE, "Case listener threw exception", e);

View File

@ -49,8 +49,11 @@ public class Installer extends ModuleInstall {
* If libtsk_jni tries to load them, they will not be found by * If libtsk_jni tries to load them, they will not be found by
* Windows because they are in special NetBeans folders. So, we * Windows because they are in special NetBeans folders. So, we
* manually load them from within Autopsy so that they are found * manually load them from within Autopsy so that they are found
* via the NetBeans loading setup. * via the NetBeans loading setup. These are copied by the build
* On other platforms, we assume the dependncies are all installed * script when making the ZIP file. In a development environment
* they will need to be loaded from standard places in your system.
*
* On non-Windows platforms, we assume the dependncies are all installed
* and loadable (i.e. a 'make install' was done). * and loadable (i.e. a 'make install' was done).
*/ */
if (PlatformUtil.isWindowsOS()) { if (PlatformUtil.isWindowsOS()) {

View File

@ -236,6 +236,10 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
return true; return true;
} }
/**
* Thread note: Make sure to run this in the EDT as it causes GUI operations.
* @param selectedNode
*/
@Override @Override
public void setNode(Node selectedNode) { public void setNode(Node selectedNode) {
// change the cursor to "waiting cursor" for this operation // change the cursor to "waiting cursor" for this operation

View File

@ -24,6 +24,7 @@ import java.awt.EventQueue;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.util.Arrays; import java.util.Arrays;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
@ -31,6 +32,8 @@ import javax.swing.ListSelectionModel;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerManager;
import org.openide.explorer.view.IconView; import org.openide.explorer.view.IconView;
import org.openide.nodes.AbstractNode; import org.openide.nodes.AbstractNode;
@ -40,6 +43,7 @@ import org.openide.nodes.NodeEvent;
import org.openide.nodes.NodeListener; import org.openide.nodes.NodeListener;
import org.openide.nodes.NodeMemberEvent; import org.openide.nodes.NodeMemberEvent;
import org.openide.nodes.NodeReorderEvent; import org.openide.nodes.NodeReorderEvent;
import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
import org.sleuthkit.autopsy.coreutils.ImageUtils; import org.sleuthkit.autopsy.coreutils.ImageUtils;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
@ -422,6 +426,16 @@ import org.sleuthkit.datamodel.TskCoreException;
progress.finish(); progress.finish();
setCursor(null); setCursor(null);
updateControls(); updateControls();
// see if any exceptions were thrown
try {
get();
} catch (InterruptedException | ExecutionException ex) {
NotifyDescriptor d =
new NotifyDescriptor.Message("Error making thumbnails: " + ex.getMessage(),
NotifyDescriptor.ERROR_MESSAGE);
DialogDisplayer.getDefault().notify(d);
logger.log(Level.SEVERE, "Error making thumbnails: " + ex.getMessage());
}
} }
}.execute(); }.execute();

View File

@ -29,6 +29,7 @@ import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.concurrent.CancellationException; import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
@ -50,6 +51,8 @@ import org.gstreamer.elements.RGBDataSink;
import org.gstreamer.swing.VideoComponent; import org.gstreamer.swing.VideoComponent;
import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.util.Cancellable; import org.openide.util.Cancellable;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
import org.openide.util.lookup.ServiceProviders; import org.openide.util.lookup.ServiceProviders;
@ -659,6 +662,18 @@ public class GstVideoPanel extends MediaViewVideoPanel {
return null; return null;
} }
@Override
protected void done() {
// see if any exceptions were thrown
try {
get();
} catch (InterruptedException | ExecutionException ex) {
logger.log(Level.WARNING, "Error updating video progress: " + ex.getMessage());
infoLabel.setText("Error updating video progress: " + ex.getMessage());
}
}
} //end class progress worker } //end class progress worker
/* Thread that extracts and plays a file */ /* Thread that extracts and plays a file */

View File

@ -516,7 +516,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
Object newValue = evt.getNewValue(); Object newValue = evt.getNewValue();
// change in the case name // change in the case name
if (changed.equals(Case.CASE_NAME)) { if (changed.equals(Case.Events.NAME.toString())) {
// set the main title of the window // set the main title of the window
String oldCaseName = oldValue.toString(); String oldCaseName = oldValue.toString();
String newCaseName = newValue.toString(); String newCaseName = newValue.toString();
@ -529,7 +529,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
em.getRootContext().setDisplayName(newCaseName); em.getRootContext().setDisplayName(newCaseName);
} }
} // changed current case } // changed current case
else if (changed.equals(Case.CASE_CURRENT_CASE)) { else if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
// When a case is closed, the old value of this property is the // When a case is closed, the old value of this property is the
// closed Case object and the new value is null. When a case is // closed Case object and the new value is null. When a case is
// opened, the old value is null and the new value is the new Case // opened, the old value is null and the new value is the new Case
@ -553,7 +553,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat
resetHistory(); resetHistory();
} }
} // if the image is added to the case } // if the image is added to the case
else if (changed.equals(Case.CASE_ADD_DATA_SOURCE)) { else if (changed.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
componentOpened(); componentOpened();
// Image img = (Image)newValue; // Image img = (Image)newValue;
// //

View File

@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Iterator; import java.util.Iterator;
import java.util.concurrent.CancellationException; import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level; import java.util.logging.Level;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
@ -225,17 +226,18 @@ public final class ExtractAction extends AbstractAction {
@Override @Override
protected void done() { protected void done() {
boolean msgDisplayed = false;
try { try {
super.get(); super.get();
} }
catch (CancellationException | InterruptedException ex) {
}
catch (Exception ex) { catch (Exception ex) {
logger.log(Level.SEVERE, "Fatal error during file extraction", ex); logger.log(Level.SEVERE, "Fatal error during file extraction", ex);
MessageNotifyUtil.Message.info("Error extracting files: " + ex.getMessage());
msgDisplayed = true;
} }
finally { finally {
progress.finish(); progress.finish();
if (!this.isCancelled()) { if (!this.isCancelled() && !msgDisplayed) {
MessageNotifyUtil.Message.info("File(s) extracted."); MessageNotifyUtil.Message.info("File(s) extracted.");
} }
} }

View File

@ -29,6 +29,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
@ -37,6 +38,7 @@ import javax.swing.SwingWorker;
import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.util.Cancellable; import org.openide.util.Cancellable;
import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
@ -294,8 +296,14 @@ import org.sleuthkit.datamodel.VolumeSystem;
for (UnallocStruct u : lus) { for (UnallocStruct u : lus) {
lockedVols.remove(u.getFileName()); lockedVols.remove(u.getFileName());
} }
if (!canceled && !lus.isEmpty()) {
MessageNotifyUtil.Notify.info("Completed extraction of unallocated space.", "Files were extracted to " + lus.get(0).getFile().getParent()); try {
get();
if (!canceled && !lus.isEmpty()) {
MessageNotifyUtil.Notify.info("Completed extraction of unallocated space.", "Files were extracted to " + lus.get(0).getFile().getParent());
}
} catch (InterruptedException | ExecutionException ex) {
MessageNotifyUtil.Notify.error("Error Extracting", "Error extracting unallocated space: " + ex.getMessage());
} }
} }
} }

View File

@ -241,7 +241,7 @@ class DateSearchFilter extends AbstractFileSearchFilter<DateSearchPanel> {
Object oldValue = evt.getOldValue(); Object oldValue = evt.getOldValue();
Object newValue = evt.getNewValue(); Object newValue = evt.getNewValue();
if (changed.equals(Case.CASE_CURRENT_CASE)) { if (changed.equals(Case.Events.CURRENT_CASE.toString().toString())) {
// create or open a case // create or open a case
if (newValue != null) { if (newValue != null) {
DateSearchFilter.this.updateTimeZoneList(); DateSearchFilter.this.updateTimeZoneList();
@ -249,12 +249,12 @@ class DateSearchFilter extends AbstractFileSearchFilter<DateSearchPanel> {
} }
// if the image is added to the case // if the image is added to the case
if (changed.equals(Case.CASE_ADD_DATA_SOURCE)) { if (changed.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
DateSearchFilter.this.updateTimeZoneList(); DateSearchFilter.this.updateTimeZoneList();
} }
// if the image is removed from the case // if the image is removed from the case
if (changed.equals(Case.CASE_DEL_DATA_SOURCE)) { if (changed.equals(Case.Events.DATA_SOURCE_DELETED.toString())) {
DateSearchFilter.this.updateTimeZoneList(); DateSearchFilter.this.updateTimeZoneList();
} }
} }

View File

@ -39,7 +39,7 @@ import org.sleuthkit.autopsy.directorytree.FileSearchProvider;
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
if(evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)){ if(evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())){
setEnabled(evt.getNewValue() != null); setEnabled(evt.getNewValue() != null);
} }
} }

View File

@ -213,7 +213,7 @@ import org.sleuthkit.datamodel.Content;
Case.addPropertyChangeListener(new PropertyChangeListener() { Case.addPropertyChangeListener(new PropertyChangeListener() {
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)) { if (evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())) {
Case oldCase = (Case) evt.getOldValue(); Case oldCase = (Case) evt.getOldValue();
if (oldCase == null) //nothing to do, new case had been opened if (oldCase == null) //nothing to do, new case had been opened
{ {

View File

@ -143,7 +143,7 @@ import org.sleuthkit.autopsy.casemodule.Case;
Case.addPropertyChangeListener(new PropertyChangeListener() { Case.addPropertyChangeListener(new PropertyChangeListener() {
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)) { if (evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())) {
setEnabled(evt.getNewValue() != null); setEnabled(evt.getNewValue() != null);
} }
} }

View File

@ -123,7 +123,7 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil;
String changed = evt.getPropertyName(); String changed = evt.getPropertyName();
Object newValue = evt.getNewValue(); Object newValue = evt.getNewValue();
if (changed.equals(Case.CASE_CURRENT_CASE)) { if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
if (newValue != null) { if (newValue != null) {
setMonitorDir(); setMonitorDir();
} }

View File

@ -49,7 +49,7 @@ import org.sleuthkit.autopsy.casemodule.Case;
Object oldValue = evt.getOldValue(); Object oldValue = evt.getOldValue();
Object newValue = evt.getNewValue(); Object newValue = evt.getNewValue();
if (changed.equals(Case.CASE_CURRENT_CASE)) { if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
if (newValue != null) { if (newValue != null) {
// enable all menus when a case is created / opened // enable all menus when a case is created / opened
int totalMenus = menu.getItemCount(); int totalMenus = menu.getItemCount();

View File

@ -41,6 +41,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import java.util.HashSet; import java.util.HashSet;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFrame; import javax.swing.JFrame;
@ -251,6 +252,15 @@ import org.sleuthkit.datamodel.TskException;
return 0; return 0;
} }
@Override
protected void done() {
try {
get();
} catch (InterruptedException | ExecutionException ex) {
logger.log(Level.SEVERE, "failed to generate reports", ex);
}
}
} }
/** /**
@ -336,6 +346,15 @@ import org.sleuthkit.datamodel.TskException;
return Collections.EMPTY_LIST; return Collections.EMPTY_LIST;
} }
} }
@Override
protected void done() {
try {
get();
} catch (InterruptedException | ExecutionException ex) {
logger.log(Level.SEVERE, "failed to generate reports", ex);
}
}
} }
/** /**
@ -574,6 +593,15 @@ import org.sleuthkit.datamodel.TskException;
} }
} }
@Override
protected void done() {
try {
get();
} catch (InterruptedException | ExecutionException ex) {
logger.log(Level.SEVERE, "failed to generate reports", ex);
}
}
/** /**
* Generate the tables for the tagged artifacts * Generate the tables for the tagged artifacts
*/ */

View File

@ -83,7 +83,7 @@ public final class ReportWizardAction extends CallableSystemAction implements P
Case.addPropertyChangeListener(new PropertyChangeListener() { Case.addPropertyChangeListener(new PropertyChangeListener() {
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)) { if (evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())) {
Case newCase = (Case) evt.getNewValue(); Case newCase = (Case) evt.getNewValue();
setEnabled(newCase != null); setEnabled(newCase != null);

View File

@ -40,6 +40,7 @@ import org.w3c.dom.Element;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeSupport;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import javax.swing.SwingWorker; import javax.swing.SwingWorker;
@ -47,6 +48,7 @@ import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Content; import org.sleuthkit.datamodel.Content;
@ -942,6 +944,9 @@ public class HashDbManager implements PropertyChangeListener {
} }
} }
/**
* Worker thread to make an index of a database
*/
private class HashDbIndexer extends SwingWorker<Object, Void> { private class HashDbIndexer extends SwingWorker<Object, Void> {
private ProgressHandle progress = null; private ProgressHandle progress = null;
private HashDb hashDb = null; private HashDb hashDb = null;
@ -977,6 +982,16 @@ public class HashDbManager implements PropertyChangeListener {
hashDb.indexing = false; hashDb.indexing = false;
progress.finish(); progress.finish();
// see if we got any errors
try {
get();
} catch (InterruptedException | ExecutionException ex) {
logger.log(Level.SEVERE, "Error creating index", ex);
MessageNotifyUtil.Notify.show("Error creating index",
"Error creating index: " + ex.getMessage(),
MessageNotifyUtil.MessageType.ERROR);
}
try { try {
hashDb.propertyChangeSupport.firePropertyChange(HashDb.Event.INDEXING_DONE.toString(), null, hashDb); hashDb.propertyChangeSupport.firePropertyChange(HashDb.Event.INDEXING_DONE.toString(), null, hashDb);
} }

View File

@ -47,7 +47,7 @@ class HashDbPanelSearchAction extends CallableSystemAction {
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
if(evt.getPropertyName().equals(Case.CASE_CURRENT_CASE)){ if(evt.getPropertyName().equals(Case.Events.CURRENT_CASE.toString())){
setEnabled(evt.getNewValue() != null); setEnabled(evt.getNewValue() != null);
} }
} }

View File

@ -32,13 +32,12 @@ import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.util.Cancellable; import org.openide.util.Cancellable;
import org.sleuthkit.datamodel.AbstractFile; import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.FsContent;
class HashDbSearchThread extends SwingWorker<Object,Void> { class HashDbSearchThread extends SwingWorker<Object,Void> {
private Logger logger = Logger.getLogger(HashDbSearchThread.class.getName()); private Logger logger = Logger.getLogger(HashDbSearchThread.class.getName());
private ProgressHandle progress; private ProgressHandle progress;
private Map<String, List<AbstractFile>> map; private Map<String, List<AbstractFile>> map;
private ArrayList<String> hashes = new ArrayList<String>(); private ArrayList<String> hashes = new ArrayList<>();
private AbstractFile file; private AbstractFile file;
HashDbSearchThread(AbstractFile file) { HashDbSearchThread(AbstractFile file) {

View File

@ -26,6 +26,8 @@ import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
@ -43,6 +45,7 @@ import javax.swing.text.html.HTMLEditorKit.HTMLFactory;
import javax.swing.text.html.StyleSheet; import javax.swing.text.html.StyleSheet;
import org.netbeans.api.progress.ProgressHandle; import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory; import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.util.Exceptions;
import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.EscapeUtil;
import org.sleuthkit.autopsy.coreutils.TextUtil; import org.sleuthkit.autopsy.coreutils.TextUtil;
@ -386,7 +389,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
* @return currently available sources on the panel * @return currently available sources on the panel
*/ */
public List<MarkupSource> getSources() { public List<MarkupSource> getSources() {
ArrayList<MarkupSource> sources = new ArrayList<MarkupSource>(); ArrayList<MarkupSource> sources = new ArrayList<>();
for (int i = 0; i < sourceComboBox.getItemCount(); ++i) { for (int i = 0; i < sourceComboBox.getItemCount(); ++i) {
sources.add((MarkupSource) sourceComboBox.getItemAt(i)); sources.add((MarkupSource) sourceComboBox.getItemAt(i));
} }
@ -695,6 +698,15 @@ class ExtractedContentPanel extends javax.swing.JPanel {
protected void done() { protected void done() {
//super.done(); //super.done();
progress.finish(); progress.finish();
// see if there are any errors
try {
get();
} catch (InterruptedException | ExecutionException ex) {
logger.log(Level.SEVERE, "Error getting marked up text" );
}
if (markup != null) { if (markup != null) {
setPanelText(markup, true); setPanelText(markup, true);
} else { } else {
@ -703,8 +715,6 @@ class ExtractedContentPanel extends javax.swing.JPanel {
updateControls(source); updateControls(source);
scrollToCurrentHit(source); scrollToCurrentHit(source);
} }
} }
} }

View File

@ -66,9 +66,9 @@ class Installer extends ModuleInstall {
int serverStopPort = server.getCurrentSolrStopPort(); int serverStopPort = server.getCurrentSolrStopPort();
logger.log(Level.SEVERE, "There's already a server running on " logger.log(Level.SEVERE, "There's already a server running on "
+ serverPort + " port that can't be shutdown."); + serverPort + " port that can't be shutdown.");
if (!Server.available(serverPort)) { if (!Server.isPortAvailable(serverPort)) {
reportPortError(serverPort); reportPortError(serverPort);
} else if (!Server.available(serverStopPort)) { } else if (!Server.isPortAvailable(serverStopPort)) {
reportStopPortError(serverStopPort); reportStopPortError(serverStopPort);
} else { } else {
//some other reason //some other reason
@ -95,7 +95,7 @@ class Installer extends ModuleInstall {
//TODO move some of this logic to Server class //TODO move some of this logic to Server class
for (int i = 0; i <= 3; i++) { for (int i = 0; i <= 3; i++) {
logger.log(Level.INFO, "Checking if port available."); logger.log(Level.INFO, "Checking if port available.");
if (Server.available(server.getCurrentSolrServerPort())) { if (Server.isPortAvailable(server.getCurrentSolrServerPort())) {
logger.log(Level.INFO, "Port available, trying to start server."); logger.log(Level.INFO, "Port available, trying to start server.");
server.start(); server.start();
break; break;
@ -165,9 +165,9 @@ class Installer extends ModuleInstall {
//check if port is taken or some other reason //check if port is taken or some other reason
int serverPort = server.getCurrentSolrServerPort(); int serverPort = server.getCurrentSolrServerPort();
int serverStopPort = server.getCurrentSolrStopPort(); int serverStopPort = server.getCurrentSolrStopPort();
if (!Server.available(serverPort)) { if (!Server.isPortAvailable(serverPort)) {
reportPortError(serverPort); reportPortError(serverPort);
} else if (!Server.available(serverStopPort)) { } else if (!Server.isPortAvailable(serverStopPort)) {
reportStopPortError(serverStopPort); reportStopPortError(serverStopPort);
} else { } else {
//some other reason //some other reason

View File

@ -126,7 +126,7 @@ public class KeywordSearch {
Object newValue = evt.getNewValue(); Object newValue = evt.getNewValue();
final Logger logger = Logger.getLogger(CaseChangeListener.class.getName()); final Logger logger = Logger.getLogger(CaseChangeListener.class.getName());
if (changed.equals(Case.CASE_CURRENT_CASE)) { if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
if (newValue != null) { if (newValue != null) {
// new case is open // new case is open
try { try {

View File

@ -30,6 +30,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.CancellationException; import java.util.concurrent.CancellationException;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.logging.Level; import java.util.logging.Level;
@ -361,8 +362,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAbstractFile {
logger.log(Level.SEVERE, msg); logger.log(Level.SEVERE, msg);
String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg); String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg);
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details)); services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details));
return; throw new IngestModuleException(msg);
} }
} catch (KeywordSearchModuleException ex) { } catch (KeywordSearchModuleException ex) {
logger.log(Level.WARNING, "Error checking if Solr server is running while initializing ingest", ex); logger.log(Level.WARNING, "Error checking if Solr server is running while initializing ingest", ex);
@ -370,9 +370,15 @@ public final class KeywordSearchIngestModule extends IngestModuleAbstractFile {
String msg = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.badInitMsg"); String msg = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.badInitMsg");
String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg); String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg);
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details)); services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details));
return; throw new IngestModuleException(msg);
}
try {
// make an actual query to verify that server is responding
// we had cases where getStatus was OK, but the connection resulted in a 404
server.queryNumIndexedDocuments();
} catch (KeywordSearchModuleException | NoOpenCoreException ex) {
throw new IngestModuleException("Error connecting to SOLR server: " + ex.getMessage());
} }
//initialize extractors //initialize extractors
stringExtractor = new AbstractFileStringExtract(); stringExtractor = new AbstractFileStringExtract();
@ -1178,6 +1184,18 @@ public final class KeywordSearchIngestModule extends IngestModuleAbstractFile {
return null; return null;
} }
@Override
protected void done() {
// call get to see if there were any errors
try {
get();
}
catch (InterruptedException | ExecutionException e) {
logger.log(Level.SEVERE, "Error performing keyword search: " + e.getMessage());
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, "Error performing keyword search", e.getMessage()));
}
}
/** /**
* Sync-up the updated keywords from the currently used lists in the XML * Sync-up the updated keywords from the currently used lists in the XML
*/ */

View File

@ -395,7 +395,7 @@ class KeywordSearchPanel extends AbstractKeywordSearchPerformer {
Object oldValue = evt.getOldValue(); Object oldValue = evt.getOldValue();
Object newValue = evt.getNewValue(); Object newValue = evt.getNewValue();
if (changed.equals(Case.CASE_CURRENT_CASE)) { if (changed.equals(Case.Events.CURRENT_CASE.toString())) {
resetSearchBox(); resetSearchBox();
if (newValue == null) { if (newValue == null) {
setFields(false); setFields(false);

View File

@ -25,6 +25,7 @@ import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.locks.ReentrantReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.logging.Level; import java.util.logging.Level;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
@ -36,6 +37,7 @@ import org.openide.nodes.ChildFactory;
import org.openide.nodes.Children; import org.openide.nodes.Children;
import org.openide.nodes.Node; import org.openide.nodes.Node;
import org.openide.util.Cancellable; import org.openide.util.Cancellable;
import org.openide.util.Exceptions;
import org.openide.util.lookup.Lookups; import org.openide.util.lookup.Lookups;
import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer; import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent; import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
@ -614,6 +616,16 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQuery> {
return null; return null;
} }
@Override
protected void done() {
try {
// test if any exceptions were thrown
get();
} catch (InterruptedException | ExecutionException ex) {
logger.log(Level.SEVERE, "Error querying ", ex);
}
}
private static synchronized void registerWriter(ResultWriter writer) { private static synchronized void registerWriter(ResultWriter writer) {
writers.add(writer); writers.add(writer);
} }

View File

@ -350,7 +350,7 @@ public class Server {
*/ */
void start() throws KeywordSearchModuleException, SolrServerNoPortException { void start() throws KeywordSearchModuleException, SolrServerNoPortException {
logger.log(Level.INFO, "Starting Solr server from: " + solrFolder.getAbsolutePath()); logger.log(Level.INFO, "Starting Solr server from: " + solrFolder.getAbsolutePath());
if (available(currentSolrServerPort)) { if (isPortAvailable(currentSolrServerPort)) {
logger.log(Level.INFO, "Port [" + currentSolrServerPort + "] available, starting Solr"); logger.log(Level.INFO, "Port [" + currentSolrServerPort + "] available, starting Solr");
try { try {
final String MAX_SOLR_MEM_MB_PAR = "-Xmx" + Integer.toString(MAX_SOLR_MEM_MB) + "m"; final String MAX_SOLR_MEM_MB_PAR = "-Xmx" + Integer.toString(MAX_SOLR_MEM_MB) + "m";
@ -419,7 +419,7 @@ public class Server {
* *
* @param port the port to check for availability * @param port the port to check for availability
*/ */
static boolean available(int port) { static boolean isPortAvailable(int port) {
ServerSocket ss = null; ServerSocket ss = null;
try { try {
@ -524,6 +524,7 @@ public class Server {
//TODO handle timeout in cases when some other type of server on that port //TODO handle timeout in cases when some other type of server on that port
CoreAdminRequest.getStatus(null, solrServer); CoreAdminRequest.getStatus(null, solrServer);
logger.log(Level.INFO, "Solr server is running"); logger.log(Level.INFO, "Solr server is running");
} catch (SolrServerException ex) { } catch (SolrServerException ex) {

View File

@ -326,6 +326,7 @@ public final class SevenZipIngestModule extends IngestModuleAbstractFile {
int processedItems = 0; int processedItems = 0;
String compressMethod = null; String compressMethod = null;
boolean progressStarted = false;
try { try {
stream = new SevenZipContentReadStream(new ReadContentInputStream(archiveFile)); stream = new SevenZipContentReadStream(new ReadContentInputStream(archiveFile));
inArchive = SevenZip.openInArchive(null, // autodetect archive type inArchive = SevenZip.openInArchive(null, // autodetect archive type
@ -335,6 +336,7 @@ public final class SevenZipIngestModule extends IngestModuleAbstractFile {
logger.log(Level.INFO, "Count of items in archive: " + archiveFile.getName() + ": " logger.log(Level.INFO, "Count of items in archive: " + archiveFile.getName() + ": "
+ numItems); + numItems);
progress.start(numItems); progress.start(numItems);
progressStarted = true;
final ISimpleInArchive simpleInArchive = inArchive.getSimpleInterface(); final ISimpleInArchive simpleInArchive = inArchive.getSimpleInterface();
@ -524,11 +526,12 @@ public final class SevenZipIngestModule extends IngestModuleAbstractFile {
fullName = archiveFile.getName(); fullName = archiveFile.getName();
} }
String msg = "Error unpacking " + archiveFile.getName(); // print a message if the file is allocated
String details = "Error unpacking (" + if (archiveFile.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.ALLOC)) {
(archiveFile.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.ALLOC) ? "allocated" : "deleted") + ") " + fullName String msg = "Error unpacking " + archiveFile.getName();
+ ". " + ex.getMessage(); String details = "Error unpacking " + fullName + ". " + ex.getMessage();
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details)); services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details));
}
} finally { } finally {
if (inArchive != null) { if (inArchive != null) {
try { try {
@ -547,7 +550,8 @@ public final class SevenZipIngestModule extends IngestModuleAbstractFile {
} }
//close progress bar //close progress bar
progress.finish(); if (progressStarted)
progress.finish();
} }
//create artifact and send user message //create artifact and send user message
@ -607,22 +611,36 @@ public final class SevenZipIngestModule extends IngestModuleAbstractFile {
} }
private boolean isSupported(AbstractFile file) { private boolean isSupported(AbstractFile file) {
String fileNameLower = file.getName().toLowerCase(); // see if it is on the list of extensions
int dotI = fileNameLower.lastIndexOf("."); final String extension = file.getNameExtension();
if (dotI == -1 || dotI == fileNameLower.length() - 1) {
return false; //no extension
}
final String extension = fileNameLower.substring(dotI + 1);
for (int i = 0; i < SUPPORTED_EXTENSIONS.length; ++i) { for (int i = 0; i < SUPPORTED_EXTENSIONS.length; ++i) {
if (extension.equals(SUPPORTED_EXTENSIONS[i])) { if (extension.equals(SUPPORTED_EXTENSIONS[i])) {
return true; return true;
} }
} }
//if no extension match, check for zip signature // if no extension match, check the blackboard for the file type
//(note, in near future, we will use pre-detected content type) boolean attributeFound = false;
return isZipFileHeader(file); try {
ArrayList<BlackboardAttribute> attributes = file.getGenInfoAttributes(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_FILE_TYPE_SIG);
for (BlackboardAttribute attribute : attributes) {
attributeFound = true;
String fileType = attribute.getValueString();
if (!fileType.isEmpty() && fileType.equals("application/zip")) {
return true;
}
}
} catch (TskCoreException ex) {
}
// if no blackboard entry for file type, do it manually for ZIP files:
if (attributeFound) {
return false;
}
else {
return isZipFileHeader(file);
}
} }
/** /**

View File

@ -613,7 +613,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
String prop = evt.getPropertyName(); String prop = evt.getPropertyName();
if (prop.equals(Case.CASE_ADD_DATA_SOURCE)) { if (prop.equals(Case.Events.DATA_SOURCE_ADDED.toString())) {
if (mainFrame != null && !mainFrame.isVisible()) { if (mainFrame != null && !mainFrame.isVisible()) {
// change the lastObjectId to trigger a reparse of mactime barData // change the lastObjectId to trigger a reparse of mactime barData
++lastObjectId; ++lastObjectId;
@ -629,7 +629,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar,
// call performAction as if the user selected 'Make Timeline' from the menu // call performAction as if the user selected 'Make Timeline' from the menu
performAction(); performAction();
} else if (prop.equals(Case.CASE_CURRENT_CASE)) { } else if (prop.equals(Case.Events.CURRENT_CASE.toString())) {
if (mainFrame != null && mainFrame.isVisible()) { if (mainFrame != null && mainFrame.isVisible()) {
mainFrame.dispose(); mainFrame.dispose();
mainFrame = null; mainFrame = null;

View File

@ -83,17 +83,22 @@
<target name="copyExternalLibsToZip" depends="copyCRT32,copyCRT64"/> <target name="copyExternalLibsToZip" depends="copyCRT32,copyCRT64"/>
<target name="copyCRT32"> <target name="copyCRT32">
<property name="CRT.path" value="${thirdparty.dir}/crt/win32/crt.zip"/>
<available file="${CRT.path}" property="crtFound"/>
<fail unless="crtFound" message="CRT not found in the thirdparty repo in path: ${CRT.path}"/> <!-- verify we have the 32-bit dlls -->
<property name="CRT32.path" value="${thirdparty.dir}/crt/win32"/>
<available file="${CRT32.path}" property="crtFound"/>
<fail unless="crtFound" message="32-bit CRT not found in the thirdparty repo in path: ${CRT32.path}"/>
<!-- copy them from third party -->
<property name="zip-lib-path" value="${zip-tmp}/${app.name}/${app.name}/modules/lib/"/> <property name="zip-lib-path" value="${zip-tmp}/${app.name}/${app.name}/modules/lib/"/>
<unzip src="${CRT.path}" dest="${zip-lib-path}/x86" overwrite="true"/> <fileset dir="${CRT32.path}" id="crt32dlls">
<fileset dir="${zip-lib-path}/x86" id="crt32dlls">
<include name="*.dll"/> <include name="*.dll"/>
</fileset> </fileset>
<copy todir="${zip-lib-path}/x86" overwrite="true">
<fileset refid="crt32dlls"/>
</copy>
<copy todir="${zip-lib-path}/i386" overwrite="true"> <copy todir="${zip-lib-path}/i386" overwrite="true">
<fileset refid="crt32dlls"/> <fileset refid="crt32dlls"/>
</copy> </copy>
@ -108,19 +113,23 @@
</target> </target>
<target name="copyCRT64"> <target name="copyCRT64">
<property name="CRT.path" value="${thirdparty.dir}/crt/win64/crt.zip"/> <!-- Verify we have the 64-bit -->
<available file="${CRT.path}" property="crtFound"/> <property name="CRT64.path" value="${thirdparty.dir}/crt/win64"/>
<available file="${CRT64.path}" property="crtFound"/>
<fail unless="crtFound" message="CRT not found in the thirdparty repo in path: ${CRT.path}"/> <fail unless="crtFound" message="64-bit CRT not found in the thirdparty repo in path: ${CRT64.path}"/>
<!-- Copy the libs -->
<property name="zip-lib-path" value="${zip-tmp}/${app.name}/${app.name}/modules/lib/"/> <property name="zip-lib-path" value="${zip-tmp}/${app.name}/${app.name}/modules/lib/"/>
<unzip src="${CRT.path}" dest="${zip-lib-path}/x86_64" overwrite="true"/> <fileset dir="${CRT64.path}" id="crt64dlls">
<fileset dir="${zip-lib-path}/x86_64" id="crt32dlls">
<include name="*.dll"/> <include name="*.dll"/>
</fileset> </fileset>
<copy todir="${zip-lib-path}/x86_64" overwrite="true">
<fileset refid="crt64dlls"/>
</copy>
<copy todir="${zip-lib-path}/amd64" overwrite="true"> <copy todir="${zip-lib-path}/amd64" overwrite="true">
<fileset refid="crt32dlls"/> <fileset refid="crt64dlls"/>
</copy> </copy>
</target> </target>

View File

@ -16,4 +16,6 @@ Autopsy has two types of native libraries:
The libraries that <tt>libtsk_jni</tt> depends on are launched by Autopsy in the Installer.loadDynLibraries() method. This is because if we wait until <tt>libtsk_jni</tt> needs them, then they will be located based on Windows search paths and the NetBeans paths are not in that set. So, we launch them before <tt>libtsk_jni</tt> needs them and from within Autopsy so that it uses the Autopsy search pathes. The libraries that <tt>libtsk_jni</tt> depends on are launched by Autopsy in the Installer.loadDynLibraries() method. This is because if we wait until <tt>libtsk_jni</tt> needs them, then they will be located based on Windows search paths and the NetBeans paths are not in that set. So, we launch them before <tt>libtsk_jni</tt> needs them and from within Autopsy so that it uses the Autopsy search pathes.
There is code in build-windows.xml and build-unix.xml to copy the external libraries into their respective locations when a ZIP package is made of the program. These libraries must be accessible via normal launching methods when developing Autopsy (i.e. we only copy them into the Autopsy structure when building the ZIP).
*/ */

7
thirdparty/crt/update.bat vendored Normal file
View File

@ -0,0 +1,7 @@
REM Updates the 32-bit and 64-bit VS Runtime dlls
REM Needs to be run from a 64-bit command prompt
REM Otherwise Windows will put 32-bit dlls in system32
copy c:\windows\system32\msvcr100.dll win64
copy c:\windows\system32\msvcp100.dll win64
copy c:\windows\sysWoW64\msvcr100.dll win32
copy c:\windows\sysWow64\msvcp100.dll win32

Binary file not shown.

BIN
thirdparty/crt/win32/msvcp100.dll vendored Executable file

Binary file not shown.

BIN
thirdparty/crt/win32/msvcr100.dll vendored Executable file

Binary file not shown.

Binary file not shown.

BIN
thirdparty/crt/win64/msvcp100.dll vendored Executable file

Binary file not shown.

BIN
thirdparty/crt/win64/msvcr100.dll vendored Executable file

Binary file not shown.