mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-06 21:00:22 +00:00
Merge branch 'develop' of https://github.com/sleuthkit/autopsy into scalpelCarver
This commit is contained in:
commit
a3a787f6d0
@ -37,7 +37,7 @@ import org.sleuthkit.datamodel.TskDataException;
|
||||
import org.sleuthkit.datamodel.TskException;
|
||||
|
||||
/*
|
||||
* A background task (swingworker) that adds the given image to
|
||||
* A background task that adds the given image to
|
||||
* database using the Sleuthkit JNI interface.
|
||||
*
|
||||
* It updates the given ProgressMonitor as it works through adding the image,
|
||||
@ -74,7 +74,7 @@ import org.sleuthkit.datamodel.TskException;
|
||||
boolean noFatOrphans;
|
||||
|
||||
/*
|
||||
* A Swingworker that updates the progressMonitor with the name of the
|
||||
* A thread that updates the progressMonitor with the name of the
|
||||
* directory currently being processed by the AddImageTask
|
||||
*/
|
||||
private class CurrentDirectoryFetcher implements Runnable {
|
||||
|
@ -24,6 +24,7 @@ import java.awt.EventQueue;
|
||||
import java.beans.PropertyChangeEvent;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.JOptionPane;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
@ -31,6 +32,8 @@ import javax.swing.ListSelectionModel;
|
||||
import javax.swing.SwingWorker;
|
||||
import org.netbeans.api.progress.ProgressHandle;
|
||||
import org.netbeans.api.progress.ProgressHandleFactory;
|
||||
import org.openide.DialogDisplayer;
|
||||
import org.openide.NotifyDescriptor;
|
||||
import org.openide.explorer.ExplorerManager;
|
||||
import org.openide.explorer.view.IconView;
|
||||
import org.openide.nodes.AbstractNode;
|
||||
@ -40,6 +43,7 @@ import org.openide.nodes.NodeEvent;
|
||||
import org.openide.nodes.NodeListener;
|
||||
import org.openide.nodes.NodeMemberEvent;
|
||||
import org.openide.nodes.NodeReorderEvent;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
|
||||
import org.sleuthkit.autopsy.coreutils.ImageUtils;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
@ -422,6 +426,16 @@ import org.sleuthkit.datamodel.TskCoreException;
|
||||
progress.finish();
|
||||
setCursor(null);
|
||||
updateControls();
|
||||
// see if any exceptions were thrown
|
||||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
NotifyDescriptor d =
|
||||
new NotifyDescriptor.Message("Error making thumbnails: " + ex.getMessage(),
|
||||
NotifyDescriptor.ERROR_MESSAGE);
|
||||
DialogDisplayer.getDefault().notify(d);
|
||||
logger.log(Level.SEVERE, "Error making thumbnails: " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
}.execute();
|
||||
|
||||
|
@ -29,6 +29,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.BoxLayout;
|
||||
@ -50,6 +51,8 @@ import org.gstreamer.elements.RGBDataSink;
|
||||
import org.gstreamer.swing.VideoComponent;
|
||||
import org.netbeans.api.progress.ProgressHandle;
|
||||
import org.netbeans.api.progress.ProgressHandleFactory;
|
||||
import org.openide.DialogDisplayer;
|
||||
import org.openide.NotifyDescriptor;
|
||||
import org.openide.util.Cancellable;
|
||||
import org.openide.util.lookup.ServiceProvider;
|
||||
import org.openide.util.lookup.ServiceProviders;
|
||||
@ -659,6 +662,18 @@ public class GstVideoPanel extends MediaViewVideoPanel {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
// see if any exceptions were thrown
|
||||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.WARNING, "Error updating video progress: " + ex.getMessage());
|
||||
infoLabel.setText("Error updating video progress: " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
} //end class progress worker
|
||||
|
||||
/* Thread that extracts and plays a file */
|
||||
|
@ -25,6 +25,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.Level;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import javax.swing.AbstractAction;
|
||||
@ -225,17 +226,18 @@ public final class ExtractAction extends AbstractAction {
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
boolean msgDisplayed = false;
|
||||
try {
|
||||
super.get();
|
||||
}
|
||||
catch (CancellationException | InterruptedException ex) {
|
||||
}
|
||||
catch (Exception ex) {
|
||||
logger.log(Level.SEVERE, "Fatal error during file extraction", ex);
|
||||
MessageNotifyUtil.Message.info("Error extracting files: " + ex.getMessage());
|
||||
msgDisplayed = true;
|
||||
}
|
||||
finally {
|
||||
progress.finish();
|
||||
if (!this.isCancelled()) {
|
||||
if (!this.isCancelled() && !msgDisplayed) {
|
||||
MessageNotifyUtil.Message.info("File(s) extracted.");
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.JFileChooser;
|
||||
@ -37,6 +38,7 @@ import javax.swing.SwingWorker;
|
||||
import org.netbeans.api.progress.ProgressHandle;
|
||||
import org.netbeans.api.progress.ProgressHandleFactory;
|
||||
import org.openide.util.Cancellable;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.casemodule.Case;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
||||
@ -294,9 +296,15 @@ import org.sleuthkit.datamodel.VolumeSystem;
|
||||
for (UnallocStruct u : lus) {
|
||||
lockedVols.remove(u.getFileName());
|
||||
}
|
||||
|
||||
try {
|
||||
get();
|
||||
if (!canceled && !lus.isEmpty()) {
|
||||
MessageNotifyUtil.Notify.info("Completed extraction of unallocated space.", "Files were extracted to " + lus.get(0).getFile().getParent());
|
||||
}
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
MessageNotifyUtil.Notify.error("Error Extracting", "Error extracting unallocated space: " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.HashSet;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFrame;
|
||||
@ -251,6 +252,15 @@ import org.sleuthkit.datamodel.TskException;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.SEVERE, "failed to generate reports", ex);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -336,6 +346,15 @@ import org.sleuthkit.datamodel.TskException;
|
||||
return Collections.EMPTY_LIST;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.SEVERE, "failed to generate reports", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -574,6 +593,15 @@ import org.sleuthkit.datamodel.TskException;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.SEVERE, "failed to generate reports", ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate the tables for the tagged artifacts
|
||||
*/
|
||||
|
@ -40,6 +40,7 @@ import org.w3c.dom.Element;
|
||||
import org.w3c.dom.NodeList;
|
||||
import java.beans.PropertyChangeListener;
|
||||
import java.beans.PropertyChangeSupport;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.Level;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SwingWorker;
|
||||
@ -47,6 +48,7 @@ import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.netbeans.api.progress.ProgressHandle;
|
||||
import org.netbeans.api.progress.ProgressHandleFactory;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
import org.sleuthkit.datamodel.Content;
|
||||
@ -942,6 +944,9 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Worker thread to make an index of a database
|
||||
*/
|
||||
private class HashDbIndexer extends SwingWorker<Object, Void> {
|
||||
private ProgressHandle progress = null;
|
||||
private HashDb hashDb = null;
|
||||
@ -977,6 +982,16 @@ public class HashDbManager implements PropertyChangeListener {
|
||||
hashDb.indexing = false;
|
||||
progress.finish();
|
||||
|
||||
// see if we got any errors
|
||||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.SEVERE, "Error creating index", ex);
|
||||
MessageNotifyUtil.Notify.show("Error creating index",
|
||||
"Error creating index: " + ex.getMessage(),
|
||||
MessageNotifyUtil.MessageType.ERROR);
|
||||
}
|
||||
|
||||
try {
|
||||
hashDb.propertyChangeSupport.firePropertyChange(HashDb.Event.INDEXING_DONE.toString(), null, hashDb);
|
||||
}
|
||||
|
@ -32,13 +32,12 @@ import org.netbeans.api.progress.ProgressHandle;
|
||||
import org.netbeans.api.progress.ProgressHandleFactory;
|
||||
import org.openide.util.Cancellable;
|
||||
import org.sleuthkit.datamodel.AbstractFile;
|
||||
import org.sleuthkit.datamodel.FsContent;
|
||||
|
||||
class HashDbSearchThread extends SwingWorker<Object,Void> {
|
||||
private Logger logger = Logger.getLogger(HashDbSearchThread.class.getName());
|
||||
private ProgressHandle progress;
|
||||
private Map<String, List<AbstractFile>> map;
|
||||
private ArrayList<String> hashes = new ArrayList<String>();
|
||||
private ArrayList<String> hashes = new ArrayList<>();
|
||||
private AbstractFile file;
|
||||
|
||||
HashDbSearchThread(AbstractFile file) {
|
||||
|
@ -26,6 +26,8 @@ import java.awt.event.ItemEvent;
|
||||
import java.awt.event.ItemListener;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.openide.util.NbBundle;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
@ -43,6 +45,7 @@ import javax.swing.text.html.HTMLEditorKit.HTMLFactory;
|
||||
import javax.swing.text.html.StyleSheet;
|
||||
import org.netbeans.api.progress.ProgressHandle;
|
||||
import org.netbeans.api.progress.ProgressHandleFactory;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.sleuthkit.autopsy.coreutils.EscapeUtil;
|
||||
import org.sleuthkit.autopsy.coreutils.TextUtil;
|
||||
|
||||
@ -386,7 +389,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
||||
* @return currently available sources on the panel
|
||||
*/
|
||||
public List<MarkupSource> getSources() {
|
||||
ArrayList<MarkupSource> sources = new ArrayList<MarkupSource>();
|
||||
ArrayList<MarkupSource> sources = new ArrayList<>();
|
||||
for (int i = 0; i < sourceComboBox.getItemCount(); ++i) {
|
||||
sources.add((MarkupSource) sourceComboBox.getItemAt(i));
|
||||
}
|
||||
@ -695,6 +698,15 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
||||
protected void done() {
|
||||
//super.done();
|
||||
progress.finish();
|
||||
|
||||
// see if there are any errors
|
||||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.SEVERE, "Error getting marked up text" );
|
||||
}
|
||||
|
||||
|
||||
if (markup != null) {
|
||||
setPanelText(markup, true);
|
||||
} else {
|
||||
@ -703,8 +715,6 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
||||
updateControls(source);
|
||||
|
||||
scrollToCurrentHit(source);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.logging.Level;
|
||||
@ -44,7 +45,6 @@ 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;
|
||||
@ -1184,6 +1184,18 @@ public final class KeywordSearchIngestModule extends IngestModuleAbstractFile {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
// call get to see if there were any errors
|
||||
try {
|
||||
get();
|
||||
}
|
||||
catch (InterruptedException | ExecutionException e) {
|
||||
logger.log(Level.SEVERE, "Error performing keyword search: " + e.getMessage());
|
||||
services.postMessage(IngestMessage.createErrorMessage(++messageID, instance, "Error performing keyword search", e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sync-up the updated keywords from the currently used lists in the XML
|
||||
*/
|
||||
|
@ -25,6 +25,7 @@ import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||
import java.util.logging.Level;
|
||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||
@ -36,6 +37,7 @@ import org.openide.nodes.ChildFactory;
|
||||
import org.openide.nodes.Children;
|
||||
import org.openide.nodes.Node;
|
||||
import org.openide.util.Cancellable;
|
||||
import org.openide.util.Exceptions;
|
||||
import org.openide.util.lookup.Lookups;
|
||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
|
||||
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
|
||||
@ -614,6 +616,16 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQuery> {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void done() {
|
||||
try {
|
||||
// test if any exceptions were thrown
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.SEVERE, "Error querying ", ex);
|
||||
}
|
||||
}
|
||||
|
||||
private static synchronized void registerWriter(ResultWriter writer) {
|
||||
writers.add(writer);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user