mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-17 10:17:41 +00:00
Removed pop ups or other GUI related features that require user interaction
This commit is contained in:
parent
974068df3a
commit
a1286e5fa1
@ -6,7 +6,6 @@ STIXReportModule.getDesc.text=Generate a report by running a collection of STIX
|
|||||||
STIXReportModule.progress.readSTIX=Parsing STIX files
|
STIXReportModule.progress.readSTIX=Parsing STIX files
|
||||||
STIXReportModule.srcModuleName.text=STIX Report
|
STIXReportModule.srcModuleName.text=STIX Report
|
||||||
STIXReportModuleConfigPanel.jLabel2.text=Select a STIX file or directory of STIX files
|
STIXReportModuleConfigPanel.jLabel2.text=Select a STIX file or directory of STIX files
|
||||||
STIXReportModuleConfigPanel.jTextField1.text=
|
|
||||||
STIXReportModuleConfigPanel.jButton1.text=Choose file
|
STIXReportModuleConfigPanel.jButton1.text=Choose file
|
||||||
STIXReportModuleConfigPanel.jCheckBox1.text=Include results for false indicators in output file
|
STIXReportModuleConfigPanel.jCheckBox1.text=Include results for false indicators in output file
|
||||||
STIXReportModule.notifyMsg.unableToOpenReportFile=Unable to complete STIX report.
|
STIXReportModule.notifyMsg.unableToOpenReportFile=Unable to complete STIX report.
|
||||||
@ -16,3 +15,4 @@ STIXReportModule.progress.couldNotOpenFileDir=Could not open file/directory {0}
|
|||||||
STIXReportModule.notifyMsg.tooManyArtifactsgt1000=Too many STIX-related artifacts generated for "{0}". Only saving first 1000.
|
STIXReportModule.notifyMsg.tooManyArtifactsgt1000=Too many STIX-related artifacts generated for "{0}". Only saving first 1000.
|
||||||
STIXReportModule.notifyErr.noFildDirProvided=No STIX file/directory provided
|
STIXReportModule.notifyErr.noFildDirProvided=No STIX file/directory provided
|
||||||
STIXReportModule.progress.noFildDirProvided=No STIX file/directory provided
|
STIXReportModule.progress.noFildDirProvided=No STIX file/directory provided
|
||||||
|
STIXReportModuleConfigPanel.jStixFileTextField.text=
|
||||||
|
@ -54,7 +54,6 @@ import org.openide.util.NbBundle.Messages;
|
|||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
|
||||||
import org.sleuthkit.autopsy.report.GeneralReportModule;
|
import org.sleuthkit.autopsy.report.GeneralReportModule;
|
||||||
import org.sleuthkit.autopsy.report.NoReportModuleSettings;
|
import org.sleuthkit.autopsy.report.NoReportModuleSettings;
|
||||||
import org.sleuthkit.autopsy.report.ReportModuleSettings;
|
import org.sleuthkit.autopsy.report.ReportModuleSettings;
|
||||||
@ -116,8 +115,6 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
|
|
||||||
if (stixFileName == null) {
|
if (stixFileName == null) {
|
||||||
logger.log(Level.SEVERE, "STIXReportModuleConfigPanel.stixFile not initialized "); //NON-NLS
|
logger.log(Level.SEVERE, "STIXReportModuleConfigPanel.stixFile not initialized "); //NON-NLS
|
||||||
MessageNotifyUtil.Message.error(
|
|
||||||
NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyErr.noFildDirProvided"));
|
|
||||||
progressPanel.complete(ReportStatus.ERROR);
|
progressPanel.complete(ReportStatus.ERROR);
|
||||||
progressPanel.updateStatusLabel(
|
progressPanel.updateStatusLabel(
|
||||||
NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.noFildDirProvided"));
|
NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.noFildDirProvided"));
|
||||||
@ -126,8 +123,6 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
}
|
}
|
||||||
if (stixFileName.isEmpty()) {
|
if (stixFileName.isEmpty()) {
|
||||||
logger.log(Level.SEVERE, "No STIX file/directory provided "); //NON-NLS
|
logger.log(Level.SEVERE, "No STIX file/directory provided "); //NON-NLS
|
||||||
MessageNotifyUtil.Message.error(
|
|
||||||
NbBundle.getMessage(this.getClass(), "STIXReportModule.notifyErr.noFildDirProvided"));
|
|
||||||
progressPanel.complete(ReportStatus.ERROR);
|
progressPanel.complete(ReportStatus.ERROR);
|
||||||
progressPanel.updateStatusLabel(
|
progressPanel.updateStatusLabel(
|
||||||
NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.noFildDirProvided"));
|
NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.noFildDirProvided"));
|
||||||
@ -138,9 +133,6 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
|
|
||||||
if (!stixFile.exists()) {
|
if (!stixFile.exists()) {
|
||||||
logger.log(Level.SEVERE, String.format("Unable to open STIX file/directory %s", stixFileName)); //NON-NLS
|
logger.log(Level.SEVERE, String.format("Unable to open STIX file/directory %s", stixFileName)); //NON-NLS
|
||||||
MessageNotifyUtil.Message.error(NbBundle.getMessage(this.getClass(),
|
|
||||||
"STIXReportModule.notifyMsg.unableToOpenFileDir",
|
|
||||||
stixFileName));
|
|
||||||
progressPanel.complete(ReportStatus.ERROR);
|
progressPanel.complete(ReportStatus.ERROR);
|
||||||
progressPanel.updateStatusLabel(
|
progressPanel.updateStatusLabel(
|
||||||
NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.couldNotOpenFileDir", stixFileName));
|
NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.couldNotOpenFileDir", stixFileName));
|
||||||
@ -172,9 +164,7 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
} catch (TskCoreException | JAXBException ex) {
|
} catch (TskCoreException | JAXBException ex) {
|
||||||
String errMsg = String.format("Unable to process STIX file %s", file);
|
String errMsg = String.format("Unable to process STIX file %s", file);
|
||||||
logger.log(Level.SEVERE, errMsg, ex); //NON-NLS
|
logger.log(Level.SEVERE, errMsg, ex); //NON-NLS
|
||||||
MessageNotifyUtil.Notify.show("STIXReportModule", //NON-NLS
|
progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(), errMsg));
|
||||||
errMsg,
|
|
||||||
MessageNotifyUtil.MessageType.ERROR);
|
|
||||||
hadErrors = true;
|
hadErrors = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -195,10 +185,6 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
}
|
}
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.log(Level.SEVERE, "Unable to complete STIX report.", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Unable to complete STIX report.", ex); //NON-NLS
|
||||||
MessageNotifyUtil.Notify.show("STIXReportModule", //NON-NLS
|
|
||||||
NbBundle.getMessage(this.getClass(),
|
|
||||||
"STIXReportModule.notifyMsg.unableToOpenReportFile"),
|
|
||||||
MessageNotifyUtil.MessageType.ERROR);
|
|
||||||
progressPanel.complete(ReportStatus.ERROR);
|
progressPanel.complete(ReportStatus.ERROR);
|
||||||
progressPanel.updateStatusLabel(
|
progressPanel.updateStatusLabel(
|
||||||
NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.completedWithErrors"));
|
NbBundle.getMessage(this.getClass(), "STIXReportModule.progress.completedWithErrors"));
|
||||||
@ -234,7 +220,7 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
registryFileData = EvalRegistryObj.copyRegistryFiles();
|
registryFileData = EvalRegistryObj.copyRegistryFiles();
|
||||||
|
|
||||||
// Process the indicators
|
// Process the indicators
|
||||||
processIndicators(stix, output);
|
processIndicators(stix, output, progressPanel);
|
||||||
progressPanel.increment();
|
progressPanel.increment();
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -282,7 +268,7 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
* @param stix STIXPackage
|
* @param stix STIXPackage
|
||||||
* @param output
|
* @param output
|
||||||
*/
|
*/
|
||||||
private void processIndicators(STIXPackage stix, BufferedWriter output) throws TskCoreException {
|
private void processIndicators(STIXPackage stix, BufferedWriter output, ReportProgressPanel progressPanel) throws TskCoreException {
|
||||||
if (stix.getIndicators() != null) {
|
if (stix.getIndicators() != null) {
|
||||||
List<IndicatorBaseType> s = stix.getIndicators().getIndicators();
|
List<IndicatorBaseType> s = stix.getIndicators().getIndicators();
|
||||||
for (IndicatorBaseType t : s) {
|
for (IndicatorBaseType t : s) {
|
||||||
@ -295,7 +281,7 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
writeResultsToFile(ind, result.getDescription(), result.isTrue(), output);
|
writeResultsToFile(ind, result.getDescription(), result.isTrue(), output);
|
||||||
}
|
}
|
||||||
if (result.isTrue()) {
|
if (result.isTrue()) {
|
||||||
saveResultsAsArtifacts(ind, result);
|
saveResultsAsArtifacts(ind, result, progressPanel);
|
||||||
}
|
}
|
||||||
} else if (ind.getObservable().getObservableComposition() != null) {
|
} else if (ind.getObservable().getObservableComposition() != null) {
|
||||||
ObservableResult result = evaluateObservableComposition(ind.getObservable().getObservableComposition(), " ");
|
ObservableResult result = evaluateObservableComposition(ind.getObservable().getObservableComposition(), " ");
|
||||||
@ -304,7 +290,7 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
writeResultsToFile(ind, result.getDescription(), result.isTrue(), output);
|
writeResultsToFile(ind, result.getDescription(), result.isTrue(), output);
|
||||||
}
|
}
|
||||||
if (result.isTrue()) {
|
if (result.isTrue()) {
|
||||||
saveResultsAsArtifacts(ind, result);
|
saveResultsAsArtifacts(ind, result, progressPanel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -321,7 +307,7 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
*
|
*
|
||||||
* @throws TskCoreException
|
* @throws TskCoreException
|
||||||
*/
|
*/
|
||||||
private void saveResultsAsArtifacts(Indicator ind, ObservableResult result) throws TskCoreException {
|
private void saveResultsAsArtifacts(Indicator ind, ObservableResult result, ReportProgressPanel progressPanel) throws TskCoreException {
|
||||||
|
|
||||||
if (result.getArtifacts() == null) {
|
if (result.getArtifacts() == null) {
|
||||||
return;
|
return;
|
||||||
@ -347,11 +333,8 @@ public class STIXReportModule implements GeneralReportModule {
|
|||||||
// for a single observable because the condition was not restrictive enough
|
// for a single observable because the condition was not restrictive enough
|
||||||
count++;
|
count++;
|
||||||
if (count > 1000) {
|
if (count > 1000) {
|
||||||
MessageNotifyUtil.Notify.show("STIXReportModule", //NON-NLS
|
progressPanel.updateStatusLabel(NbBundle.getMessage(this.getClass(),
|
||||||
NbBundle.getMessage(this.getClass(),
|
"STIXReportModule.notifyMsg.tooManyArtifactsgt1000"));
|
||||||
"STIXReportModule.notifyMsg.tooManyArtifactsgt1000",
|
|
||||||
ind.getId()),
|
|
||||||
MessageNotifyUtil.MessageType.INFO);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,6 @@ import org.openide.util.NbBundle.Messages;
|
|||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.Blackboard;
|
import org.sleuthkit.datamodel.Blackboard;
|
||||||
import org.sleuthkit.datamodel.BlackboardArtifact;
|
import org.sleuthkit.datamodel.BlackboardArtifact;
|
||||||
@ -76,7 +75,6 @@ class StixArtifactData {
|
|||||||
blackboard = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard();
|
blackboard = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard();
|
||||||
} catch (NoCurrentCaseException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Exception while getting open case.", ex); //NON-NLS
|
||||||
MessageNotifyUtil.Notify.error(Bundle.StixArtifactData_noOpenCase_errMsg(), ex.getLocalizedMessage());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +98,6 @@ class StixArtifactData {
|
|||||||
blackboard.postArtifact(bba, MODULE_NAME);
|
blackboard.postArtifact(bba, MODULE_NAME);
|
||||||
} catch (Blackboard.BlackboardException ex) {
|
} catch (Blackboard.BlackboardException ex) {
|
||||||
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
|
logger.log(Level.SEVERE, "Unable to index blackboard artifact " + bba.getArtifactID(), ex); //NON-NLS
|
||||||
MessageNotifyUtil.Notify.error(Bundle.StixArtifactData_indexError_message(), bba.getDisplayName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -116,8 +116,9 @@ class PortableCaseInterestingItemsListPanel extends javax.swing.JPanel {
|
|||||||
setCounts = callback.getSetCountMap();
|
setCounts = callback.getSetCountMap();
|
||||||
setNames.addAll(setCounts.keySet());
|
setNames.addAll(setCounts.keySet());
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Logger.getLogger(ReportWizardPortableCaseOptionsVisualPanel.class.getName()).log(Level.WARNING, "Failed to get interesting item set names", ex); // NON-NLS
|
Logger.getLogger(ReportWizardPortableCaseOptionsVisualPanel.class.getName()).log(Level.SEVERE, "Failed to get interesting item set names", ex); // NON-NLS
|
||||||
} catch (NoCurrentCaseException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
// There may not be a case open when configuring report modules for Command Line execution
|
||||||
Logger.getLogger(ReportWizardPortableCaseOptionsVisualPanel.class.getName()).log(Level.WARNING, "Exception while getting open case.", ex); // NON-NLS
|
Logger.getLogger(ReportWizardPortableCaseOptionsVisualPanel.class.getName()).log(Level.WARNING, "Exception while getting open case.", ex); // NON-NLS
|
||||||
}
|
}
|
||||||
Collections.sort(setNames);
|
Collections.sort(setNames);
|
||||||
|
@ -38,7 +38,6 @@ import org.sleuthkit.autopsy.casemodule.Case;
|
|||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.FileUtil;
|
import org.sleuthkit.autopsy.coreutils.FileUtil;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
|
||||||
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
|
||||||
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
||||||
import org.sleuthkit.autopsy.coreutils.FileTypeUtils.FileTypeCategory;
|
import org.sleuthkit.autopsy.coreutils.FileTypeUtils.FileTypeCategory;
|
||||||
@ -153,7 +152,7 @@ class PortableCaseReportModule implements ReportModule {
|
|||||||
} else {
|
} else {
|
||||||
logger.log(Level.SEVERE, logWarning, ex);
|
logger.log(Level.SEVERE, logWarning, ex);
|
||||||
}
|
}
|
||||||
MessageNotifyUtil.Message.error(dialogWarning);
|
progressPanel.updateStatusLabel(dialogWarning);
|
||||||
progressPanel.setIndeterminate(false);
|
progressPanel.setIndeterminate(false);
|
||||||
progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR);
|
progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR);
|
||||||
cleanup();
|
cleanup();
|
||||||
|
@ -119,8 +119,9 @@ class PortableCaseTagsListPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Logger.getLogger(ReportWizardPortableCaseOptionsVisualPanel.class.getName()).log(Level.WARNING, "Failed to get tag names", ex); // NON-NLS
|
Logger.getLogger(ReportWizardPortableCaseOptionsVisualPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex); // NON-NLS
|
||||||
} catch (NoCurrentCaseException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
|
// There may not be a case open when configuring report modules for Command Line execution
|
||||||
Logger.getLogger(ReportWizardPortableCaseOptionsVisualPanel.class.getName()).log(Level.WARNING, "Exception while getting open case.", ex); // NON-NLS
|
Logger.getLogger(ReportWizardPortableCaseOptionsVisualPanel.class.getName()).log(Level.WARNING, "Exception while getting open case.", ex); // NON-NLS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ import org.openide.windows.WindowManager;
|
|||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil; // ELTODO do we need to remove this?
|
||||||
import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
|
import org.sleuthkit.autopsy.report.ReportProgressPanel.ReportStatus;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
import org.sleuthkit.datamodel.SleuthkitCase;
|
import org.sleuthkit.datamodel.SleuthkitCase;
|
||||||
|
@ -41,7 +41,6 @@ import org.sleuthkit.autopsy.casemodule.Case;
|
|||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
|
||||||
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
||||||
import org.sleuthkit.autopsy.ingest.IngestManager;
|
import org.sleuthkit.autopsy.ingest.IngestManager;
|
||||||
import org.sleuthkit.autopsy.report.ReportProgressPanel;
|
import org.sleuthkit.autopsy.report.ReportProgressPanel;
|
||||||
@ -103,14 +102,14 @@ public final class CaseUcoFormatExporter {
|
|||||||
Files.createDirectories(Paths.get(reportFile.getParent()));
|
Files.createDirectories(Paths.get(reportFile.getParent()));
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
logger.log(Level.SEVERE, "Unable to create directory for CASE-UCO report", ex); //NON-NLS
|
logger.log(Level.SEVERE, "Unable to create directory for CASE-UCO report", ex); //NON-NLS
|
||||||
MessageNotifyUtil.Message.error(Bundle.ReportCaseUco_unableToCreateDirectories());
|
progressPanel.updateStatusLabel(Bundle.ReportCaseUco_unableToCreateDirectories());
|
||||||
progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR);
|
progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if ingest has finished
|
// Check if ingest has finished
|
||||||
if (IngestManager.getInstance().isIngestRunning()) {
|
if (IngestManager.getInstance().isIngestRunning()) {
|
||||||
MessageNotifyUtil.Message.warn(Bundle.ReportCaseUco_ingestWarning());
|
progressPanel.updateStatusLabel(Bundle.ReportCaseUco_ingestWarning());
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonGenerator jsonGenerator = null;
|
JsonGenerator jsonGenerator = null;
|
||||||
|
@ -22,15 +22,12 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import org.sleuthkit.autopsy.coreutils.Logger;
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
import org.openide.windows.WindowManager;
|
|
||||||
import org.sleuthkit.autopsy.casemodule.Case;
|
import org.sleuthkit.autopsy.casemodule.Case;
|
||||||
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
|
||||||
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
|
||||||
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
|
||||||
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
|
||||||
import org.sleuthkit.autopsy.report.GeneralReportModule;
|
import org.sleuthkit.autopsy.report.GeneralReportModule;
|
||||||
import org.sleuthkit.autopsy.report.NoReportModuleSettings;
|
import org.sleuthkit.autopsy.report.NoReportModuleSettings;
|
||||||
@ -123,7 +120,8 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule {
|
|||||||
openCase = Case.getCurrentCaseThrows();
|
openCase = Case.getCurrentCaseThrows();
|
||||||
} catch (NoCurrentCaseException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
Logger.getLogger(AddTaggedHashesToHashDb.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex);
|
Logger.getLogger(AddTaggedHashesToHashDb.class.getName()).log(Level.SEVERE, "Exception while getting open case.", ex);
|
||||||
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "No open Case", "Exception while getting open case.", JOptionPane.ERROR_MESSAGE);
|
progressPanel.updateStatusLabel("Exception while getting open case.");
|
||||||
|
progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
progressPanel.setIndeterminate(true);
|
progressPanel.setIndeterminate(true);
|
||||||
@ -133,7 +131,7 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule {
|
|||||||
HashDb hashSet = configPanel.getSelectedHashDatabase();
|
HashDb hashSet = configPanel.getSelectedHashDatabase();
|
||||||
if (hashSet == null) {
|
if (hashSet == null) {
|
||||||
logger.log(Level.WARNING, "No hash set selected for export."); //NON-NLS
|
logger.log(Level.WARNING, "No hash set selected for export."); //NON-NLS
|
||||||
MessageNotifyUtil.Message.error(Bundle.AddTaggedHashesToHashDb_error_noHashSetsSelected());
|
progressPanel.updateStatusLabel(Bundle.AddTaggedHashesToHashDb_error_noHashSetsSelected());
|
||||||
progressPanel.setIndeterminate(false);
|
progressPanel.setIndeterminate(false);
|
||||||
progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR);
|
progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR);
|
||||||
return;
|
return;
|
||||||
@ -145,7 +143,7 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule {
|
|||||||
List<TagName> tagNames = configPanel.getSelectedTagNames();
|
List<TagName> tagNames = configPanel.getSelectedTagNames();
|
||||||
if (tagNames.isEmpty()) {
|
if (tagNames.isEmpty()) {
|
||||||
logger.log(Level.WARNING, "No tags selected for export."); //NON-NLS
|
logger.log(Level.WARNING, "No tags selected for export."); //NON-NLS
|
||||||
MessageNotifyUtil.Message.error(Bundle.AddTaggedHashesToHashDb_error_noTagsSelected());
|
progressPanel.updateStatusLabel(Bundle.AddTaggedHashesToHashDb_error_noTagsSelected());
|
||||||
progressPanel.setIndeterminate(false);
|
progressPanel.setIndeterminate(false);
|
||||||
progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR);
|
progressPanel.complete(ReportProgressPanel.ReportStatus.ERROR);
|
||||||
return;
|
return;
|
||||||
@ -172,14 +170,14 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule {
|
|||||||
failedExports.add(tag.getContent().getName());
|
failedExports.add(tag.getContent().getName());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "Unable to add the " + (tags.size() > 1 ? "files" : "file") + " to the hash set. Hashes have not been calculated. Please configure and run an appropriate ingest module.", "Add to Hash Set Error", JOptionPane.ERROR_MESSAGE);
|
progressPanel.updateStatusLabel("Unable to add the " + (tags.size() > 1 ? "files" : "file") + " to the hash set. Hashes have not been calculated. Please configure and run an appropriate ingest module.");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Logger.getLogger(AddTaggedHashesToHashDb.class.getName()).log(Level.SEVERE, "Error adding to hash set", ex);
|
Logger.getLogger(AddTaggedHashesToHashDb.class.getName()).log(Level.SEVERE, "Error adding to hash set", ex);
|
||||||
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "Error getting selected tags for case.", "Hash Export Error", JOptionPane.ERROR_MESSAGE);
|
progressPanel.updateStatusLabel("Error getting selected tags for case.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!failedExports.isEmpty()) {
|
if (!failedExports.isEmpty()) {
|
||||||
@ -193,7 +191,7 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule {
|
|||||||
errorMessage.append(".");
|
errorMessage.append(".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), errorMessage.toString(), "Hash Export Error", JOptionPane.ERROR_MESSAGE);
|
progressPanel.updateStatusLabel(errorMessage.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
progressPanel.setIndeterminate(false);
|
progressPanel.setIndeterminate(false);
|
||||||
|
@ -100,10 +100,7 @@ class AddTaggedHashesToHashDbConfigPanel extends javax.swing.JPanel {
|
|||||||
// There may not be a case open when configuring report modules for Command Line execution
|
// There may not be a case open when configuring report modules for Command Line execution
|
||||||
tagNames = Case.getCurrentCaseThrows().getServices().getTagsManager().getTagNamesInUse();
|
tagNames = Case.getCurrentCaseThrows().getServices().getTagsManager().getTagNamesInUse();
|
||||||
} catch (TskCoreException ex) {
|
} catch (TskCoreException ex) {
|
||||||
Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.WARNING, "Failed to get tag names", ex);
|
Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
|
||||||
// ELTODO remove all these JOptionPane.showMessageDialog(this, "Error getting tag names for case.", "Tag Names Not Found", JOptionPane.ERROR_MESSAGE);
|
|
||||||
// import javax.swing.JOptionPane;
|
|
||||||
// import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
|
|
||||||
} catch (NoCurrentCaseException ex) {
|
} catch (NoCurrentCaseException ex) {
|
||||||
// There may not be a case open when configuring report modules for Command Line execution
|
// There may not be a case open when configuring report modules for Command Line execution
|
||||||
Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.WARNING, "Exception while getting open case.", ex);
|
Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.WARNING, "Exception while getting open case.", ex);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user