diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java index 2dc6861360..29c5a2bae1 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/Case.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/Case.java @@ -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 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 * startup @@ -114,69 +74,53 @@ public class Case implements SleuthkitCase.ErrorObserver { * 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. */ - /* @@@ BC: I added this as a place holder for what I want this to be, but - * 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"), - + public enum Events { /** - * Property name that indicates the currently open case has changed. The new - * value is the instance of the opened Case, or null if there is no open - * case. The old value is the instance of the closed Case, or null if there - * was no open case. + * 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. */ - CASE_CURRENT_CASE("currentCase"); - - private String name; - CaseModuleEvent_DoNotUse(String name) { - this.name = name; - } - - public String getName() { - return this.name; - } + // @@@ BC: I propose that this is no longer called for case open/close. + NAME, + /** + * 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. + */ + NUMBER, + /** + * 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 number; private String examiner; @@ -244,7 +188,7 @@ public class Case implements SleuthkitCase.ErrorObserver { doCaseChange(null); //closes windows, etc try { - pcs.firePropertyChange(CASE_CURRENT_CASE, oldCase, null); + pcs.firePropertyChange(Events.CURRENT_CASE.toString(), oldCase, null); } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); @@ -253,7 +197,7 @@ public class Case implements SleuthkitCase.ErrorObserver { doCaseNameChange(""); try { - pcs.firePropertyChange(CASE_NAME, oldCase.name, ""); + pcs.firePropertyChange(Events.NAME.toString(), oldCase.name, ""); } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); @@ -266,7 +210,7 @@ public class Case implements SleuthkitCase.ErrorObserver { try { - pcs.firePropertyChange(CASE_CURRENT_CASE, null, currentCase); + pcs.firePropertyChange(Events.CURRENT_CASE.toString(), null, currentCase); } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); @@ -276,7 +220,7 @@ public class Case implements SleuthkitCase.ErrorObserver { try { - pcs.firePropertyChange(CASE_NAME, "", currentCase.name); + pcs.firePropertyChange(Events.NAME.toString(), "", currentCase.name); } catch (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); 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) { logger.log(Level.SEVERE, "Case listener threw exception", e); @@ -475,7 +419,7 @@ public class Case implements SleuthkitCase.ErrorObserver { void notifyNewDataSource(Content newDataSource) { try { - pcs.firePropertyChange(CASE_ADD_DATA_SOURCE, null, newDataSource); + pcs.firePropertyChange(Events.DATA_SOURCE_ADDED.toString(), null, newDataSource); } catch (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 RecentCases.getInstance().updateRecentCase(oldCaseName, oldPath, newCaseName, newPath); // update the recent case try { - pcs.firePropertyChange(CASE_NAME, oldCaseName, newCaseName); + pcs.firePropertyChange(Events.NAME.toString(), oldCaseName, newCaseName); } catch (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 examiner = newExaminer; try { - pcs.firePropertyChange(CASE_EXAMINER, oldExaminer, newExaminer); + pcs.firePropertyChange(Events.EXAMINER.toString(), oldExaminer, newExaminer); } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); @@ -603,7 +547,7 @@ public class Case implements SleuthkitCase.ErrorObserver { number = newCaseNumber; try { - pcs.firePropertyChange(CASE_NUMBER, oldCaseNumber, newCaseNumber); + pcs.firePropertyChange(Events.NUMBER.toString(), oldCaseNumber, newCaseNumber); } catch (Exception e) { logger.log(Level.SEVERE, "Case listener threw exception", e); diff --git a/Core/src/org/sleuthkit/autopsy/core/Installer.java b/Core/src/org/sleuthkit/autopsy/core/Installer.java index c1b9c2e29b..38f6862352 100644 --- a/Core/src/org/sleuthkit/autopsy/core/Installer.java +++ b/Core/src/org/sleuthkit/autopsy/core/Installer.java @@ -48,8 +48,11 @@ public class Installer extends ModuleInstall { * If libtsk_jni tries to load them, they will not be found by * Windows because they are in special NetBeans folders. So, we * manually load them from within Autopsy so that they are found - * via the NetBeans loading setup. - * On other platforms, we assume the dependncies are all installed + * via the NetBeans loading setup. These are copied by the build + * 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). */ if (PlatformUtil.isWindowsOS()) { diff --git a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java index 6cde1ad2a2..eac9dd763a 100644 --- a/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java +++ b/Core/src/org/sleuthkit/autopsy/corecomponents/DataResultViewerTable.java @@ -236,6 +236,10 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer; return true; } + /** + * Thread note: Make sure to run this in the EDT as it causes GUI operations. + * @param selectedNode + */ @Override public void setNode(Node selectedNode) { // change the cursor to "waiting cursor" for this operation diff --git a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java index 2f6fc03f22..ae09e6cffa 100644 --- a/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/directorytree/DirectoryTreeTopComponent.java @@ -516,7 +516,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat Object newValue = evt.getNewValue(); // 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 String oldCaseName = oldValue.toString(); String newCaseName = newValue.toString(); @@ -529,7 +529,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat em.getRootContext().setDisplayName(newCaseName); } } // 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 // 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 @@ -553,7 +553,7 @@ public final class DirectoryTreeTopComponent extends TopComponent implements Dat resetHistory(); } } // 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(); // Image img = (Image)newValue; // diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java b/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java index d945207ba8..d61c174358 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/DateSearchFilter.java @@ -239,7 +239,7 @@ class DateSearchFilter extends AbstractFileSearchFilter { Object oldValue = evt.getOldValue(); 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 if (newValue != null) { DateSearchFilter.this.updateTimeZoneList(); @@ -247,12 +247,12 @@ class DateSearchFilter extends AbstractFileSearchFilter { } // 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(); } // 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(); } } diff --git a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java index 52b7f69991..c6b2e28697 100644 --- a/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java +++ b/Core/src/org/sleuthkit/autopsy/filesearch/FileSearchAction.java @@ -38,7 +38,7 @@ import org.sleuthkit.autopsy.directorytree.FileSearchProvider; @Override 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); } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java index d4a9ab9cce..c37ef96c28 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessageTopComponent.java @@ -213,7 +213,7 @@ import org.sleuthkit.datamodel.Content; Case.addPropertyChangeListener(new PropertyChangeListener() { @Override 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(); if (oldCase == null) //nothing to do, new case had been opened { diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagesToolbar.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagesToolbar.java index f817383595..fcc9861f22 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagesToolbar.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMessagesToolbar.java @@ -143,7 +143,7 @@ import org.sleuthkit.autopsy.casemodule.Case; Case.addPropertyChangeListener(new PropertyChangeListener() { @Override 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); } } diff --git a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java index b483c3d35c..1eee1baf25 100644 --- a/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java +++ b/Core/src/org/sleuthkit/autopsy/ingest/IngestMonitor.java @@ -123,7 +123,7 @@ import org.sleuthkit.autopsy.coreutils.PlatformUtil; String changed = evt.getPropertyName(); Object newValue = evt.getNewValue(); - if (changed.equals(Case.CASE_CURRENT_CASE)) { + if (changed.equals(Case.Events.CURRENT_CASE.toString())) { if (newValue != null) { setMonitorDir(); } diff --git a/Core/src/org/sleuthkit/autopsy/menuactions/DataResultMenu.java b/Core/src/org/sleuthkit/autopsy/menuactions/DataResultMenu.java index 098f6fd0b5..682d6f62f8 100644 --- a/Core/src/org/sleuthkit/autopsy/menuactions/DataResultMenu.java +++ b/Core/src/org/sleuthkit/autopsy/menuactions/DataResultMenu.java @@ -49,7 +49,7 @@ import org.sleuthkit.autopsy.casemodule.Case; Object oldValue = evt.getOldValue(); Object newValue = evt.getNewValue(); - if (changed.equals(Case.CASE_CURRENT_CASE)) { + if (changed.equals(Case.Events.CURRENT_CASE.toString())) { if (newValue != null) { // enable all menus when a case is created / opened int totalMenus = menu.getItemCount(); diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java b/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java index 23d9020de1..9a3942b225 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportWizardAction.java @@ -83,7 +83,7 @@ public final class ReportWizardAction extends CallableSystemAction implements P Case.addPropertyChangeListener(new PropertyChangeListener() { @Override 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(); setEnabled(newCase != null); diff --git a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbPanelSearchAction.java b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbPanelSearchAction.java index 732ad2908d..e9989e715f 100644 --- a/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbPanelSearchAction.java +++ b/HashDatabase/src/org/sleuthkit/autopsy/hashdatabase/HashDbPanelSearchAction.java @@ -47,7 +47,7 @@ class HashDbPanelSearchAction extends CallableSystemAction { @Override 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); } } diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Installer.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Installer.java index 44689e819e..f38b9fdd81 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Installer.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Installer.java @@ -66,9 +66,9 @@ class Installer extends ModuleInstall { int serverStopPort = server.getCurrentSolrStopPort(); logger.log(Level.SEVERE, "There's already a server running on " + serverPort + " port that can't be shutdown."); - if (!Server.available(serverPort)) { + if (!Server.isPortAvailable(serverPort)) { reportPortError(serverPort); - } else if (!Server.available(serverStopPort)) { + } else if (!Server.isPortAvailable(serverStopPort)) { reportStopPortError(serverStopPort); } else { //some other reason @@ -95,7 +95,7 @@ class Installer extends ModuleInstall { //TODO move some of this logic to Server class for (int i = 0; i <= 3; i++) { 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."); server.start(); break; @@ -165,9 +165,9 @@ class Installer extends ModuleInstall { //check if port is taken or some other reason int serverPort = server.getCurrentSolrServerPort(); int serverStopPort = server.getCurrentSolrStopPort(); - if (!Server.available(serverPort)) { + if (!Server.isPortAvailable(serverPort)) { reportPortError(serverPort); - } else if (!Server.available(serverStopPort)) { + } else if (!Server.isPortAvailable(serverStopPort)) { reportStopPortError(serverStopPort); } else { //some other reason diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java index afbec2d84c..59f218fc09 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearch.java @@ -126,7 +126,7 @@ public class KeywordSearch { Object newValue = evt.getNewValue(); 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) { // new case is open try { diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java index 821999419c..7220d4d485 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchIngestModule.java @@ -44,6 +44,7 @@ import org.netbeans.api.progress.aggregate.AggregateProgressFactory; import org.netbeans.api.progress.aggregate.AggregateProgressHandle; import org.netbeans.api.progress.aggregate.ProgressContributor; import org.openide.util.Cancellable; +import org.openide.util.Exceptions; import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; @@ -361,8 +362,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAbstractFile { logger.log(Level.SEVERE, msg); String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg); services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details)); - return; - + throw new IngestModuleException(msg); } } catch (KeywordSearchModuleException 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 details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg); 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 stringExtractor = new AbstractFileStringExtract(); @@ -415,7 +421,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAbstractFile { curDataSourceIds = new HashSet(); indexer = new Indexer(); - + final int updateIntervalMs = KeywordSearchSettings.getUpdateFrequency().getTime() * 60 * 1000; logger.log(Level.INFO, "Using commit interval (ms): " + updateIntervalMs); logger.log(Level.INFO, "Using searcher interval (ms): " + updateIntervalMs); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchPanel.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchPanel.java index 65de59f22d..3dd2b3f14f 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchPanel.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/KeywordSearchPanel.java @@ -395,7 +395,7 @@ class KeywordSearchPanel extends AbstractKeywordSearchPerformer { Object oldValue = evt.getOldValue(); Object newValue = evt.getNewValue(); - if (changed.equals(Case.CASE_CURRENT_CASE)) { + if (changed.equals(Case.Events.CURRENT_CASE.toString())) { resetSearchBox(); if (newValue == null) { setFields(false); diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java index d78a630112..998d25f24c 100644 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/Server.java @@ -350,7 +350,7 @@ public class Server { */ void start() throws KeywordSearchModuleException, SolrServerNoPortException { 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"); try { 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 */ - static boolean available(int port) { + static boolean isPortAvailable(int port) { ServerSocket ss = null; try { @@ -524,6 +524,7 @@ public class Server { //TODO handle timeout in cases when some other type of server on that port CoreAdminRequest.getStatus(null, solrServer); + logger.log(Level.INFO, "Solr server is running"); } catch (SolrServerException ex) { diff --git a/SevenZip/src/org/sleuthkit/autopsy/sevenzip/SevenZipIngestModule.java b/SevenZip/src/org/sleuthkit/autopsy/sevenzip/SevenZipIngestModule.java index 861e7e4828..0d4637221e 100644 --- a/SevenZip/src/org/sleuthkit/autopsy/sevenzip/SevenZipIngestModule.java +++ b/SevenZip/src/org/sleuthkit/autopsy/sevenzip/SevenZipIngestModule.java @@ -326,6 +326,7 @@ public final class SevenZipIngestModule extends IngestModuleAbstractFile { int processedItems = 0; String compressMethod = null; + boolean progressStarted = false; try { stream = new SevenZipContentReadStream(new ReadContentInputStream(archiveFile)); 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() + ": " + numItems); progress.start(numItems); + progressStarted = true; final ISimpleInArchive simpleInArchive = inArchive.getSimpleInterface(); @@ -524,11 +526,12 @@ public final class SevenZipIngestModule extends IngestModuleAbstractFile { fullName = archiveFile.getName(); } - String msg = "Error unpacking " + archiveFile.getName(); - String details = "Error unpacking (" + - (archiveFile.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.ALLOC) ? "allocated" : "deleted") + ") " + fullName - + ". " + ex.getMessage(); - services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details)); + // print a message if the file is allocated + if (archiveFile.isMetaFlagSet(TskData.TSK_FS_META_FLAG_ENUM.ALLOC)) { + String msg = "Error unpacking " + archiveFile.getName(); + String details = "Error unpacking " + fullName + ". " + ex.getMessage(); + services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, msg, details)); + } } finally { if (inArchive != null) { try { @@ -547,7 +550,8 @@ public final class SevenZipIngestModule extends IngestModuleAbstractFile { } //close progress bar - progress.finish(); + if (progressStarted) + progress.finish(); } //create artifact and send user message @@ -607,22 +611,36 @@ public final class SevenZipIngestModule extends IngestModuleAbstractFile { } private boolean isSupported(AbstractFile file) { - String fileNameLower = file.getName().toLowerCase(); - int dotI = fileNameLower.lastIndexOf("."); - if (dotI == -1 || dotI == fileNameLower.length() - 1) { - return false; //no extension - } - - final String extension = fileNameLower.substring(dotI + 1); + // see if it is on the list of extensions + final String extension = file.getNameExtension(); for (int i = 0; i < SUPPORTED_EXTENSIONS.length; ++i) { if (extension.equals(SUPPORTED_EXTENSIONS[i])) { return true; } } + + // if no extension match, check the blackboard for the file type + boolean attributeFound = false; + try { + ArrayList 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 extension match, check for zip signature - //(note, in near future, we will use pre-detected content type) - return isZipFileHeader(file); + // if no blackboard entry for file type, do it manually for ZIP files: + if (attributeFound) { + return false; + } + else { + return isZipFileHeader(file); + } } /** diff --git a/Timeline/src/org/sleuthkit/autopsy/timeline/Timeline.java b/Timeline/src/org/sleuthkit/autopsy/timeline/Timeline.java index af031d8439..479b98cfe0 100644 --- a/Timeline/src/org/sleuthkit/autopsy/timeline/Timeline.java +++ b/Timeline/src/org/sleuthkit/autopsy/timeline/Timeline.java @@ -613,7 +613,7 @@ public class Timeline extends CallableSystemAction implements Presenter.Toolbar, @Override public void propertyChange(PropertyChangeEvent evt) { 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()) { // change the lastObjectId to trigger a reparse of mactime barData ++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 performAction(); - } else if (prop.equals(Case.CASE_CURRENT_CASE)) { + } else if (prop.equals(Case.Events.CURRENT_CASE.toString())) { if (mainFrame != null && mainFrame.isVisible()) { mainFrame.dispose(); mainFrame = null; diff --git a/build-windows.xml b/build-windows.xml index 06cba8fa66..9eb85a06c4 100644 --- a/build-windows.xml +++ b/build-windows.xml @@ -83,16 +83,21 @@ - - - - + + + + + + - - + + + + + @@ -108,19 +113,23 @@ - - - - + + + + + - - + + + + + - + diff --git a/docs/doxygen/native_libs.dox b/docs/doxygen/native_libs.dox index 91e4e319fa..9a8dda376a 100644 --- a/docs/doxygen/native_libs.dox +++ b/docs/doxygen/native_libs.dox @@ -16,4 +16,6 @@ Autopsy has two types of native libraries: The libraries that libtsk_jni depends on are launched by Autopsy in the Installer.loadDynLibraries() method. This is because if we wait until libtsk_jni 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 libtsk_jni 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). + */ diff --git a/thirdparty/crt/update.bat b/thirdparty/crt/update.bat new file mode 100644 index 0000000000..fd1c6daec2 --- /dev/null +++ b/thirdparty/crt/update.bat @@ -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 diff --git a/thirdparty/crt/win32/crt.zip b/thirdparty/crt/win32/crt.zip deleted file mode 100755 index a771033d47..0000000000 Binary files a/thirdparty/crt/win32/crt.zip and /dev/null differ diff --git a/thirdparty/crt/win32/msvcp100.dll b/thirdparty/crt/win32/msvcp100.dll new file mode 100755 index 0000000000..8502dfae5e Binary files /dev/null and b/thirdparty/crt/win32/msvcp100.dll differ diff --git a/thirdparty/crt/win32/msvcr100.dll b/thirdparty/crt/win32/msvcr100.dll new file mode 100755 index 0000000000..3e82b1aeac Binary files /dev/null and b/thirdparty/crt/win32/msvcr100.dll differ diff --git a/thirdparty/crt/win64/crt.zip b/thirdparty/crt/win64/crt.zip deleted file mode 100755 index a22a29a142..0000000000 Binary files a/thirdparty/crt/win64/crt.zip and /dev/null differ diff --git a/thirdparty/crt/win64/msvcp100.dll b/thirdparty/crt/win64/msvcp100.dll new file mode 100755 index 0000000000..6f0cdf160a Binary files /dev/null and b/thirdparty/crt/win64/msvcp100.dll differ diff --git a/thirdparty/crt/win64/msvcr100.dll b/thirdparty/crt/win64/msvcr100.dll new file mode 100755 index 0000000000..b1c3a5e77c Binary files /dev/null and b/thirdparty/crt/win64/msvcr100.dll differ