mirror of
https://github.com/elisspace/autopsy.git
synced 2026-10-03 15:59:52 +00:00
Merge branch 'develop' of https://github.com/sleuthkit/autopsy into messaging_prototype
This commit is contained in:
@@ -83,7 +83,6 @@ import org.openide.util.actions.Presenter;
|
||||
*/
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
CueBannerPanel.refresh();
|
||||
if (Case.existsCurrentCase() == false)
|
||||
return;
|
||||
|
||||
|
||||
@@ -126,9 +126,6 @@
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="openRecentButtonActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="10"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="createNewLabel">
|
||||
<Properties>
|
||||
@@ -149,9 +146,6 @@
|
||||
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="CueBannerPanel.openRecentLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, "{key}")"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="10"/>
|
||||
</AuxValues>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="openCaseButton">
|
||||
<Properties>
|
||||
|
||||
@@ -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 {
|
||||
);
|
||||
}// </editor-fold>//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
|
||||
|
||||
/**
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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<KeywordHit> getOneHitPerObject(Keyword keyword) {
|
||||
List<KeywordHit> hits = new ArrayList<>();
|
||||
Set<Long> 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<KeywordHit> containing KeywordHits with lowest SolrObjectID-ChunkID pairs.
|
||||
*/
|
||||
private Collection<KeywordHit> getOneHitPerObject(Keyword keyword) {
|
||||
|
||||
HashMap<Long, KeywordHit> 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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user