diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java index cb2e098be1..900a355bf0 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CaseCloseAction.java @@ -83,7 +83,6 @@ import org.openide.util.actions.Presenter; */ @Override public void actionPerformed(ActionEvent e) { - CueBannerPanel.refresh(); if (Case.existsCurrentCase() == false) return; diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.form b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.form index b1274c117a..57670e96aa 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.form +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.form @@ -126,9 +126,6 @@ - - - @@ -149,9 +146,6 @@ - - - diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java index 103d19c488..d5a974a587 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/CueBannerPanel.java @@ -47,6 +47,7 @@ public class CueBannerPanel extends javax.swing.JPanel { public CueBannerPanel() { initComponents(); + refresh(); } public CueBannerPanel(String welcomeLogo) { @@ -179,7 +180,7 @@ public class CueBannerPanel extends javax.swing.JPanel { ); }// //GEN-END:initComponents - public static void refresh() { + public void refresh() { if (RecentCases.getInstance().getTotalRecentCases() == 0) { openRecentButton.setEnabled(false); openRecentLabel.setEnabled(false); @@ -236,8 +237,8 @@ public class CueBannerPanel extends javax.swing.JPanel { private javax.swing.JButton newCaseButton; private javax.swing.JButton openCaseButton; private javax.swing.JLabel openLabel; - private static javax.swing.JButton openRecentButton; - private static javax.swing.JLabel openRecentLabel; + private javax.swing.JButton openRecentButton; + private javax.swing.JLabel openRecentLabel; // End of variables declaration//GEN-END:variables /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java index b274c851a1..caff6ed884 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/StartupWindow.java @@ -40,6 +40,7 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa private static StartupWindow instance; private static final String TITLE = NbBundle.getMessage(StartupWindow.class, "StartupWindow.title.text"); private static Dimension DIMENSIONS = new Dimension(750, 400); + private static CueBannerPanel welcomeWindow; public StartupWindow() { super(WindowManager.getDefault().getMainWindow(), TITLE, true); @@ -62,8 +63,7 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa // set the location of the popUp Window on the center of the screen setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2); - CueBannerPanel welcomeWindow = new CueBannerPanel(); - welcomeWindow.refresh(); + welcomeWindow = new CueBannerPanel(); // add the command to close the window to the button on the Volume Detail Panel welcomeWindow.setCloseButtonActionListener(new ActionListener() { @@ -82,6 +82,7 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa @Override public void open() { + welcomeWindow.refresh(); setVisible(true); } diff --git a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java index ee1021944b..6431f4ab87 100644 --- a/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java +++ b/Core/src/org/sleuthkit/autopsy/modules/stix/STIXReportModule.java @@ -59,6 +59,7 @@ import org.mitre.cybox.objects.DomainName; import org.mitre.cybox.objects.WindowsRegistryKey; import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; import org.sleuthkit.autopsy.coreutils.ModuleSettings; +import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus; /** * @@ -120,7 +121,7 @@ public class STIXReportModule implements GeneralReportModule { "STIXReportModule.notifyMsg.unableToOpenReportFile", reportPath), MessageNotifyUtil.MessageType.ERROR); - progressPanel.complete(); + progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.completedWithErrors")); return; @@ -135,7 +136,7 @@ public class STIXReportModule implements GeneralReportModule { logger.log(Level.SEVERE, "STIXReportModuleConfigPanel.stixFile not initialized "); //NON-NLS MessageNotifyUtil.Message.error( NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyErr.noFildDirProvided")); - progressPanel.complete(); + progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.noFildDirProvided")); return; @@ -144,7 +145,7 @@ public class STIXReportModule implements GeneralReportModule { logger.log(Level.SEVERE, "No STIX file/directory provided "); //NON-NLS MessageNotifyUtil.Message.error( NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyErr.noFildDirProvided")); - progressPanel.complete(); + progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.noFildDirProvided")); return; @@ -156,7 +157,7 @@ public class STIXReportModule implements GeneralReportModule { MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyMsg.unableToOpenFileDir", stixFileName)); - progressPanel.complete(); + progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.couldNotOpenFileDir", stixFileName)); return; @@ -201,10 +202,12 @@ public class STIXReportModule implements GeneralReportModule { // Set the progress bar to done. If any errors occurred along the way, modify // the "complete" message to indicate this. - progressPanel.complete(); if (hadErrors) { + progressPanel.complete(ReportStatus.ERROR); progressPanel.updateStatusLabel( NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.completedWithErrors")); + } else { + progressPanel.complete(ReportStatus.COMPLETE); } } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java index dfa627fa91..40801f4ab2 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportGenerator.java @@ -358,7 +358,7 @@ import org.sleuthkit.datamodel.TskData; for (FileReportModule module : fileModules) { module.endTable(); module.endReport(); - fileProgress.get(module).complete(); + fileProgress.get(module).complete(ReportStatus.COMPLETE); } return 0; @@ -463,7 +463,7 @@ import org.sleuthkit.datamodel.TskData; // finish progress, wrap up for (TableReportModule module : tableModules) { - tableProgress.get(module).complete(); + tableProgress.get(module).complete(ReportStatus.COMPLETE); module.endReport(); } diff --git a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java index 4b03caf8f6..1f6c5a665b 100644 --- a/Core/src/org/sleuthkit/autopsy/report/ReportKML.java +++ b/Core/src/org/sleuthkit/autopsy/report/ReportKML.java @@ -339,12 +339,12 @@ class ReportKML implements GeneralReportModule { } catch (IOException ex) { logger.log(Level.WARNING, "Could not write the KML report.", ex); //NON-NLS } - progressPanel.complete(); + progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR); } catch (TskCoreException ex) { logger.log(Level.WARNING, "Failed to get the unique path.", ex); //NON-NLS } progressPanel.increment(); - progressPanel.complete(); + progressPanel.complete(ReportProgressPanel.ReportStatus.COMPLETE); } public static void copyFileUsingStream(AbstractFile file, File jFile) throws IOException { diff --git a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java index 96784a86c7..835485096e 100755 --- a/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java +++ b/KeywordSearch/src/org/sleuthkit/autopsy/keywordsearch/QueryResults.java @@ -21,7 +21,6 @@ package org.sleuthkit.autopsy.keywordsearch; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -167,17 +166,26 @@ class QueryResults { return newArtifacts; } - private List getOneHitPerObject(Keyword keyword) { - List hits = new ArrayList<>(); - Set uniqueObjectIds = new HashSet<>(); - for (KeywordHit hit : getResults(keyword)) { - long objectId = hit.getSolrObjectId(); - if (!uniqueObjectIds.contains(objectId)) { - uniqueObjectIds.add(objectId); - hits.add(hit); + /** + * Gets the first hit of the keyword. + * @param keyword + * @return Collection containing KeywordHits with lowest SolrObjectID-ChunkID pairs. + */ + private Collection getOneHitPerObject(Keyword keyword) { + + HashMap hits = new HashMap(); + + // create a list of KeywordHits. KeywordHits with lowest chunkID is added the the list. + for(KeywordHit hit: getResults(keyword)) { + if(!hits.containsKey(hit.getSolrObjectId())) { + hits.put(hit.getSolrObjectId(), hit); + } else { + if(hit.getChunkId() < hits.get(hit.getSolrObjectId()).getChunkId()) { + hits.put(hit.getSolrObjectId(), hit); + } } } - return hits; + return hits.values(); } /** diff --git a/test/script/regression.py b/test/script/regression.py index 95742d63fe..77d2061f2f 100755 --- a/test/script/regression.py +++ b/test/script/regression.py @@ -83,7 +83,7 @@ AUTOPSY_TEST_CASE = "AutopsyTestCase" # TODO: Double check this purpose statement # The filename of the log to store error messages -COMMON_LOG = "AutopsyErrors.txt" +COMMON_LOG = "Exceptions.txt" Day = 0 @@ -576,7 +576,7 @@ class TestData(object): Args: file_type: the DBType of the path to be generated """ - return self._get_path_to_file(file_type, "SortedData.txt") + return self._get_path_to_file(file_type, "BlackboardDump.txt") def get_sorted_errors_path(self, file_type): """Get the path to the SortedErrors file that correspodns to the given @@ -585,7 +585,7 @@ class TestData(object): Args: file_type: the DBType of the path to be generated """ - return self._get_path_to_file(file_type, "SortedErrors.txt") + return self._get_path_to_file(file_type, "BlackboardDumpErrors.txt") def get_db_dump_path(self, file_type): """Get the path to the DBDump file that corresponds to the given DBType. @@ -598,7 +598,7 @@ class TestData(object): def get_run_time_path(self, file_type): """Get the path to the run time storage file." """ - return self._get_path_to_file(file_type, "_time.txt") + return self._get_path_to_file(file_type, "Time.txt") def _get_path_to_file(self, file_type, file_name): """Get the path to the specified file with the specified type. @@ -1310,10 +1310,10 @@ class Logs(object): Errors.print_error("Error: Unable to open autopsy.log.0.") Errors.print_error(str(e) + "\n") logging.warning(traceback.format_exc()) - # Start date must look like: "Jul 16, 2012 12:57:53 PM" + # Start date must look like: "Fri Mar 27 13:27:34 EDT 2015" # End date must look like: "Mon Jul 16 13:02:42 2012" # *** If logging time format ever changes this will break *** - start = datetime.datetime.strptime(test_data.start_date, "%b %d, %Y %I:%M:%S %p") + start = datetime.datetime.strptime(test_data.start_date, "%a %b %d %H:%M:%S %Z %Y") end = datetime.datetime.strptime(test_data.end_date, "%a %b %d %H:%M:%S %Y") test_data.total_test_time = str(end - start)