mirror of
https://github.com/elisspace/autopsy.git
synced 2026-09-04 06:50:00 +00:00
Merge pull request #3360 from dgrove727/3435_InvalidPath
Corrected invalid path concatenation.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2017 Basis Technology Corp.
|
||||
* Copyright 2017-2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -21,7 +21,6 @@ package org.sleuthkit.autopsy.modules.encryptiondetection;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Collections;
|
||||
import java.util.logging.Level;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
@@ -96,7 +95,7 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter
|
||||
return flagFile(file);
|
||||
}
|
||||
} catch (IOException | TskCoreException ex) {
|
||||
LOGGER.log(Level.SEVERE, String.format("Unable to process file '%s'", Paths.get(file.getParentPath(), file.getName())), ex);
|
||||
LOGGER.log(Level.SEVERE, String.format("Unable to process file '%s'", file.getParentPath() + file.getName()), ex);
|
||||
return IngestModule.ProcessResult.ERROR;
|
||||
}
|
||||
|
||||
@@ -144,7 +143,7 @@ final class EncryptionDetectionFileIngestModule extends FileIngestModuleAdapter
|
||||
|
||||
return IngestModule.ProcessResult.OK;
|
||||
} catch (TskCoreException ex) {
|
||||
LOGGER.log(Level.SEVERE, String.format("Failed to create blackboard artifact for '%s'.", Paths.get(file.getParentPath(), file.getName())), ex); //NON-NLS
|
||||
LOGGER.log(Level.SEVERE, String.format("Failed to create blackboard artifact for '%s'.", file.getParentPath() + file.getName()), ex); //NON-NLS
|
||||
return IngestModule.ProcessResult.ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2015-2017 Basis Technology Corp.
|
||||
* Copyright 2015-2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -1849,11 +1849,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
|
||||
}//GEN-LAST:event_bnReprocessJobActionPerformed
|
||||
|
||||
private void bnClusterMetricsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnClusterMetricsActionPerformed
|
||||
try {
|
||||
new AutoIngestMetricsDialog(this.getTopLevelAncestor());
|
||||
} catch (AutoIngestMetricsDialog.AutoIngestMetricsDialogException ex) {
|
||||
MessageNotifyUtil.Message.error(ex.getMessage());
|
||||
}
|
||||
new AutoIngestMetricsDialog(this.getTopLevelAncestor());
|
||||
}//GEN-LAST:event_bnClusterMetricsActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2017 Basis Technology Corp.
|
||||
* Copyright 2011-2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -77,7 +77,7 @@ final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
private static final int COMPLETED_TIME_COL_MIN_WIDTH = 30;
|
||||
private static final int COMPLETED_TIME_COL_MAX_WIDTH = 2000;
|
||||
private static final int COMPLETED_TIME_COL_PREFERRED_WIDTH = 280;
|
||||
private static final Logger logger = Logger.getLogger(AutoIngestDashboard.class.getName());
|
||||
private static final Logger LOGGER = Logger.getLogger(AutoIngestDashboard.class.getName());
|
||||
private final DefaultTableModel pendingTableModel;
|
||||
private final DefaultTableModel runningTableModel;
|
||||
private final DefaultTableModel completedTableModel;
|
||||
@@ -159,7 +159,7 @@ final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
serviceStatus = NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.tbServicesStatusMessage.Message.Down");
|
||||
}
|
||||
} catch (ServicesMonitor.ServicesMonitorException ex) {
|
||||
logger.log(Level.SEVERE, String.format("Dashboard error getting service status for %s", service), ex);
|
||||
LOGGER.log(Level.SEVERE, String.format("Dashboard error getting service status for %s", service), ex);
|
||||
}
|
||||
return serviceStatus;
|
||||
}
|
||||
@@ -470,7 +470,7 @@ final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
}
|
||||
setSelectedEntry(table, tableModel, currentRow);
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, "Error refreshing table " + table.toString(), ex);
|
||||
LOGGER.log(Level.SEVERE, "Error refreshing table " + table.toString(), ex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -848,7 +848,7 @@ final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
refreshTables(jobsSnapshot);
|
||||
} catch (AutoIngestMonitor.AutoIngestMonitorException ex) {
|
||||
String errorMessage = String.format(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.PrioritizeJobError"), job.getManifest().getFilePath());
|
||||
logger.log(Level.SEVERE, errorMessage, ex);
|
||||
LOGGER.log(Level.SEVERE, errorMessage, ex);
|
||||
MessageNotifyUtil.Message.error(errorMessage);
|
||||
}
|
||||
setCursor(Cursor.getDefaultCursor());
|
||||
@@ -868,7 +868,7 @@ final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
refreshTables(jobsSnapshot);
|
||||
} catch (AutoIngestMonitor.AutoIngestMonitorException ex) {
|
||||
String errorMessage = String.format(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.PrioritizeCaseError"), caseName);
|
||||
logger.log(Level.SEVERE, errorMessage, ex);
|
||||
LOGGER.log(Level.SEVERE, errorMessage, ex);
|
||||
MessageNotifyUtil.Message.error(errorMessage);
|
||||
}
|
||||
setCursor(Cursor.getDefaultCursor());
|
||||
@@ -876,11 +876,7 @@ final class AutoIngestDashboard extends JPanel implements Observer {
|
||||
}//GEN-LAST:event_prioritizeCaseButtonActionPerformed
|
||||
|
||||
private void clusterMetricsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_clusterMetricsButtonActionPerformed
|
||||
try {
|
||||
new AutoIngestMetricsDialog(this.getTopLevelAncestor());
|
||||
} catch (AutoIngestMetricsDialog.AutoIngestMetricsDialogException ex) {
|
||||
MessageNotifyUtil.Message.error(ex.getMessage());
|
||||
}
|
||||
new AutoIngestMetricsDialog(this.getTopLevelAncestor());
|
||||
}//GEN-LAST:event_clusterMetricsButtonActionPerformed
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2017 Basis Technology Corp.
|
||||
* Copyright 2017-2018 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@@ -27,6 +27,7 @@ import java.time.ZoneOffset;
|
||||
import java.util.List;
|
||||
import org.openide.util.NbBundle;
|
||||
import org.openide.util.NbBundle.Messages;
|
||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||
import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestMetricsCollector.JobMetric;
|
||||
|
||||
/**
|
||||
@@ -36,10 +37,10 @@ final class AutoIngestMetricsDialog extends javax.swing.JDialog {
|
||||
|
||||
private static final int GIGABYTE_SIZE = 1073741824;
|
||||
|
||||
private final AutoIngestMetricsCollector autoIngestMetricsCollector;
|
||||
private AutoIngestMetricsCollector autoIngestMetricsCollector;
|
||||
|
||||
/**
|
||||
* Creates an instance of AutoIngestMetricsDialog
|
||||
* Creates an instance of AutoIngestMetricsDialog.
|
||||
*
|
||||
* @param parent The parent container.
|
||||
*/
|
||||
@@ -47,28 +48,36 @@ final class AutoIngestMetricsDialog extends javax.swing.JDialog {
|
||||
"AutoIngestMetricsDialog.title.text=Auto Ingest Metrics",
|
||||
"AutoIngestMetricsDialog.initReportText=Select a date above and click the 'Generate Metrics Report' button to generate\na metrics report."
|
||||
})
|
||||
AutoIngestMetricsDialog(Container parent) throws AutoIngestMetricsDialogException {
|
||||
AutoIngestMetricsDialog(Container parent) {
|
||||
super((Window) parent, NbBundle.getMessage(AutoIngestMetricsDialog.class, "AutoIngestMetricsDialog.title.text"), ModalityType.MODELESS);
|
||||
try {
|
||||
autoIngestMetricsCollector = new AutoIngestMetricsCollector();
|
||||
} catch (AutoIngestMetricsCollector.AutoIngestMetricsCollectorException ex) {
|
||||
throw new AutoIngestMetricsDialogException("Error starting up the auto ingest metrics dialog.", ex);
|
||||
}
|
||||
initComponents();
|
||||
reportTextArea.setText(NbBundle.getMessage(AutoIngestMetricsDialog.class, "AutoIngestMetricsDialog.initReportText"));
|
||||
setModal(true);
|
||||
setSize(getPreferredSize());
|
||||
setLocationRelativeTo(parent);
|
||||
setAlwaysOnTop(false);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the metrics shown in the report text area.
|
||||
*
|
||||
* @throws AutoIngestMetricsDialogException When the initialization of the
|
||||
* AutoIngestMetricsCollector
|
||||
* fails.
|
||||
*/
|
||||
private void updateMetrics() {
|
||||
private void updateMetrics() throws AutoIngestMetricsDialogException {
|
||||
if (datePicker.getDate() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(autoIngestMetricsCollector == null) {
|
||||
try {
|
||||
autoIngestMetricsCollector = new AutoIngestMetricsCollector();
|
||||
} catch (AutoIngestMetricsCollector.AutoIngestMetricsCollectorException ex) {
|
||||
throw new AutoIngestMetricsDialogException("Error initializing the auto ingest metrics collector.", ex);
|
||||
}
|
||||
}
|
||||
|
||||
AutoIngestMetricsCollector.MetricsSnapshot metricsSnapshot = autoIngestMetricsCollector.queryCoordinationServiceForMetrics();
|
||||
List<JobMetric> completedJobMetrics = metricsSnapshot.getCompletedJobMetrics();
|
||||
@@ -214,7 +223,11 @@ final class AutoIngestMetricsDialog extends javax.swing.JDialog {
|
||||
|
||||
private void metricsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_metricsButtonActionPerformed
|
||||
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||
updateMetrics();
|
||||
try {
|
||||
updateMetrics();
|
||||
} catch (AutoIngestMetricsDialogException ex) {
|
||||
MessageNotifyUtil.Message.error(ex.getMessage());
|
||||
}
|
||||
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||
}//GEN-LAST:event_metricsButtonActionPerformed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user