mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 08:56:15 +00:00
Merge pull request #751 from rcordovano/java7_ingest_snapshots
Java7 ingest snapshots
This commit is contained in:
commit
9b29b037f4
@ -75,7 +75,7 @@ final class DataSourceIngestPipeline {
|
||||
for (DataSourceIngestModuleDecorator module : modules) {
|
||||
try {
|
||||
module.startUp(context);
|
||||
} catch (Exception ex) {
|
||||
} catch (Exception ex) { // Catch-all exception firewall
|
||||
errors.add(new IngestModuleError(module.getDisplayName(), ex));
|
||||
}
|
||||
}
|
||||
@ -92,7 +92,7 @@ final class DataSourceIngestPipeline {
|
||||
module.getDisplayName(), dataSource.getName()));
|
||||
task.updateProgressStatus(module.getDisplayName(), null);
|
||||
module.process(dataSource, new DataSourceIngestModuleProgress(progress));
|
||||
} catch (Exception ex) {
|
||||
} catch (Exception ex) { // Catch-all exception firewall
|
||||
errors.add(new IngestModuleError(module.getDisplayName(), ex));
|
||||
}
|
||||
if (context.isJobCancelled()) {
|
||||
|
@ -77,7 +77,7 @@ final class FileIngestPipeline {
|
||||
for (FileIngestModuleDecorator module : modules) {
|
||||
try {
|
||||
module.startUp(context);
|
||||
} catch (Exception ex) {
|
||||
} catch (Exception ex) { // Catch-all exception firewall
|
||||
errors.add(new IngestModuleError(module.getDisplayName(), ex));
|
||||
}
|
||||
}
|
||||
@ -98,7 +98,7 @@ final class FileIngestPipeline {
|
||||
try {
|
||||
task.updateProgressStatus(module.getDisplayName(), file);
|
||||
module.process(file);
|
||||
} catch (Exception ex) {
|
||||
} catch (Exception ex) { // Catch-all exception firewall
|
||||
errors.add(new IngestModuleError(module.getDisplayName(), ex));
|
||||
}
|
||||
if (context.isJobCancelled()) {
|
||||
|
@ -20,14 +20,13 @@ package org.sleuthkit.autopsy.ingest;
|
||||
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
import javax.swing.table.TableColumn;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
|
||||
public class IngestProgressSnapshotPanel extends javax.swing.JPanel {
|
||||
|
||||
@ -133,8 +132,12 @@ public class IngestProgressSnapshotPanel extends javax.swing.JPanel {
|
||||
cellValue = snapshot.getStartTime();
|
||||
break;
|
||||
case 5:
|
||||
long elapsedTime = Duration.between(snapshot.getStartTime(), LocalTime.now()).toMillis();
|
||||
Date now = new Date();
|
||||
long elapsedTime = now.getTime() - snapshot.getStartTime().getTime();
|
||||
cellValue = DurationFormatUtils.formatDurationHMS(elapsedTime);
|
||||
// TODO: Restore when we go to Java 8
|
||||
// long elapsedTime = Duration.between(snapshot.getStartTime(), LocalTime.now()).toMillis();
|
||||
// cellValue = DurationFormatUtils.formatDurationHMS(elapsedTime);
|
||||
break;
|
||||
default:
|
||||
cellValue = null;
|
||||
|
@ -18,8 +18,8 @@
|
||||
*/
|
||||
package org.sleuthkit.autopsy.ingest;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
@ -49,18 +49,23 @@ class IngestTask {
|
||||
}
|
||||
|
||||
public static final class ProgressSnapshot {
|
||||
|
||||
private final long threadId;
|
||||
private final Content dataSource;
|
||||
private final String ingestModuleDisplayName;
|
||||
private final AbstractFile file;
|
||||
private final LocalTime startTime;
|
||||
private final Date startTime;
|
||||
// TODO: Restore when we go to Java 8
|
||||
// private final LocalTime startTime;
|
||||
|
||||
private ProgressSnapshot(long threadId, Content dataSource, String ingestModuleDisplayName, AbstractFile file) {
|
||||
this.threadId = threadId;
|
||||
this.dataSource = dataSource;
|
||||
this.ingestModuleDisplayName = ingestModuleDisplayName;
|
||||
this.file = file;
|
||||
startTime = LocalTime.now();
|
||||
startTime = new Date();
|
||||
// TODO: Restore when we go to Java 8
|
||||
// startTime = LocalTime.now();
|
||||
}
|
||||
|
||||
long getThreadId() {
|
||||
@ -79,12 +84,17 @@ class IngestTask {
|
||||
return file;
|
||||
}
|
||||
|
||||
LocalTime getStartTime() {
|
||||
Date getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
// TODO: Restore when we go to Java 8
|
||||
// LocalTime getStartTime() {
|
||||
// return startTime;
|
||||
// }
|
||||
}
|
||||
|
||||
static final class ProgressSnapshots {
|
||||
|
||||
private final ConcurrentHashMap<Long, IngestTask.ProgressSnapshot> snapshots = new ConcurrentHashMap<>(); // Maps ingest thread ids to progress snapshots.
|
||||
|
||||
void update(ProgressSnapshot snapshot) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user