Merge branch 'develop' of https://github.com/sleuthkit/autopsy into 3544_mediacontentviewer

This commit is contained in:
Raman 2018-02-28 10:10:29 -05:00
commit 2895060b3b
120 changed files with 1418 additions and 771 deletions

View File

@ -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");
@ -25,6 +25,7 @@ import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.BlackboardArtifact;
@ -86,7 +87,7 @@ public class AddBlackboardArtifactTagAction extends AddTagAction {
} catch (TskCoreException ex) {
Logger.getLogger(AddBlackboardArtifactTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"AddBlackboardArtifactTagAction.unableToTag.msg",
artifact.getDisplayName()),

View File

@ -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");
@ -25,6 +25,7 @@ import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile;
@ -94,7 +95,7 @@ public class AddContentTagAction extends AddTagAction {
file = (AbstractFile) parentFile;
} else {
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"AddContentTagAction.unableToTag.msg",
parentFile.getName()),
@ -113,7 +114,7 @@ public class AddContentTagAction extends AddTagAction {
} else {
final Content parentFileCopy = parentFile;
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"AddContentTagAction.unableToTag.msg",
parentFileCopy.getName()),
@ -126,7 +127,7 @@ public class AddContentTagAction extends AddTagAction {
} else {
final Content parentFileCopy = parentFile;
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"AddContentTagAction.unableToTag.msg",
parentFileCopy.getName()),
@ -143,7 +144,7 @@ public class AddContentTagAction extends AddTagAction {
Logger.getLogger(AddContentTagAction.class.getName()).log(Level.SEVERE, "Error tagging result", ex); //NON-NLS
AbstractFile fileCopy = file;
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"AddContentTagAction.unableToTag.msg2",
fileCopy.getName()),

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013-2017 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -20,23 +20,16 @@ package org.sleuthkit.autopsy.actions;
import java.awt.event.ActionEvent;
import java.util.Collection;
import java.util.HashSet;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import javafx.application.Platform;
import javafx.scene.control.Alert;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.BlackboardArtifactTag;
import org.sleuthkit.datamodel.TagName;
import org.sleuthkit.datamodel.TskCoreException;
/**
@ -51,7 +44,7 @@ import org.sleuthkit.datamodel.TskCoreException;
})
public class DeleteBlackboardArtifactTagAction extends AbstractAction {
private static final Logger LOGGER = Logger.getLogger(DeleteBlackboardArtifactTagAction.class.getName());
private static final Logger logger = Logger.getLogger(DeleteBlackboardArtifactTagAction.class.getName());
private static final long serialVersionUID = 1L;
private static final String MENU_TEXT = NbBundle.getMessage(DeleteBlackboardArtifactTagAction.class,
@ -83,7 +76,7 @@ public class DeleteBlackboardArtifactTagAction extends AbstractAction {
} catch (TskCoreException ex) {
Logger.getLogger(DeleteBlackboardArtifactTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); //NON-NLS
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"DeleteBlackboardArtifactTagAction.unableToDelTag.msg",
tag.getName()),

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013-2017 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -20,23 +20,16 @@ package org.sleuthkit.autopsy.actions;
import java.awt.event.ActionEvent;
import java.util.Collection;
import java.util.HashSet;
import java.util.concurrent.ExecutionException;
import java.util.logging.Level;
import javafx.application.Platform;
import javafx.scene.control.Alert;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.SwingWorker;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.ContentTag;
import org.sleuthkit.datamodel.TagName;
import org.sleuthkit.datamodel.TskCoreException;
/**
@ -50,7 +43,7 @@ import org.sleuthkit.datamodel.TskCoreException;
})
public class DeleteContentTagAction extends AbstractAction {
private static final Logger LOGGER = Logger.getLogger(DeleteContentTagAction.class.getName());
private static final Logger logger = Logger.getLogger(DeleteContentTagAction.class.getName());
private static final long serialVersionUID = 1L;
private static final String MENU_TEXT = NbBundle.getMessage(DeleteContentTagAction.class,
@ -82,7 +75,7 @@ public class DeleteContentTagAction extends AbstractAction {
} catch (TskCoreException ex) {
Logger.getLogger(DeleteContentTagAction.class.getName()).log(Level.SEVERE, "Error deleting tag", ex); //NON-NLS
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"DeleteContentTagAction.unableToDelTag.msg",
tag.getName()),

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -326,19 +326,19 @@ public class GetTagNameDialog extends JDialog {
String userTagDescription = descriptionTextArea.getText();
TskData.FileKnown status = notableCheckbox.isSelected() ? TskData.FileKnown.BAD : TskData.FileKnown.UNKNOWN;
if (tagDisplayName.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(this.getClass(),
"GetTagNameDialog.mustSupplyTtagName.msg"),
NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagNameErr"),
JOptionPane.ERROR_MESSAGE);
} else if (TagsManager.containsIllegalCharacters(tagDisplayName)) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(this.getClass(), "GetTagNameDialog.illegalChars.msg"),
NbBundle.getMessage(this.getClass(), "GetTagNameDialog.illegalCharsErr"),
JOptionPane.ERROR_MESSAGE);
} else if (userTagDescription.contains(",")
|| userTagDescription.contains(";")) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagDescriptionIllegalCharacters.message"),
NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagDescriptionIllegalCharacters.title"),
JOptionPane.ERROR_MESSAGE);
@ -351,7 +351,7 @@ public class GetTagNameDialog extends JDialog {
dispose();
} catch (TskCoreException ex) {
Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, "Error adding " + tagDisplayName + " tag name", ex); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(this.getClass(),
"GetTagNameDialog.unableToAddTagNameToCase.msg",
tagDisplayName),
@ -363,7 +363,7 @@ public class GetTagNameDialog extends JDialog {
tagName = Case.getCurrentCase().getServices().getTagsManager().getDisplayNamesToTagNamesMap().get(tagDisplayName);
} catch (TskCoreException ex1) {
Logger.getLogger(AddTagAction.class.getName()).log(Level.SEVERE, tagDisplayName + " exists in database but an error occurred in retrieving it.", ex1); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(this.getClass(),
"GetTagNameDialog.tagNameExistsTskCore.msg",
tagDisplayName),
@ -373,7 +373,7 @@ public class GetTagNameDialog extends JDialog {
}
}
} else {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagNameAlreadyExists.message"),
NbBundle.getMessage(this.getClass(), "GetTagNameDialog.tagNameAlreadyExists.title"),
JOptionPane.INFORMATION_MESSAGE);

View File

@ -31,6 +31,7 @@ import org.openide.awt.ActionRegistration;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.openide.util.actions.CallableSystemAction;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
@ -73,7 +74,7 @@ public final class OpenOutputFolderAction extends CallableSystemAction {
}
} catch (IllegalStateException ex) {
logger.log(Level.SEVERE, "OpenOutputFolderAction enabled with no current case", ex); //NON-NLS
JOptionPane.showMessageDialog(null, NbBundle.getMessage(this.getClass(), "OpenOutputFolder.noCaseOpen"));
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(this.getClass(), "OpenOutputFolder.noCaseOpen"));
}
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013-2016 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -43,6 +43,7 @@ class AddImageTask implements Runnable {
private final Logger logger = Logger.getLogger(AddImageTask.class.getName());
private final String deviceId;
private final String imagePath;
private final int sectorSize;
private final String timeZone;
private final ImageWriterSettings imageWriterSettings;
private final boolean ignoreFatOrphanFiles;
@ -75,6 +76,7 @@ class AddImageTask implements Runnable {
* intended to be unique across multiple cases
* (e.g., a UUID).
* @param imagePath Path to the image file.
* @param sectorSize The sector size (use '0' for autodetect).
* @param timeZone The time zone to use when processing dates
* and times for the image, obtained from
* java.util.TimeZone.getID.
@ -87,10 +89,11 @@ class AddImageTask implements Runnable {
* processing.
* @param callback Callback to call when processing is done.
*/
AddImageTask(String deviceId, String imagePath, String timeZone, boolean ignoreFatOrphanFiles, ImageWriterSettings imageWriterSettings,
AddImageTask(String deviceId, String imagePath, int sectorSize, String timeZone, boolean ignoreFatOrphanFiles, ImageWriterSettings imageWriterSettings,
DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) {
this.deviceId = deviceId;
this.imagePath = imagePath;
this.sectorSize = sectorSize;
this.timeZone = timeZone;
this.ignoreFatOrphanFiles = ignoreFatOrphanFiles;
this.imageWriterSettings = imageWriterSettings;
@ -126,9 +129,7 @@ class AddImageTask implements Runnable {
Thread progressUpdateThread = new Thread(new ProgressUpdater(progressMonitor, tskAddImageProcess));
progressUpdateThread.start();
runAddImageProcess(errorMessages);
if (null != progressUpdateThread) {
progressUpdateThread.interrupt();
}
progressUpdateThread.interrupt();
commitOrRevertAddImageProcess(currentCase, errorMessages, newDataSources);
progressMonitor.setProgress(100);
} finally {
@ -178,7 +179,7 @@ class AddImageTask implements Runnable {
*/
private void runAddImageProcess(List<String> errorMessages) {
try {
tskAddImageProcess.run(deviceId, new String[]{imagePath});
tskAddImageProcess.run(deviceId, new String[]{imagePath}, sectorSize);
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, String.format("Critical error occurred adding image %s", imagePath), ex); //NON-NLS
criticalErrorOccurred = true;

View File

@ -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");
@ -300,7 +300,7 @@ class AddImageWizardAddingProgressPanel extends ShortcutWizardDescriptorPanel {
for (String warning : warnings) {
warningMessage.append(warning).append("\n");
}
JOptionPane.showMessageDialog(null, warningMessage.toString());
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), warningMessage.toString());
}
}

View File

@ -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");
@ -65,6 +65,7 @@ class AddImageWizardDataSourceSettingsPanel extends ShortcutWizardDescriptorPane
if (component == null) {
WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
component = new AddImageWizardDataSourceSettingsVisual(this);
component.setLocation(WindowManager.getDefault().getMainWindow().getLocation());
}
component.addPropertyChangeListener(this);
return component;

View File

@ -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");
@ -27,6 +27,7 @@ import javax.swing.event.ChangeListener;
import org.openide.WizardDescriptor;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.autopsy.ingest.IngestJobSettings;
import org.sleuthkit.autopsy.ingest.IngestJobSettingsPanel;
@ -170,7 +171,7 @@ class AddImageWizardIngestConfigPanel extends ShortcutWizardDescriptorPanel {
for (String warning : warnings) {
warningMessage.append(warning).append("\n");
}
JOptionPane.showMessageDialog(null, warningMessage.toString());
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), warningMessage.toString());
}
}

View File

@ -132,7 +132,7 @@ LocalFilesPanel.moduleErr=Module Error
LocalFilesPanel.moduleErr.msg=A module caused an error listening to LocalFilesPanel updates. See log to determine which module. Some data could be incomplete.
MissingImageDialog.allDesc.text=All Supported Types
MissingImageDialog.display.title=Search for Missing Image
MissingImageDialog.confDlg.noFileSel.msg=No image file has been selected, are you sure you\nwould like to exit without finding the image.
MissingImageDialog.confDlg.noFileSel.msg=No image file has been selected. Are you sure you\nwould like to exit without finding the image?
MissingImageDialog.confDlg.noFileSel.title=Missing Image
MissingImageDialog.ErrorSettingImage=Error setting image path. Please try again.
NewCaseVisualPanel1.getName.text=Case Information
@ -162,7 +162,6 @@ StartupWindow.title.text=Welcome
UpdateRecentCases.menuItem.clearRecentCases.text=Clear Recent Cases
UpdateRecentCases.menuItem.empty=-Empty-
AddImageWizardIngestConfigPanel.CANCEL_BUTTON.text=Cancel
ImageFilePanel.errorLabel.text=Error Label
NewCaseVisualPanel1.CaseFolderOnCDriveError.text=Warning: Path to multi-user case folder is on \"C:\" drive
CollaborationMonitor.addingDataSourceStatus.msg={0} adding data source
CollaborationMonitor.analyzingDataSourceStatus.msg={0} analyzing {1}
@ -218,6 +217,8 @@ MultiUserCasesPanel.bnOpenSingleUserCase.text=Open Single-User Case...
CueBannerPanel.newCaseButton.text=
MultiUserCasesPanel.searchLabel.text=Select any case and start typing to search by case name
MultiUserCasesPanel.cancelButton.text=Cancel
ImageFilePanel.pathErrorLabel.text=Error Label
ImageFilePanel.sectorSizeLabel.text=Sector size:
LocalFilesPanel.displayNameLabel.text=Logical File Set Display Name: Default
LocalFilesPanel.errorLabel.text=Error Label
LocalFilesPanel.selectedPaths.toolTipText=

View File

@ -134,6 +134,7 @@ UpdateRecentCases.menuItem.empty=-\u7a7a\u767d-
ImageFilePanel.noFatOrphansCheckbox.text=FAT\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u30aa\u30fc\u30d5\u30a1\u30f3\u30d5\u30a1\u30a4\u30eb\u306f\u7121\u8996
LocalDiskPanel.noFatOrphansCheckbox.text=FAT\u30d5\u30a1\u30a4\u30eb\u30b7\u30b9\u30c6\u30e0\u306e\u30aa\u30fc\u30d5\u30a1\u30f3\u30d5\u30a1\u30a4\u30eb\u306f\u7121\u8996
AddImageWizardIngestConfigPanel.CANCEL_BUTTON.text=\u30ad\u30e3\u30f3\u30bb\u30eb
LocalFilesPanel.errorLabel.text=\u30a8\u30e9\u30fc\u30e9\u30d9\u30eb
ImageFilePanel.errorLabel.text=\u30a8\u30e9\u30fc\u30e9\u30d9\u30eb
NewCaseVisualPanel1.caseTypeLabel.text=\u30b1\u30fc\u30b9\u30bf\u30a4\u30d7\uff1a
Case.databaseConnectionInfo.error.msg=\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b5\u30fc\u30d0\u30fc\u306e\u63a5\u7d9a\u60c5\u5831\u3092\u5165\u624b\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u30c4\u30fc\u30eb\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3001\u8907\u6570\u30e6\u30fc\u30b6\u30fc\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002
@ -188,6 +189,8 @@ OpenMultiUserCasePanel.cancelButton.text=\u30ad\u30e3\u30f3\u30bb\u30eb
OpenMultiUserCasePanel.jLabel1.text=\u6700\u8fd1\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb
CueBannerPanel.newCaseLabel.text=\u65b0\u898f\u30b1\u30fc\u30b9\u3092\u4f5c\u6210
CueBannerPanel.openCaseLabel.text=\u65e2\u5b58\u30b1\u30fc\u30b9\u3092\u958b\u304f
ImageFilePanel.pathErrorLabel.text=\u30a8\u30e9\u30fc\u30e9\u30d9\u30eb
ImageFilePanel.sectorSizeLabel.text=\u30a4\u30f3\u30d7\u30c3\u30c8\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u9078\u629e\u3057\u3066\u4e0b\u3055\u3044\uff1a
LocalFilesPanel.errorLabel.text=\u30a8\u30e9\u30fc\u30e9\u30d9\u30eb
LocalFilesPanel.clearButton.toolTipText=\u73fe\u5728\u9078\u629e\u3055\u308c\u3066\u3044\u308b\u30ed\u30fc\u30ab\u30eb\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u304c\u30af\u30ea\u30a2\u3055\u308c\u307e\u3059
LocalFilesPanel.clearButton.text=\u30af\u30ea\u30a2

View File

@ -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");
@ -998,17 +998,16 @@ public class Case {
}
}
private static String getNameForTitle(){
private static String getNameForTitle() {
//Method should become unnecessary once technical debt story 3334 is done.
if (UserPreferences.getAppName().equals(Version.getName())){
if (UserPreferences.getAppName().equals(Version.getName())) {
//Available version number is version number for this application
return String.format("%s %s", UserPreferences.getAppName(), Version.getVersion());
}
else {
} else {
return UserPreferences.getAppName();
}
}
/**
* Update the GUI to to reflect the current case.
*/
@ -1526,7 +1525,25 @@ public class Case {
* @throws TskCoreException if there is a problem adding the report to the
* case database.
*/
public void addReport(String localPath, String srcModuleName, String reportName) throws TskCoreException {
public Report addReport(String localPath, String srcModuleName, String reportName) throws TskCoreException {
return addReport(localPath, srcModuleName, reportName, null);
}
/**
* Adds a report to the case.
*
* @param localPath The path of the report file, must be in the case
* directory or one of its subdirectories.
* @param srcModuleName The name of the module that created the report.
* @param reportName The report name, may be empty.
* @param parent The Content used to create the report, if available.
*
* @return The new Report instance.
*
* @throws TskCoreException if there is a problem adding the report to the
* case database.
*/
public Report addReport(String localPath, String srcModuleName, String reportName, Content parent) throws TskCoreException {
String normalizedLocalPath;
try {
normalizedLocalPath = Paths.get(localPath).normalize().toString();
@ -1534,8 +1551,9 @@ public class Case {
String errorMsg = "Invalid local path provided: " + localPath; // NON-NLS
throw new TskCoreException(errorMsg, ex);
}
Report report = this.caseDb.addReport(normalizedLocalPath, srcModuleName, reportName);
Report report = this.caseDb.addReport(normalizedLocalPath, srcModuleName, reportName, parent);
eventPublisher.publish(new ReportAddedEvent(report));
return report;
}
/**
@ -1616,13 +1634,14 @@ public class Case {
/**
* Constructs a Case object for a new Autopsy case.
*
* @param caseType The type of case (single-user or multi-user).
* @param caseDir The full path of the case directory. The directory
* will be created if it doesn't already exist; if it
* exists, it is ASSUMED it was created by calling
* createCaseDirectory.
* @param caseDetails Contains details of the case, such as examiner, display name, etc
*
* @param caseType The type of case (single-user or multi-user).
* @param caseDir The full path of the case directory. The directory
* will be created if it doesn't already exist; if it
* exists, it is ASSUMED it was created by calling
* createCaseDirectory.
* @param caseDetails Contains details of the case, such as examiner,
* display name, etc
*
*/
private Case(CaseType caseType, String caseDir, CaseDetails caseDetails) {
metadata = new CaseMetadata(caseType, caseDir, displayNameToUniqueName(caseDetails.getCaseDisplayName()), caseDetails);

View File

@ -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");
@ -33,6 +33,7 @@ import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.openide.util.actions.CallableSystemAction;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.coreutils.Logger;
/**
@ -44,7 +45,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
final class CaseDeleteAction extends CallableSystemAction {
private static final long serialVersionUID = 1L;
private static final Logger LOGGER = Logger.getLogger(CaseDeleteAction.class.getName());
private static final Logger logger = Logger.getLogger(CaseDeleteAction.class.getName());
CaseDeleteAction() {
putValue(Action.NAME, NbBundle.getMessage(CaseDeleteAction.class, "CTL_CaseDeleteAction"));
@ -95,9 +96,9 @@ final class CaseDeleteAction extends CallableSystemAction {
try {
get();
} catch (InterruptedException | ExecutionException ex) {
LOGGER.log(Level.SEVERE, String.format("Failed to delete case %s at %s", caseName, caseDirectory), ex);
logger.log(Level.SEVERE, String.format("Failed to delete case %s at %s", caseName, caseDirectory), ex);
JOptionPane.showMessageDialog(
null,
WindowManager.getDefault().getMainWindow(),
Bundle.Case_deleteCaseFailureMessageBox_message(ex.getLocalizedMessage()),
Bundle.Case_deleteCaseFailureMessageBox_title(),
JOptionPane.ERROR_MESSAGE);
@ -110,7 +111,7 @@ final class CaseDeleteAction extends CallableSystemAction {
}.execute();
}
} catch (IllegalStateException ex) {
LOGGER.log(Level.SEVERE, "Case delete action called with no current case", ex);
logger.log(Level.SEVERE, "Case delete action called with no current case", ex);
}
}

View File

@ -18,8 +18,6 @@
*/
package org.sleuthkit.autopsy.casemodule;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JDialog;
@ -161,11 +159,7 @@ class CaseInformationPanel extends javax.swing.JPanel {
editCasePropertiesDialog.add(editCasePropertiesPanel);
editCasePropertiesDialog.setResizable(true);
editCasePropertiesDialog.pack();
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
double w = editCasePropertiesDialog.getSize().getWidth();
double h = editCasePropertiesDialog.getSize().getHeight();
editCasePropertiesDialog.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2));
editCasePropertiesDialog.setLocationRelativeTo(this);
editCasePropertiesDialog.setVisible(true);
editCasePropertiesDialog.toFront();
propertiesPanel.updateCaseInfo();

View File

@ -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");
@ -18,8 +18,7 @@
*/
package org.sleuthkit.autopsy.casemodule;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeEvent;
import java.util.EnumSet;
@ -52,7 +51,8 @@ final class CasePropertiesAction extends CallableSystemAction {
public void performAction() {
SwingUtilities.invokeLater(() -> {
String title = NbBundle.getMessage(this.getClass(), "CasePropertiesAction.window.title");
casePropertiesDialog = new JDialog(WindowManager.getDefault().getMainWindow(), title, true);
Frame mainWindow = WindowManager.getDefault().getMainWindow();
casePropertiesDialog = new JDialog(mainWindow, title, true);
CaseInformationPanel caseInformationPanel = new CaseInformationPanel();
caseInformationPanel.addCloseButtonAction((ActionEvent e) -> {
casePropertiesDialog.setVisible(false);
@ -60,11 +60,7 @@ final class CasePropertiesAction extends CallableSystemAction {
casePropertiesDialog.add(caseInformationPanel);
casePropertiesDialog.setResizable(true);
casePropertiesDialog.pack();
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
double w = casePropertiesDialog.getSize().getWidth();
double h = casePropertiesDialog.getSize().getHeight();
casePropertiesDialog.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2));
casePropertiesDialog.setLocationRelativeTo(mainWindow);
casePropertiesDialog.setVisible(true);
casePropertiesDialog.toFront();
});

View File

@ -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");
@ -246,7 +246,7 @@ public class CueBannerPanel extends javax.swing.JPanel {
}//GEN-LAST:event_openCaseButtonActionPerformed
private void openRecentCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openRecentCaseButtonActionPerformed
recentCasesWindow.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
recentCasesWindow.setLocationRelativeTo(this);
OpenRecentCasePanel.getInstance(); //refreshes the recent cases table
recentCasesWindow.setVisible(true);
}//GEN-LAST:event_openRecentCaseButtonActionPerformed

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013-2016 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -63,6 +63,7 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
*/
private String deviceId;
private String imagePath;
private int sectorSize;
private String timeZone;
private boolean ignoreFatOrphanFiles;
private boolean setDataSourceOptionsCalled;
@ -157,10 +158,11 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
configPanel.storeSettings();
deviceId = UUID.randomUUID().toString();
imagePath = configPanel.getContentPaths();
sectorSize = configPanel.getSectorSize();
timeZone = configPanel.getTimeZone();
ignoreFatOrphanFiles = configPanel.getNoFatOrphans();
}
run(deviceId, imagePath, timeZone, ignoreFatOrphanFiles, progressMonitor, callback);
run(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, progressMonitor, callback);
}
/**
@ -185,7 +187,33 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
* @param callback Callback to call when processing is done.
*/
public void run(String deviceId, String imagePath, String timeZone, boolean ignoreFatOrphanFiles, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) {
addImageTask = new AddImageTask(deviceId, imagePath, timeZone, ignoreFatOrphanFiles, null, progressMonitor, callback);
run(deviceId, imagePath, 0, timeZone, ignoreFatOrphanFiles, progressMonitor, callback);
}
/**
* Adds a data source to the case database using a background task in a
* separate thread and the given settings instead of those provided by the
* selection and configuration panel. Returns as soon as the background task
* is started and uses the callback object to signal task completion and
* return results.
*
* @param deviceId An ASCII-printable identifier for the device
* associated with the data source that is
* intended to be unique across multiple cases
* (e.g., a UUID).
* @param imagePath Path to the image file.
* @param sectorSize The sector size (use '0' for autodetect).
* @param timeZone The time zone to use when processing dates
* and times for the image, obtained from
* java.util.TimeZone.getID.
* @param ignoreFatOrphanFiles Whether to parse orphans if the image has a
* FAT filesystem.
* @param progressMonitor Progress monitor for reporting progress
* during processing.
* @param callback Callback to call when processing is done.
*/
private void run(String deviceId, String imagePath, int sectorSize, String timeZone, boolean ignoreFatOrphanFiles, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) {
addImageTask = new AddImageTask(deviceId, imagePath, sectorSize, timeZone, ignoreFatOrphanFiles, null, progressMonitor, callback);
new Thread(addImageTask).start();
}
@ -253,10 +281,11 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
public void process(String deviceId, Path dataSourcePath, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callBack) throws AutoIngestDataSourceProcessorException {
this.deviceId = deviceId;
this.imagePath = dataSourcePath.toString();
this.sectorSize = 0;
this.timeZone = Calendar.getInstance().getTimeZone().getID();
this.ignoreFatOrphanFiles = false;
setDataSourceOptionsCalled = true;
run(deviceId, dataSourcePath.toString(), timeZone, ignoreFatOrphanFiles, progressMonitor, callBack);
run(deviceId, dataSourcePath.toString(), sectorSize, timeZone, ignoreFatOrphanFiles, progressMonitor, callBack);
}
/**
@ -276,6 +305,7 @@ public class ImageDSProcessor implements DataSourceProcessor, AutoIngestDataSour
public void setDataSourceOptions(String imagePath, String timeZone, boolean ignoreFatOrphanFiles) {
this.deviceId = UUID.randomUUID().toString();
this.imagePath = imagePath;
this.sectorSize = 0;
this.timeZone = Calendar.getInstance().getTimeZone().getID();
this.ignoreFatOrphanFiles = ignoreFatOrphanFiles;
setDataSourceOptionsCalled = true;

View File

@ -43,7 +43,12 @@
<EmptySpace min="21" pref="21" max="-2" attributes="0"/>
<Component id="descLabel" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="errorLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="pathErrorLabel" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="sectorSizeLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="sectorSizeComboBox" min="-2" pref="85" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="20" max="32767" attributes="0"/>
</Group>
@ -59,7 +64,7 @@
<Component id="pathTextField" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
<Component id="errorLabel" min="-2" max="-2" attributes="0"/>
<Component id="pathErrorLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="timeZoneLabel" alignment="3" min="-2" max="-2" attributes="0"/>
@ -69,7 +74,12 @@
<Component id="noFatOrphansCheckbox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="descLabel" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="sectorSizeLabel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="sectorSizeComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="43" max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@ -134,15 +144,32 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="errorLabel">
<Component class="javax.swing.JLabel" name="pathErrorLabel">
<Properties>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="ff" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="ImageFilePanel.errorLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="ImageFilePanel.pathErrorLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="sectorSizeLabel">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/casemodule/Bundle.properties" key="ImageFilePanel.sectorSizeLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="sectorSizeComboBox">
<Properties>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
</SubComponents>
</Form>

View File

@ -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");
@ -49,6 +49,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
private static final Logger logger = Logger.getLogger(ImageFilePanel.class.getName());
private static final String PROP_LASTIMAGE_PATH = "LBL_LastImage_PATH"; //NON-NLS
private static final String[] SECTOR_SIZE_CHOICES = {"Auto Detect", "512", "1024", "2048", "4096"};
private final JFileChooser fileChooser = new JFileChooser();
@ -76,7 +77,13 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
// set the selected timezone to the current timezone
timeZoneComboBox.setSelectedItem(timeZoneToString(Calendar.getInstance().getTimeZone()));
errorLabel.setVisible(false);
// Populate the drop down list of sector size options
for (String choice : SECTOR_SIZE_CHOICES) {
sectorSizeComboBox.addItem(choice);
}
sectorSizeComboBox.setSelectedIndex(0);
pathErrorLabel.setVisible(false);
fileChooser.setDragEnabled(false);
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
@ -116,10 +123,12 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
browseButton = new javax.swing.JButton();
pathTextField = new javax.swing.JTextField();
timeZoneLabel = new javax.swing.JLabel();
timeZoneComboBox = new javax.swing.JComboBox<String>();
timeZoneComboBox = new javax.swing.JComboBox<>();
noFatOrphansCheckbox = new javax.swing.JCheckBox();
descLabel = new javax.swing.JLabel();
errorLabel = new javax.swing.JLabel();
pathErrorLabel = new javax.swing.JLabel();
sectorSizeLabel = new javax.swing.JLabel();
sectorSizeComboBox = new javax.swing.JComboBox<>();
setMinimumSize(new java.awt.Dimension(0, 65));
setPreferredSize(new java.awt.Dimension(403, 65));
@ -144,8 +153,10 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
org.openide.awt.Mnemonics.setLocalizedText(descLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.descLabel.text")); // NOI18N
errorLabel.setForeground(new java.awt.Color(255, 0, 0));
org.openide.awt.Mnemonics.setLocalizedText(errorLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.errorLabel.text")); // NOI18N
pathErrorLabel.setForeground(new java.awt.Color(255, 0, 0));
org.openide.awt.Mnemonics.setLocalizedText(pathErrorLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.pathErrorLabel.text")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(sectorSizeLabel, org.openide.util.NbBundle.getMessage(ImageFilePanel.class, "ImageFilePanel.sectorSizeLabel.text")); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
@ -167,7 +178,11 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
.addGroup(layout.createSequentialGroup()
.addGap(21, 21, 21)
.addComponent(descLabel))
.addComponent(errorLabel))
.addComponent(pathErrorLabel)
.addGroup(layout.createSequentialGroup()
.addComponent(sectorSizeLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(0, 20, Short.MAX_VALUE))
);
layout.setVerticalGroup(
@ -179,7 +194,7 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
.addComponent(browseButton)
.addComponent(pathTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(3, 3, 3)
.addComponent(errorLabel)
.addComponent(pathErrorLabel)
.addGap(1, 1, 1)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(timeZoneLabel)
@ -188,7 +203,11 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
.addComponent(noFatOrphansCheckbox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(descLabel)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(sectorSizeLabel)
.addComponent(sectorSizeComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(43, Short.MAX_VALUE))
);
}// </editor-fold>//GEN-END:initComponents
@ -225,10 +244,12 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton browseButton;
private javax.swing.JLabel descLabel;
private javax.swing.JLabel errorLabel;
private javax.swing.JCheckBox noFatOrphansCheckbox;
private javax.swing.JLabel pathErrorLabel;
private javax.swing.JLabel pathLabel;
private javax.swing.JTextField pathTextField;
private javax.swing.JComboBox<String> sectorSizeComboBox;
private javax.swing.JLabel sectorSizeLabel;
private javax.swing.JComboBox<String> timeZoneComboBox;
private javax.swing.JLabel timeZoneLabel;
// End of variables declaration//GEN-END:variables
@ -251,6 +272,21 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
pathTextField.setText(s);
}
/**
* Get the sector size.
*
* @return 0 if autodetect; otherwise the value selected.
*/
public int getSectorSize() {
int sectorSizeSelectionIndex = sectorSizeComboBox.getSelectedIndex();
if (sectorSizeSelectionIndex == 0) {
return 0;
}
return Integer.valueOf((String) sectorSizeComboBox.getSelectedItem());
}
public String getTimeZone() {
String tz = timeZoneComboBox.getSelectedItem().toString();
return tz.substring(tz.indexOf(')') + 2).trim();
@ -270,18 +306,18 @@ public class ImageFilePanel extends JPanel implements DocumentListener {
*
* @return true if a proper image has been selected, false otherwise
*/
@NbBundle.Messages("DataSourceOnCDriveError.text=Warning: Path to multi-user data source is on \"C:\" drive")
@NbBundle.Messages("ImageFilePanel.pathValidation.dataSourceOnCDriveError=Warning: Path to multi-user data source is on \"C:\" drive")
public boolean validatePanel() {
errorLabel.setVisible(false);
pathErrorLabel.setVisible(false);
String path = getContentPaths();
if (StringUtils.isBlank(path)) {
return false;
}
// display warning if there is one (but don't disable "next" button)
// Display warning if there is one (but don't disable "next" button)
if (false == PathValidator.isValid(path, Case.getCurrentCase().getCaseType())) {
errorLabel.setVisible(true);
errorLabel.setText(Bundle.DataSourceOnCDriveError_text());
pathErrorLabel.setVisible(true);
pathErrorLabel.setText(Bundle.ImageFilePanel_pathValidation_dataSourceOnCDriveError());
}
return new File(path).isFile()

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -27,6 +27,7 @@ import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.table.AbstractTableModel;
import org.openide.util.NbBundle.Messages;
@ -81,7 +82,7 @@ public final class IngestJobInfoPanel extends javax.swing.JPanel {
this.repaint();
} catch (TskCoreException ex) {
logger.log(Level.SEVERE, "Failed to load ingest jobs.", ex);
JOptionPane.showMessageDialog(null, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(this, Bundle.IngestJobInfoPanel_loadIngestJob_error_text(), Bundle.IngestJobInfoPanel_loadIngestJob_error_title(), JOptionPane.ERROR_MESSAGE);
}
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013-2017 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -145,7 +145,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor, AutoIngestData
imageWriterSettings = null;
}
}
addDiskTask = new AddImageTask(deviceId, drivePath, timeZone, ignoreFatOrphanFiles, imageWriterSettings, progressMonitor, callback);
addDiskTask = new AddImageTask(deviceId, drivePath, 0, timeZone, ignoreFatOrphanFiles, imageWriterSettings, progressMonitor, callback);
new Thread(addDiskTask).start();
}
@ -171,7 +171,7 @@ public class LocalDiskDSProcessor implements DataSourceProcessor, AutoIngestData
* @param callback Callback to call when processing is done.
*/
public void run(String deviceId, String drivePath, String timeZone, boolean ignoreFatOrphanFiles, DataSourceProcessorProgressMonitor progressMonitor, DataSourceProcessorCallback callback) {
addDiskTask = new AddImageTask(deviceId, drivePath, timeZone, ignoreFatOrphanFiles, imageWriterSettings, progressMonitor, callback);
addDiskTask = new AddImageTask(deviceId, drivePath, 0, timeZone, ignoreFatOrphanFiles, imageWriterSettings, progressMonitor, callback);
new Thread(addDiskTask).start();
}

View File

@ -177,7 +177,8 @@ final class LogicalEvidenceFilePanel extends javax.swing.JPanel implements Docum
* selection
*/
@Messages({
"LogicalEvidenceFilePanel.validatePanel.nonL01Error.text=Only files with the .l01 file extension are supported here."
"LogicalEvidenceFilePanel.validatePanel.nonL01Error.text=Only files with the .l01 file extension are supported here.",
"LogicalEvidenceFilePanel.pathValidation.dataSourceOnCDriveError=Warning: Path to multi-user data source is on \"C:\" drive"
})
boolean validatePanel() {
errorLabel.setVisible(false);
@ -189,7 +190,7 @@ final class LogicalEvidenceFilePanel extends javax.swing.JPanel implements Docum
// display warning if there is one (but don't disable "next" button)
if (!PathValidator.isValid(path, Case.getCurrentCase().getCaseType())) {
errorLabel.setVisible(true);
errorLabel.setText(Bundle.DataSourceOnCDriveError_text());
errorLabel.setText(Bundle.LogicalEvidenceFilePanel_pathValidation_dataSourceOnCDriveError());
return false;
}
//check the extension incase the path was manually entered

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2012-2014 Basis Technology Corp.
* Copyright 2012-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -18,7 +18,6 @@
*/
package org.sleuthkit.autopsy.casemodule;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Arrays;
@ -53,6 +52,12 @@ class MissingImageDialog extends javax.swing.JDialog {
static final GeneralFilter allFilter = new GeneralFilter(allExt, allDesc);
private JFileChooser fc = new JFileChooser();
/**
* Instantiate a MissingImageDialog.
*
* @param obj_id Object ID of the missing image.
* @param db The current SleuthkitCase connected to the database.
*/
private MissingImageDialog(long obj_id, SleuthkitCase db) {
super((JFrame) WindowManager.getDefault().getMainWindow(), true);
this.obj_id = obj_id;
@ -67,15 +72,15 @@ class MissingImageDialog extends javax.swing.JDialog {
fc.addChoosableFileFilter(encaseFilter);
fc.setFileFilter(allFilter);
customInit();
selectButton.setEnabled(false);
}
//
// * Client call to create a MissingImageDialog.
// *
// * @param obj_id obj_id of the missing image
// * @param db the current SleuthkitCase connected to a db
//
/**
* Client call to create a MissingImageDialog.
*
* @param obj_id Object ID of the missing image.
* @param db The current SluethkitCase connected to the database.
*/
static void makeDialog(long obj_id, SleuthkitCase db) {
final MissingImageDialog dialog = new MissingImageDialog(obj_id, db);
dialog.addWindowListener(new WindowAdapter() {
@ -87,33 +92,18 @@ class MissingImageDialog extends javax.swing.JDialog {
dialog.display();
}
private void customInit() {
selectButton.setEnabled(false);
}
/**
* Show the dialog.
*/
private void display() {
this.setTitle(NbBundle.getMessage(this.getClass(), "MissingImageDialog.display.title"));
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
// set the popUp window / JFrame
int w = this.getSize().width;
int h = this.getSize().height;
// set the location of the popUp Window on the center of the screen
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
this.setVisible(true);
}
//
// * Focuses the select button for easy enter-pressing access.
//
private void moveFocusToSelect() {
this.selectButton.requestFocusInWindow();
}
//
// * Enables/disables the select button based off the current panel.
//
/**
* Enables/disables the select button based off the current panel.
*/
private void updateSelectButton() {
// Enable this based on whether there is a valid path
@ -124,11 +114,11 @@ class MissingImageDialog extends javax.swing.JDialog {
}
}
//
// * This method is called from within the constructor to initialize the form.
// * WARNING: Do NOT modify this code. The content of this method is always
// * regenerated by the Form Editor.
//
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
@ -282,8 +272,6 @@ class MissingImageDialog extends javax.swing.JDialog {
}//GEN-LAST:event_cancelButtonActionPerformed
private void pathNameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pathNameTextFieldActionPerformed
// TODO add your handling code here:
updateSelectButton();
}//GEN-LAST:event_pathNameTextFieldActionPerformed
@ -318,11 +306,11 @@ class MissingImageDialog extends javax.swing.JDialog {
private javax.swing.JSeparator titleSeparator;
// End of variables declaration//GEN-END:variables
//
// * Verify the user wants to cancel searching for the image.
//
/**
* Verify the user wants to cancel searching for the image.
*/
void cancel() {
int ret = JOptionPane.showConfirmDialog(null,
int ret = JOptionPane.showConfirmDialog(this,
NbBundle.getMessage(this.getClass(),
"MissingImageDialog.confDlg.noFileSel.msg"),
NbBundle.getMessage(this.getClass(),

View File

@ -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");
@ -29,6 +29,7 @@ import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.WindowManager;
import org.sleuthkit.datamodel.TskData;
@Messages({"TagNameDialog.descriptionLabel.text=Description:",
@ -76,10 +77,7 @@ final class TagNameDialog extends javax.swing.JDialog {
/*
* Center the dialog
*/
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
int width = this.getSize().width;
int height = this.getSize().height;
setLocation((screenDimension.width - width) / 2, (screenDimension.height - height) / 2);
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
/*
* Add a handler for when the dialog window is closed directly.
@ -136,7 +134,7 @@ final class TagNameDialog extends javax.swing.JDialog {
String newTagDisplayName = tagNameTextField.getText().trim();
String descriptionText = descriptionTextArea.getText();
if (newTagDisplayName.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(TagNameDialog.class, "TagNameDialog.JOptionPane.tagNameEmpty.message"),
NbBundle.getMessage(TagNameDialog.class, "TagNameDialog.JOptionPane.tagNameEmpty.title"),
JOptionPane.ERROR_MESSAGE);
@ -144,14 +142,14 @@ final class TagNameDialog extends javax.swing.JDialog {
}
//if a tag name contains illegal characters and is not the name of one of the standard tags
if (TagsManager.containsIllegalCharacters(newTagDisplayName) && !TagNameDefinition.getStandardTagNames().contains(newTagDisplayName)) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(TagNameDialog.class, "TagNameDialog.JOptionPane.tagDescriptionIllegalCharacters.message"),
NbBundle.getMessage(TagNameDialog.class, "TagNameDialog.JOptionPane.tagDescriptionIllegalCharacters.title"),
JOptionPane.ERROR_MESSAGE);
return;
} else if (descriptionText.contains(",")
|| descriptionText.contains(";")) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(TagNameDialog.class, "TagNameDialog.JOptionPane.tagDescriptionIllegalCharacters.message"),
NbBundle.getMessage(TagNameDialog.class, "TagNameDialog.JOptionPane.tagDescriptionIllegalCharacters.title"),
JOptionPane.ERROR_MESSAGE);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -26,6 +26,7 @@ import java.util.Set;
import java.util.TreeSet;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.NbBundle;
@ -327,7 +328,7 @@ final class TagOptionsPanel extends javax.swing.JPanel implements OptionsPanel {
updatePanel();
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
} else {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(TagOptionsPanel.class, "TagOptionsPanel.TagNameDialog.tagNameAlreadyExists.message"),
NbBundle.getMessage(TagOptionsPanel.class, "TagOptionsPanel.TagNameDialog.tagNameAlreadyExists.title"),
JOptionPane.INFORMATION_MESSAGE);

View File

@ -1,7 +1,7 @@
/*
* Central Repository
*
* 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");
@ -18,8 +18,6 @@
*/
package org.sleuthkit.autopsy.centralrepository.optionspanel;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.Collection;
import java.util.logging.Level;
@ -86,8 +84,7 @@ public class AddNewOrganizationDialog extends javax.swing.JDialog {
}
private void display() {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
setVisible(true);
}

View File

@ -1,7 +1,7 @@
/*
* Central Repository
*
* 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");
@ -20,8 +20,6 @@ package org.sleuthkit.autopsy.centralrepository.optionspanel;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
@ -54,7 +52,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings;
*/
public class EamDbSettingsDialog extends JDialog {
private static final Logger LOGGER = Logger.getLogger(EamDbSettingsDialog.class.getName());
private static final Logger logger = Logger.getLogger(EamDbSettingsDialog.class.getName());
private static final String CENTRAL_REPO_DB_NAME = "central_repository";
private static final String CENTRAL_REPO_SQLITE_EXT = ".db";
private static final long serialVersionUID = 1L;
@ -348,8 +346,7 @@ public class EamDbSettingsDialog extends JDialog {
}
private void display() {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
setVisible(true);
}
@ -365,7 +362,7 @@ public class EamDbSettingsDialog extends JDialog {
tfDatabasePath.setText(databaseFile.getCanonicalPath());
valid();
} catch (IOException ex) {
LOGGER.log(Level.SEVERE, "Failed to get path of selected database file", ex); // NON-NLS
logger.log(Level.SEVERE, "Failed to get path of selected database file", ex); // NON-NLS
}
}
}//GEN-LAST:event_bnDatabasePathFileOpenActionPerformed
@ -432,7 +429,7 @@ public class EamDbSettingsDialog extends JDialog {
Bundle.EamDbSettingsDialog_okButton_createPostgresDbError_message(),
Bundle.EamDbSettingsDialog_okButton_createDbError_title(),
JOptionPane.WARNING_MESSAGE);
LOGGER.severe("Unable to initialize database schema or insert contents into central repository.");
logger.severe("Unable to initialize database schema or insert contents into central repository.");
return;
}
break;
@ -453,7 +450,7 @@ public class EamDbSettingsDialog extends JDialog {
Bundle.EamDbSettingsDialog_okButton_createSQLiteDbError_message(),
Bundle.EamDbSettingsDialog_okButton_createDbError_title(),
JOptionPane.WARNING_MESSAGE);
LOGGER.severe("Unable to initialize database schema or insert contents into central repository.");
logger.severe("Unable to initialize database schema or insert contents into central repository.");
return;
}
break;
@ -523,9 +520,9 @@ public class EamDbSettingsDialog extends JDialog {
EamDb.getInstance().shutdownConnections();
}
} catch (EamDbException ex) {
LOGGER.log(Level.SEVERE, "Failed to close database connections in previously selected platform.", ex); // NON-NLS
logger.log(Level.SEVERE, "Failed to close database connections in previously selected platform.", ex); // NON-NLS
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
Bundle.EamDbSettingsDialog_okButton_errorMsg_text(),
Bundle.EamDbSettingsDialog_okButton_errorTitle_text(),
JOptionPane.WARNING_MESSAGE);
@ -548,7 +545,7 @@ public class EamDbSettingsDialog extends JDialog {
EamDb.getInstance().updateSettings();
configurationChanged = true;
} catch (EamDbException ex) {
LOGGER.log(Level.SEVERE, Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), ex); //NON-NLS
logger.log(Level.SEVERE, Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), ex); //NON-NLS
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
return;
}
@ -563,7 +560,7 @@ public class EamDbSettingsDialog extends JDialog {
EamDb.getInstance().updateSettings();
configurationChanged = true;
} catch (EamDbException ex) {
LOGGER.log(Level.SEVERE, Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), ex); //NON-NLS
logger.log(Level.SEVERE, Bundle.EamDbSettingsDialog_okButton_connectionErrorMsg_text(), ex); //NON-NLS
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
return;
}

View File

@ -1,7 +1,7 @@
/*
* Central Repository
*
* 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");
@ -43,7 +43,7 @@ import org.sleuthkit.autopsy.centralrepository.datamodel.SqliteEamDbSettings;
public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel implements OptionsPanel {
private static final long serialVersionUID = 1L;
private static final Logger LOGGER = Logger.getLogger(GlobalSettingsPanel.class.getName());
private static final Logger logger = Logger.getLogger(GlobalSettingsPanel.class.getName());
private final IngestJobEventPropertyChangeListener ingestJobEventListener;
@ -95,7 +95,7 @@ public final class GlobalSettingsPanel extends IngestModuleGlobalSettingsPanel i
boolean result = EamDbUtil.upgradeDatabase();
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
if(! result){
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(this.getClass(),
"GlobalSettingsPanel.updateFailed.message"),
NbBundle.getMessage(this.getClass(),

View File

@ -98,8 +98,7 @@ final class ManageCorrelationPropertiesDialog extends javax.swing.JDialog {
}
private void display() {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
setVisible(true);
}

View File

@ -1,7 +1,7 @@
/*
* Central Repository
*
* 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");
@ -19,8 +19,6 @@
package org.sleuthkit.autopsy.centralrepository.optionspanel;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.util.List;
import java.util.logging.Level;
import javax.swing.DefaultListCellRenderer;
@ -46,7 +44,7 @@ public final class ManageOrganizationsDialog extends JDialog {
private EamDb dbManager;
private EamOrganization newOrg;
private final DefaultListModel<EamOrganization> rulesListModel = new DefaultListModel<>();
private final static Logger LOGGER = Logger.getLogger(ManageOrganizationsDialog.class.getName());
private final static Logger logger = Logger.getLogger(ManageOrganizationsDialog.class.getName());
@Messages({"ManageOrganizationsDialog.title.text=Manage Organizations"})
/**
@ -82,8 +80,7 @@ public final class ManageOrganizationsDialog extends JDialog {
}
private void display() {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
setVisible(true);
}
@ -351,9 +348,9 @@ public final class ManageOrganizationsDialog extends JDialog {
EamDb.getInstance().deleteOrganization(orgToDelete);
populateList();
} catch (EamDbException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
ex.getMessage(), Bundle.ManageOrganizationsDialog_unableToDeleteOrg_title(), JOptionPane.WARNING_MESSAGE);
LOGGER.log(Level.INFO, "Was unable to delete organization from central repository", ex);
logger.log(Level.INFO, "Was unable to delete organization from central repository", ex);
}
}
}

View File

@ -18,7 +18,6 @@
*/
package org.sleuthkit.autopsy.contentviewers;
import org.sleuthkit.autopsy.contentviewers.MediaViewVideoPanel;
import com.google.common.io.Files;
import java.awt.Dimension;
import java.io.File;

View File

@ -18,7 +18,6 @@
*/
package org.sleuthkit.autopsy.contentviewers;
import org.sleuthkit.autopsy.contentviewers.MediaViewVideoPanel;
import com.google.common.io.Files;
import java.awt.Dimension;
import java.awt.Image;
@ -88,7 +87,7 @@ public class GstVideoPanel extends MediaViewVideoPanel {
private boolean autoTracking = false; // true if the slider is moving automatically
private final Object playbinLock = new Object(); // lock for synchronization of gstPlaybin2 player
private AbstractFile currentFile;
private final Set<String> badVideoFiles = Collections.synchronizedSet(new HashSet<String>());
private final Set<String> badVideoFiles = Collections.synchronizedSet(new HashSet<>());
/**
* Creates new form MediaViewVideoPanel

View File

@ -84,6 +84,11 @@ public class MediaFileViewer extends javax.swing.JPanel implements FileTypeViewe
// Variables declaration - do not modify//GEN-BEGIN:variables
// End of variables declaration//GEN-END:variables
/**
* Returns a list of mimetypes supported by this viewer
*
* @return list of supported mimetypes
*/
@Override
public List<String> getSupportedMIMETypes() {
@ -96,6 +101,11 @@ public class MediaFileViewer extends javax.swing.JPanel implements FileTypeViewe
}
/**
* Set up the view to display the given file.
*
* @param file file to display
*/
@Override
public void setFile(AbstractFile file) {
try {

View File

@ -483,10 +483,11 @@ public class PListViewer extends javax.swing.JPanel implements FileTypeViewer, E
}
void setChildren(final PropKeyValue... children) {
this.children = Arrays.stream(children)
.map(child -> new PropKeyValue(child))
.toArray(PropKeyValue[]::new);
if (children != null) {
this.children = Arrays.stream(children)
.map(child -> new PropKeyValue(child))
.toArray(PropKeyValue[]::new);
}
}

View File

@ -48,15 +48,7 @@ public class AdvancedConfigurationCleanDialog extends javax.swing.JDialog {
panel.setAlignmentX(Component.CENTER_ALIGNMENT);
this.add(panel, 0);
this.pack();
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
// set the popUp window / JFrame
int w = this.getSize().width;
int h = this.getSize().height;
// set the location of the popUp Window on the center of the screen
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
this.setVisible(true);
}

View File

@ -64,15 +64,7 @@ public class AdvancedConfigurationDialog extends javax.swing.JDialog {
//applyButton.setAlignmentX(Component.CENTER_ALIGNMENT);
this.add(panel, 0);
this.pack();
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
// set the popUp window / JFrame
int w = this.getSize().width;
int h = this.getSize().height;
// set the location of the popUp Window on the center of the screen
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
this.setVisible(true);
}

View File

@ -88,7 +88,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
private static final long ONE_BILLION = 1000000000L; //used to roughly convert system memory from bytes to gigabytes
private static final long MEGA_IN_GIGA = 1024; //used to convert memory settings saved as megabytes to gigabytes
private static final int MIN_MEMORY_IN_GB = 2; //the enforced minimum memory in gigabytes
private static final Logger LOGGER = Logger.getLogger(AutopsyOptionsPanel.class.getName());
private static final Logger logger = Logger.getLogger(AutopsyOptionsPanel.class.getName());
private String initialMemValue = Long.toString(Runtime.getRuntime().maxMemory() / ONE_BILLION);
/**
@ -266,7 +266,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
try {
lines = Files.readAllLines(filePath, charset);
} catch (IOException e) {
LOGGER.log(Level.SEVERE, "Error reading config file contents. {}", configFile.getAbsolutePath());
logger.log(Level.SEVERE, "Error reading config file contents. {}", configFile.getAbsolutePath());
}
}
return lines;
@ -316,13 +316,13 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
try {
updateAgencyLogo(path);
} catch (IOException ex) {
LOGGER.log(Level.WARNING, "Error loading image from previously saved agency logo path", ex);
logger.log(Level.WARNING, "Error loading image from previously saved agency logo path", ex);
}
if (memField.isEnabled()) {
try {
initialMemValue = Long.toString(getCurrentJvmMaxMemoryInGB());
} catch (IOException ex) {
LOGGER.log(Level.SEVERE, "Can't read current Jvm max memory setting from file", ex);
logger.log(Level.SEVERE, "Can't read current Jvm max memory setting from file", ex);
memField.setEnabled(false);
}
memField.setText(initialMemValue);
@ -380,7 +380,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
try {
writeEtcConfFile();
} catch (IOException ex) {
LOGGER.log(Level.WARNING, "Unable to save config file to " + PlatformUtil.getUserDirectory() + "\\" + ETC_FOLDER_NAME, ex);
logger.log(Level.WARNING, "Unable to save config file to " + PlatformUtil.getUserDirectory() + "\\" + ETC_FOLDER_NAME, ex);
}
}
}
@ -983,7 +983,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
}
}
} catch (IOException ex) {
LOGGER.log(Level.WARNING, "Error loading image from previously saved agency logo path.", ex);
logger.log(Level.WARNING, "Error loading image from previously saved agency logo path.", ex);
}
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
}//GEN-LAST:event_specifyLogoRBActionPerformed
@ -995,7 +995,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
updateAgencyLogo("");
} catch (IOException ex) {
// This should never happen since we're not reading from a file.
LOGGER.log(Level.SEVERE, "Unexpected error occurred while updating the agency logo.", ex);
logger.log(Level.SEVERE, "Unexpected error occurred while updating the agency logo.", ex);
}
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
}//GEN-LAST:event_defaultLogoRBActionPerformed
@ -1009,7 +1009,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
updateAgencyLogo(path);
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
} catch (IOException | IndexOutOfBoundsException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(this.getClass(),
"AutopsyOptionsPanel.invalidImageFile.msg"),
NbBundle.getMessage(this.getClass(), "AutopsyOptionsPanel.invalidImageFile.title"),
@ -1017,7 +1017,7 @@ final class AutopsyOptionsPanel extends javax.swing.JPanel {
try {
updateAgencyLogo(oldLogoPath); //restore previous setting if new one is invalid
} catch (IOException ex1) {
LOGGER.log(Level.WARNING, "Error loading image from previously saved agency logo path", ex1);
logger.log(Level.WARNING, "Error loading image from previously saved agency logo path", ex1);
}
}
}

View File

@ -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");
@ -271,6 +271,25 @@ public class DataResultTopComponent extends TopComponent implements DataResult,
this.dataResultPanel.open();
}
@Override
public void componentActivated() {
super.componentActivated();
/*
* Syncronize the data content viewer to show the currently selected
* item in the data results if only one is selected, or show nothing
* otherwise.
*/
final DataContentTopComponent dataContentTopComponent = DataContentTopComponent.findInstance();
final Node[] nodeList = explorerManager.getSelectedNodes();
if (nodeList.length == 1) {
dataContentTopComponent.setNode(nodeList[0]);
} else {
dataContentTopComponent.setNode(null);
}
}
@Override
public void componentClosed() {
super.componentClosed();

View File

@ -178,11 +178,12 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
}
/**
* The finalizer removes event listeners as the BlackboardArtifactNode
* is being garbage collected. Yes, we know that finalizers are considered
* to be "bad" but since the alternative also relies on garbage collection
* The finalizer removes event listeners as the BlackboardArtifactNode is
* being garbage collected. Yes, we know that finalizers are considered to
* be "bad" but since the alternative also relies on garbage collection
* being run and we know that finalize will be called when the object is
* being GC'd it seems like this is a reasonable solution.
*
* @throws Throwable
*/
@Override
@ -300,7 +301,9 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
"BlackboardArtifactNode.createSheet.artifactType.name=Artifact Type",
"BlackboardArtifactNode.createSheet.artifactDetails.displayName=Artifact Details",
"BlackboardArtifactNode.createSheet.artifactDetails.name=Artifact Details",
"BlackboardArtifactNode.artifact.displayName=Artifact"})
"BlackboardArtifactNode.artifact.displayName=Artifact",
"BlackboardArtifactNode.createSheet.artifactMD5.displayName=MD5 Hash",
"BlackboardArtifactNode.createSheet.artifactMD5.name=MD5 Hash"})
@Override
protected Sheet createSheet() {
@ -415,6 +418,10 @@ public class BlackboardArtifactNode extends AbstractContentNode<BlackboardArtifa
NbBundle.getMessage(BlackboardArtifactNode.class, "ContentTagNode.createSheet.fileSize.displayName"),
"",
associated.getSize()));
ss.put(new NodeProperty<>(Bundle.BlackboardArtifactNode_createSheet_artifactMD5_name(),
Bundle.BlackboardArtifactNode_createSheet_artifactMD5_displayName(),
"",
file != null ? file.getMd5Hash() : ""));
}
} else {
String dataSourceStr = "";

View File

@ -26,6 +26,7 @@ import javax.swing.Action;
import org.openide.nodes.Children;
import org.openide.nodes.Sheet;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.openide.util.lookup.Lookups;
import org.sleuthkit.autopsy.actions.DeleteContentTagAction;
import org.sleuthkit.autopsy.coreutils.Logger;
@ -56,6 +57,10 @@ class ContentTagNode extends DisplayableItemNode {
this.tag = tag;
}
@Messages({
"ContentTagNode.createSheet.artifactMD5.displayName=MD5 Hash",
"ContentTagNode.createSheet.artifactMD5.name=MD5 Hash"
})
@Override
protected Sheet createSheet() {
Content content = tag.getContent();
@ -106,7 +111,10 @@ class ContentTagNode extends DisplayableItemNode {
NbBundle.getMessage(this.getClass(), "ContentTagNode.createSheet.fileSize.displayName"),
"",
content.getSize()));
properties.put(new NodeProperty<>(Bundle.ContentTagNode_createSheet_artifactMD5_name(),
Bundle.ContentTagNode_createSheet_artifactMD5_displayName(),
"",
file != null ? file.getMd5Hash() : ""));
return propertySheet;
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013-2017 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -31,6 +31,7 @@ import org.sleuthkit.autopsy.actions.AddContentTagAction;
import org.sleuthkit.autopsy.actions.DeleteFileBlackboardArtifactTagAction;
import org.sleuthkit.autopsy.actions.DeleteFileContentTagAction;
import org.sleuthkit.autopsy.coreutils.ContextMenuExtensionPoint;
import org.sleuthkit.autopsy.datamodel.Reports.ReportNode;
import org.sleuthkit.autopsy.directorytree.ExternalViewerAction;
import org.sleuthkit.autopsy.directorytree.ExtractAction;
import org.sleuthkit.autopsy.directorytree.HashSearchAction;
@ -45,6 +46,7 @@ import org.sleuthkit.datamodel.File;
import org.sleuthkit.datamodel.LayoutFile;
import org.sleuthkit.datamodel.LocalFile;
import org.sleuthkit.datamodel.LocalDirectory;
import org.sleuthkit.datamodel.Report;
import org.sleuthkit.datamodel.SlackFile;
import org.sleuthkit.datamodel.VirtualDirectory;
@ -327,6 +329,28 @@ public class DataModelActionsFactory {
return actionsList;
}
public static List<Action> getActions(Report report, boolean isArtifactSource) {
List<Action> actionsList = new ArrayList<>();
final ReportNode reportNode = new ReportNode(report);
actionsList.add(null); // creates a menu separator
actionsList.add(new NewWindowViewAction(VIEW_IN_NEW_WINDOW, reportNode));
actionsList.add(null); // creates a menu separator
if (isArtifactSource) {
actionsList.add(AddBlackboardArtifactTagAction.getInstance());
}
if (isArtifactSource) {
final Collection<BlackboardArtifact> selectedArtifactsList
= new HashSet<>(Utilities.actionsGlobalContext().lookupAll(BlackboardArtifact.class));
if (selectedArtifactsList.size() == 1) {
actionsList.add(DeleteFileBlackboardArtifactTagAction.getInstance());
}
}
actionsList.addAll(ContextMenuExtensionPoint.getActions());
return actionsList;
}
public static List<Action> getActions(Content content, boolean isArtifactSource) {
if (content instanceof File) {
return getActions((File) content, isArtifactSource);
@ -342,6 +366,8 @@ public class DataModelActionsFactory {
return getActions((DerivedFile) content, isArtifactSource);
} else if (content instanceof SlackFile) {
return getActions((SlackFile) content, isArtifactSource);
} else if (content instanceof Report) {
return getActions((Report) content, isArtifactSource);
} else {
return new ArrayList<>();
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -18,12 +18,9 @@
*/
package org.sleuthkit.autopsy.datamodel;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@ -34,7 +31,6 @@ import java.util.Set;
import java.util.logging.Level;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JCheckBox;
import javax.swing.JOptionPane;
import org.openide.nodes.ChildFactory;
import org.openide.nodes.Children;

View File

@ -25,6 +25,7 @@ import org.openide.awt.ActionRegistration;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.openide.util.actions.CallableSystemAction;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
@ActionID(category = "Help", id = "org.sleuthkit.autopsy.diagnostics.PerformancePanelAction")
@ -37,6 +38,7 @@ public final class PerformancePanelAction extends CallableSystemAction {
@Override
public void performAction() {
JDialog dialog = new PerformancePanel();
dialog.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
dialog.setVisible(true);
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -20,7 +20,6 @@ package org.sleuthkit.autopsy.directorytree;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@ -31,6 +30,7 @@ import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
/**
* A dialog for adding or editing an external viewer rule
@ -78,10 +78,7 @@ class AddExternalViewerRuleDialog extends JDialog {
/**
* Center the dialog.
*/
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
int width = this.getSize().width;
int height = this.getSize().height;
setLocation((screenDimension.width - width) / 2, (screenDimension.height - height) / 2);
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
add(this.addRulePanel, BorderLayout.PAGE_START);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -134,7 +134,7 @@ class AddExternalViewerRulePanel extends javax.swing.JPanel {
ExternalViewerRule getRule() {
String exePath = exePathTextField.getText();
if (exePath.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(ExternalViewerGlobalSettingsPanel.class, "ExternalViewerGlobalSettingsPanel.JOptionPane.invalidExePath.message"),
NbBundle.getMessage(ExternalViewerGlobalSettingsPanel.class, "ExternalViewerGlobalSettingsPanel.JOptionPane.invalidExePath.title"),
JOptionPane.ERROR_MESSAGE);
@ -151,7 +151,7 @@ class AddExternalViewerRulePanel extends javax.swing.JPanel {
return null;
}
if (name.isEmpty() || !detector.isDetectable(name)) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(ExternalViewerGlobalSettingsPanel.class, "ExternalViewerGlobalSettingsPanel.JOptionPane.invalidMime.message"),
NbBundle.getMessage(ExternalViewerGlobalSettingsPanel.class, "ExternalViewerGlobalSettingsPanel.JOptionPane.invalidMime.title"),
JOptionPane.ERROR_MESSAGE);
@ -160,7 +160,7 @@ class AddExternalViewerRulePanel extends javax.swing.JPanel {
return new ExternalViewerRule(name, exePath, ExternalViewerRule.RuleType.MIME);
} else if (extRadioButton.isSelected()) {
if (name.isEmpty() || !name.matches("^\\.?\\w+$")) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(ExternalViewerGlobalSettingsPanel.class, "ExternalViewerGlobalSettingsPanel.JOptionPane.invalidExt.message"),
NbBundle.getMessage(ExternalViewerGlobalSettingsPanel.class, "ExternalViewerGlobalSettingsPanel.JOptionPane.invalidExt.title"),
JOptionPane.ERROR_MESSAGE);

View File

@ -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");
@ -44,10 +44,10 @@ import org.sleuthkit.autopsy.actions.DeleteFileContentTagAction;
import org.sleuthkit.autopsy.core.UserPreferences;
import org.sleuthkit.autopsy.coreutils.ContextMenuExtensionPoint;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.datamodel.AbstractAbstractFileNode.AbstractFilePropertyType;
import org.sleuthkit.autopsy.datamodel.AbstractFsContentNode;
import org.sleuthkit.autopsy.datamodel.BlackboardArtifactNode;
import org.sleuthkit.autopsy.datamodel.DataModelActionsFactory;
import org.sleuthkit.autopsy.datamodel.DirectoryNode;
import org.sleuthkit.autopsy.datamodel.DisplayableItemNode;
import org.sleuthkit.autopsy.datamodel.DisplayableItemNodeVisitor;
@ -76,6 +76,7 @@ import org.sleuthkit.datamodel.TskData;
import org.sleuthkit.datamodel.TskException;
import org.sleuthkit.datamodel.VirtualDirectory;
import org.sleuthkit.datamodel.BlackboardArtifact.ARTIFACT_TYPE;
import org.sleuthkit.datamodel.Report;
import org.sleuthkit.datamodel.TskCoreException;
/**
@ -360,8 +361,12 @@ public class DataResultFilterNode extends FilterNode {
if (artifactTypeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_HASHSET_HIT.getTypeID()
|| artifactTypeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_KEYWORD_HIT.getTypeID()) {
actionsList.add(new ViewContextAction(
NbBundle.getMessage(this.getClass(), "DataResultFilterNode.action.viewFileInDir.text"), ban));
if (ban.getLookup().lookup(AbstractFile.class) != null) {
// We only want the "View File in Directory" actions if we have a file...it is
// possible that we have a keyword hit on a Report.
actionsList.add(new ViewContextAction(
NbBundle.getMessage(this.getClass(), "DataResultFilterNode.action.viewFileInDir.text"), ban));
}
} else if (artifactTypeID == BlackboardArtifact.ARTIFACT_TYPE.TSK_INTERESTING_ARTIFACT_HIT.getTypeID()) {
//action to go to the source artifact
actionsList.add(new ViewSourceArtifactAction(DataResultFilterNode_viewSourceArtifact_text(), ba));
@ -399,6 +404,8 @@ public class DataResultFilterNode extends FilterNode {
n = new LocalFileNode((AbstractFile) c);
} else if ((c = ban.getLookup().lookup(SlackFile.class)) != null) {
n = new SlackFileNode((SlackFile) c);
} else if ((c = ban.getLookup().lookup(Report.class)) != null) {
actionsList.addAll(DataModelActionsFactory.getActions(c, false));
}
if (n != null) {
actionsList.add(null); // creates a menu separator

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -27,6 +27,7 @@ import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import org.openide.nodes.Node;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.datamodel.ContentUtils;
@ -129,32 +130,32 @@ public class ExternalViewerAction extends AbstractAction {
runtime.exec(s);
} catch (IOException ex) {
logger.log(Level.WARNING, "Could not open the specified viewer for the given file: " + file.getName(), ex); //NON-NLS
JOptionPane.showMessageDialog(null, Bundle.ExternalViewerAction_actionPerformed_failure_IO_message(), Bundle.ExternalViewerAction_actionPerformed_failure_title(), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), Bundle.ExternalViewerAction_actionPerformed_failure_IO_message(), Bundle.ExternalViewerAction_actionPerformed_failure_title(), JOptionPane.ERROR_MESSAGE);
}
} else {
try {
Desktop.getDesktop().open(file);
} catch (IOException ex) {
logger.log(Level.WARNING, "Could not find a viewer for the given file: " + file.getName(), ex); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
Bundle.ExternalViewerAction_actionPerformed_failure_IO_message(),
Bundle.ExternalViewerAction_actionPerformed_failure_title(),
JOptionPane.ERROR_MESSAGE);
} catch (UnsupportedOperationException ex) {
logger.log(Level.WARNING, "Platform cannot open " + file.getName() + " in the defined editor.", ex); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
Bundle.ExternalViewerAction_actionPerformed_failure_support_message(),
Bundle.ExternalViewerAction_actionPerformed_failure_title(),
JOptionPane.ERROR_MESSAGE);
} catch (IllegalArgumentException ex) {
logger.log(Level.WARNING, "Could not find the given file: " + file.getName(), ex); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
Bundle.ExternalViewerAction_actionPerformed_failure_missingFile_message(),
Bundle.ExternalViewerAction_actionPerformed_failure_title(),
JOptionPane.ERROR_MESSAGE);
} catch (SecurityException ex) {
logger.log(Level.WARNING, "Could not get permission to open the given file: " + file.getName(), ex); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
Bundle.ExternalViewerAction_actionPerformed_failure_permission_message(),
Bundle.ExternalViewerAction_actionPerformed_failure_title(),
JOptionPane.ERROR_MESSAGE);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -36,7 +36,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
*/
final class ExternalViewerGlobalSettingsPanel extends javax.swing.JPanel implements OptionsPanel {
private static final Logger LOGGER = Logger.getLogger(ExternalViewerGlobalSettingsPanel.class.getName());
private static final Logger logger = Logger.getLogger(ExternalViewerGlobalSettingsPanel.class.getName());
private DefaultListModel<ExternalViewerRule> rulesListModel;
private java.util.List<ExternalViewerRule> rules;
@ -253,7 +253,7 @@ final class ExternalViewerGlobalSettingsPanel extends javax.swing.JPanel impleme
ExternalViewerRule newRule = dialog.getRule();
// Only allow one association for each MIME type or extension.
if (rules.contains(newRule)) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(ExternalViewerGlobalSettingsPanel.class, "ExternalViewerGlobalSettingsPanel.JOptionPane.ruleAlreadyExists.message"),
NbBundle.getMessage(ExternalViewerGlobalSettingsPanel.class, "ExternalViewerGlobalSettingsPanel.JOptionPane.ruleAlreadyExists.title"),
JOptionPane.ERROR_MESSAGE);
@ -277,7 +277,7 @@ final class ExternalViewerGlobalSettingsPanel extends javax.swing.JPanel impleme
ExternalViewerRule newRule = dialog.getRule();
// Only allow one association for each MIME type or extension.
if (rules.contains(newRule)) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(ExternalViewerGlobalSettingsPanel.class, "ExternalViewerGlobalSettingsPanel.JOptionPane.ruleAlreadyExists.message"),
NbBundle.getMessage(ExternalViewerGlobalSettingsPanel.class, "ExternalViewerGlobalSettingsPanel.JOptionPane.ruleAlreadyExists.title"),
JOptionPane.ERROR_MESSAGE);

View File

@ -75,8 +75,7 @@ final public class FileSystemDetailsAction extends AbstractAction {
fsPanel.setOKButtonActionListener(this);
setContentPane(fsPanel);
pack();
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
setVisible(true);
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011 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");
@ -26,8 +26,6 @@ package org.sleuthkit.autopsy.filesearch;
import org.openide.util.NbBundle;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
@ -47,10 +45,6 @@ class FileSearchDialog extends javax.swing.JDialog {
initComponents();
setResizable(false);
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
double w = getSize().getWidth();
double h = getSize().getHeight();
setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2));
this.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
fileSearchPanel1.addListenerToAll(new ActionListener() {

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2014-2017 Basis Technology Corp.
* Copyright 2014-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -32,6 +32,7 @@ import javax.swing.JOptionPane;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.Cancellable;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.NetworkUtils;
@ -551,7 +552,7 @@ final class DataSourceIngestJob {
// data source ingest module or the entire ingest job.
DataSourceIngestCancellationPanel panel = new DataSourceIngestCancellationPanel();
String dialogTitle = NbBundle.getMessage(DataSourceIngestJob.this.getClass(), "IngestJob.cancellationDialog.title");
JOptionPane.showConfirmDialog(null, panel, dialogTitle, JOptionPane.OK_OPTION, JOptionPane.PLAIN_MESSAGE);
JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(), panel, dialogTitle, JOptionPane.OK_OPTION, JOptionPane.PLAIN_MESSAGE);
if (panel.cancelAllDataSourceIngestModules()) {
DataSourceIngestJob.this.cancel(IngestJob.CancellationReason.USER_CANCELLED);
} else {

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2014 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");
@ -30,6 +30,7 @@ import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.Image;
import org.sleuthkit.datamodel.VirtualDirectory;
import org.sleuthkit.datamodel.LocalDirectory;
import org.sleuthkit.datamodel.Report;
import org.sleuthkit.datamodel.TskException;
import org.sleuthkit.datamodel.Volume;
import org.sleuthkit.datamodel.VolumeSystem;
@ -71,6 +72,11 @@ abstract class GetFilesContentVisitor implements ContentVisitor<Collection<Abstr
return getAllFromChildren(vs);
}
@Override
public Collection<AbstractFile> visit(Report r) {
return getAllFromChildren(r);
}
/**
* Aggregate all the matches from visiting the children Content objects of a
* parent Content object.

View File

@ -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");
@ -19,8 +19,6 @@
package org.sleuthkit.autopsy.ingest;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@ -404,10 +402,7 @@ public final class IngestJobSettingsPanel extends javax.swing.JPanel {
JDialog dialog = new JDialog(topFrame, Bundle.IngestJobSettingsPanel_pastJobsButton_action_frame_title(), false);
IngestJobInfoPanel ingestInfo = new IngestJobInfoPanel();
dialog.add(ingestInfo);
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
double w = dialog.getSize().getWidth();
double h = dialog.getSize().getHeight();
dialog.setLocation((int) ((screenDimension.getWidth() - w) / 2), (int) ((screenDimension.getHeight() - h) / 2));
dialog.setLocationRelativeTo(topFrame);
dialog.setResizable(true);
dialog.pack();
dialog.setVisible(true);

View File

@ -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");
@ -48,6 +48,7 @@ import javax.swing.JOptionPane;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.Cancellable;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.core.RuntimeProperties;
import org.sleuthkit.autopsy.core.ServicesMonitor;
@ -107,7 +108,7 @@ import org.sleuthkit.datamodel.Content;
@ThreadSafe
public class IngestManager {
private final static Logger LOGGER = Logger.getLogger(IngestManager.class.getName());
private final static Logger logger = Logger.getLogger(IngestManager.class.getName());
private final static String INGEST_JOB_EVENT_CHANNEL_NAME = "%s-Ingest-Job-Events"; //NON-NLS
private final static Set<String> INGEST_JOB_EVENT_NAMES = Stream.of(IngestJobEvent.values()).map(IngestJobEvent::toString).collect(Collectors.toSet());
private final static String INGEST_MODULE_EVENT_CHANNEL_NAME = "%s-Ingest-Module-Events"; //NON-NLS
@ -197,12 +198,12 @@ public class IngestManager {
}
String serviceDisplayName = ServicesMonitor.Service.valueOf(evt.getPropertyName()).getDisplayName();
LOGGER.log(Level.SEVERE, "Service {0} is down, cancelling all running ingest jobs", serviceDisplayName); //NON-NLS
logger.log(Level.SEVERE, "Service {0} is down, cancelling all running ingest jobs", serviceDisplayName); //NON-NLS
if (isIngestRunning() && RuntimeProperties.runningWithGUI()) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(), "IngestManager.cancellingIngest.msgDlg.text"),
NbBundle.getMessage(this.getClass(), "IngestManager.serviceIsDown.msgDlg.text", serviceDisplayName),
JOptionPane.ERROR_MESSAGE);
@ -257,7 +258,7 @@ public class IngestManager {
moduleEventPublisher.openRemoteEventChannel(String.format(INGEST_MODULE_EVENT_CHANNEL_NAME, channelPrefix));
}
} catch (IllegalStateException | AutopsyEventException ex) {
LOGGER.log(Level.SEVERE, "Failed to open remote events channel", ex); //NON-NLS
logger.log(Level.SEVERE, "Failed to open remote events channel", ex); //NON-NLS
MessageNotifyUtil.Notify.error(NbBundle.getMessage(IngestManager.class, "IngestManager.OpenEventChannel.Fail.Title"),
NbBundle.getMessage(IngestManager.class, "IngestManager.OpenEventChannel.Fail.ErrMsg"));
}
@ -355,7 +356,7 @@ public class IngestManager {
@Override
public void run() {
String serviceDisplayName = ServicesMonitor.Service.REMOTE_CASE_DATABASE.getDisplayName();
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(), "IngestManager.cancellingIngest.msgDlg.text"),
NbBundle.getMessage(this.getClass(), "IngestManager.serviceIsDown.msgDlg.text", serviceDisplayName),
JOptionPane.ERROR_MESSAGE);
@ -377,13 +378,13 @@ public class IngestManager {
errors = job.start();
if (errors.isEmpty()) {
this.fireIngestJobStarted(job.getId());
IngestManager.LOGGER.log(Level.INFO, "Ingest job {0} started", job.getId()); //NON-NLS
IngestManager.logger.log(Level.INFO, "Ingest job {0} started", job.getId()); //NON-NLS
} else {
this.ingestJobsById.remove(job.getId());
for (IngestModuleError error : errors) {
LOGGER.log(Level.SEVERE, String.format("Error starting %s ingest module for job %d", error.getModuleDisplayName(), job.getId()), error.getThrowable()); //NON-NLS
logger.log(Level.SEVERE, String.format("Error starting %s ingest module for job %d", error.getModuleDisplayName(), job.getId()), error.getThrowable()); //NON-NLS
}
IngestManager.LOGGER.log(Level.SEVERE, "Ingest job {0} could not be started", job.getId()); //NON-NLS
IngestManager.logger.log(Level.SEVERE, "Ingest job {0} could not be started", job.getId()); //NON-NLS
if (RuntimeProperties.runningWithGUI()) {
final StringBuilder message = new StringBuilder(1024);
message.append(Bundle.IngestManager_startupErr_dlgMsg()).append("\n"); //NON-NLS
@ -396,7 +397,7 @@ public class IngestManager {
}
message.append("\n\n");
EventQueue.invokeLater(() -> {
JOptionPane.showMessageDialog(null, message, Bundle.IngestManager_startupErr_dlgTitle(), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), message, Bundle.IngestManager_startupErr_dlgTitle(), JOptionPane.ERROR_MESSAGE);
});
}
return new IngestJobStartResult(null, new IngestManagerException("Errors occurred while starting ingest"), errors); //NON-NLS
@ -415,10 +416,10 @@ public class IngestManager {
long jobId = job.getId();
ingestJobsById.remove(jobId);
if (!job.isCancelled()) {
IngestManager.LOGGER.log(Level.INFO, "Ingest job {0} completed", jobId); //NON-NLS
IngestManager.logger.log(Level.INFO, "Ingest job {0} completed", jobId); //NON-NLS
fireIngestJobCompleted(jobId);
} else {
IngestManager.LOGGER.log(Level.INFO, "Ingest job {0} cancelled", jobId); //NON-NLS
IngestManager.logger.log(Level.INFO, "Ingest job {0} cancelled", jobId); //NON-NLS
fireIngestJobCancelled(jobId);
}
}

View File

@ -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");
@ -22,7 +22,6 @@ import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Window;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
@ -78,11 +77,8 @@ public final class IngestProgressSnapshotDialog extends JDialog {
}
setResizable(true);
setLayout(new BorderLayout());
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
setSize(DIMENSIONS);
int w = this.getSize().width;
int h = this.getSize().height;
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
setLocationRelativeTo(owner);
this.getRootPane().registerKeyboardAction(e -> {
this.dispose();
}, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);

View File

@ -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");
@ -64,7 +64,7 @@ public final class RunIngestModulesAction extends AbstractAction {
for (String warning : warnings) {
warningMessage.append(warning).append("\n");
}
JOptionPane.showMessageDialog(null, warningMessage.toString());
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), warningMessage.toString());
}
}
private final List<Content> dataSources = new ArrayList<>();

View File

@ -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");
@ -21,6 +21,7 @@ package org.sleuthkit.autopsy.keywordsearchservice;
import java.io.Closeable;
import org.sleuthkit.autopsy.casemodule.CaseMetadata;
import org.sleuthkit.datamodel.BlackboardArtifact;
import org.sleuthkit.datamodel.Content;
import org.sleuthkit.datamodel.TskCoreException;
/**
@ -50,6 +51,15 @@ public interface KeywordSearchService extends Closeable {
*/
public void indexArtifact(BlackboardArtifact artifact) throws TskCoreException;
/**
* Add the given Content object to the text index.
*
* @param content The content to index.
*
* @throws TskCoreException
*/
public void index(Content content) throws TskCoreException;
/**
* Deletes the keyword search text index for a case.
*

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -26,6 +26,7 @@ import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.coreutils.Logger;
/**
@ -59,7 +60,7 @@ class AddFileExtensionAction extends AbstractAction {
FileExtMismatchSettings.writeSettings(new FileExtMismatchSettings(editableMap));
} catch (FileExtMismatchSettings.FileExtMismatchSettingsException ex) {
//error
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
Bundle.AddFileExtensionAction_writeError_message(),
NbBundle.getMessage(this.getClass(), "AddFileExtensionAction.msgDlg.title"),
JOptionPane.ERROR_MESSAGE);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -29,6 +29,7 @@ import javax.swing.JOptionPane;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.util.lookup.ServiceProvider;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.corecomponentinterfaces.ContextMenuActionsProvider;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.ingest.IngestManager;
@ -98,7 +99,7 @@ public class FileExtMismatchContextMenuActionsProvider implements ContextMenuAct
actions.get(0).setEnabled(false);
}
} catch (FileExtMismatchSettings.FileExtMismatchSettingsException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(), "AddFileExtensionAction.msgDlg.msg2"),
NbBundle.getMessage(this.getClass(), "AddFileExtensionAction.msgDlg.title"),
JOptionPane.ERROR_MESSAGE);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -319,28 +319,28 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
// Add a user-provided filename extension string to the selecte mimetype
private void newExtButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newExtButtonActionPerformed
String newExt = (String) JOptionPane.showInputDialog(null, NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newExtPrompt.message"),
String newExt = (String) JOptionPane.showInputDialog(this, NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newExtPrompt.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newExtPrompt.title"), JOptionPane.PLAIN_MESSAGE, null, null, "");
if (newExt == null) {
return;
}
if (newExt.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newExtPrompt.empty.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newExtPrompt.empty.title"),
JOptionPane.ERROR_MESSAGE);
return;
}
if (selectedMime.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newExtPrompt.noMimeType.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newExtPrompt.noMimeType.title"),
JOptionPane.ERROR_MESSAGE);
return;
}
if (currentExtensions.contains(newExt)) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newExtPrompt.extExists.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newExtPrompt.extExists.title"),
JOptionPane.ERROR_MESSAGE);
@ -361,7 +361,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
private void removeExtButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeExtButtonActionPerformed
if (selectedExt.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.removeExtButton.noneSelected.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.removeExtButton.noneSelected.title"),
JOptionPane.ERROR_MESSAGE);
@ -369,7 +369,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
}
if (selectedMime.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.removeExtButton.noMimeTypeSelected.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.removeExtButton.noMimeTypeSelected.title"),
JOptionPane.ERROR_MESSAGE);
@ -391,7 +391,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
private void removeTypeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeTypeButtonActionPerformed
if (selectedMime.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.removeTypeButton.noneSelected.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.removeTypeButton.noneSelected.title"),
JOptionPane.ERROR_MESSAGE);
@ -407,28 +407,28 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
}//GEN-LAST:event_removeTypeButtonActionPerformed
private void newTypeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_newTypeButtonActionPerformed
String newMime = (String) JOptionPane.showInputDialog(null, NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.message"),
String newMime = (String) JOptionPane.showInputDialog(this, NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.title"), JOptionPane.PLAIN_MESSAGE, null, null, "");
if (newMime == null) {
return;
}
if (newMime.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.emptyMime.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.emptyMime.title"),
JOptionPane.ERROR_MESSAGE);
return;
}
if (newMime.equals("application/octet-stream")) { //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeNotSupported.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeNotSupported.title"),
JOptionPane.ERROR_MESSAGE);
return;
}
if (mimeList.contains(newMime)) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeExists.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeExists.title"),
JOptionPane.ERROR_MESSAGE);
@ -444,7 +444,7 @@ final class FileExtMismatchSettingsPanel extends IngestModuleGlobalSettingsPanel
}
boolean mimeTypeDetectable = (null != detector) ? detector.isDetectable(newMime) : false;
if (!mimeTypeDetectable) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeNotDetectable.message"),
NbBundle.getMessage(FileExtMismatchSettingsPanel.class, "FileExtMismatchSettingsPanel.newMimePrompt.mimeTypeNotDetectable.title"),
JOptionPane.ERROR_MESSAGE);

View File

@ -34,6 +34,7 @@ import javax.swing.JFrame;
import javax.swing.JPanel;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.WindowManager;
/**
* Dialog used for editing or adding file types.
@ -92,10 +93,7 @@ class AddFileTypeDialog extends JDialog {
/**
* Center the dialog.
*/
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
int width = this.getSize().width;
int height = this.getSize().height;
setLocation((screenDimension.width - width) / 2, (screenDimension.height - height) / 2);
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
/**
* Get the default or saved ingest job settings for this context and use

View File

@ -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");
@ -105,7 +105,7 @@ class AddFileTypePanel extends javax.swing.JPanel {
//if typeName does not equal sanitized typeName display message saying this name will be used instead
if (typeName.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidMIMEType.message"),
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidMIMEType.title"),
JOptionPane.ERROR_MESSAGE);
@ -114,7 +114,7 @@ class AddFileTypePanel extends javax.swing.JPanel {
//if we need to remove more characters could use matches instead of contains and regex "[^\\w\s\\-\\/] to remove everything that isnt a letter, number, underscore, whitespace, dash, or forward slash.
if (typeName.contains("\'")) { //remove single apostraphes as they are an easy way to accidently screw up PostgreSQL
typeName = typeName.replaceAll("[\\']", "");
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "AddFileTypePanel.containsIllegalCharacter.message", typeName),
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "AddFileTypePanel.containsIllegalCharacter.title"),
JOptionPane.WARNING_MESSAGE);
@ -125,7 +125,7 @@ class AddFileTypePanel extends javax.swing.JPanel {
//if the MIME type has more than 2 parts the first part will be used as a media type and the remainder of the string as the sub-type
String[] splitName = typeName.split("/");
if (splitName.length < 2 || splitName[0].isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "AddFileTypePanel.nonStandardMIMEType.message", typeName),
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "AddFileTypePanel.nonStandardMIMEType.title"),
JOptionPane.WARNING_MESSAGE);
@ -137,7 +137,7 @@ class AddFileTypePanel extends javax.swing.JPanel {
//suggests a mime_type that will be the same after it is split appart and rejoined
if (!StringUtils.join(ArrayUtils.subarray(splitName, 0, splitName.length), "/").equals(typeName)) {
String rejoinedMimeType = StringUtils.join(ArrayUtils.subarray(splitName, 0, splitName.length), "/");
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "AddFileTypePanel.nonStandardMIMEType.message", rejoinedMimeType),
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "AddFileTypePanel.nonStandardMIMEType.title"),
JOptionPane.WARNING_MESSAGE);
@ -145,7 +145,7 @@ class AddFileTypePanel extends javax.swing.JPanel {
return null;
}
if (this.signaturesListModel.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
Bundle.AddMimeTypePanel_emptySigList_message(),
Bundle.AddMimeTypePanel_emptySigList_title(),
JOptionPane.ERROR_MESSAGE);
@ -159,7 +159,7 @@ class AddFileTypePanel extends javax.swing.JPanel {
String setName = "";
if (this.postHitCheckBox.isSelected()) {
if (this.setNameTextField.getText().isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
Bundle.AddMimeTypePanel_emptySetName_message(),
Bundle.AddMimeTypePanel_emptySetName_title(),
JOptionPane.ERROR_MESSAGE);

View File

@ -32,6 +32,7 @@ import javax.swing.JFrame;
import javax.swing.JPanel;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.ingest.runIngestModuleWizard.RunIngestModulesAction;
import org.sleuthkit.autopsy.modules.filetypeid.FileType.Signature;
@ -109,10 +110,7 @@ final class AddFileTypeSignatureDialog extends JDialog {
/**
* Center the dialog.
*/
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
int width = this.getSize().width;
int height = this.getSize().height;
setLocation((screenDimension.width - width) / 2, (screenDimension.height - height) / 2);
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
/**
* Get the default or saved ingest job settings for this context and use

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -106,7 +106,7 @@ class AddFileTypeSignaturePanel extends javax.swing.JPanel {
try {
this.signatureTextField.setText(new String(toEdit.getSignatureBytes(), "UTF-8"));
} catch (UnsupportedEncodingException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
ex.getLocalizedMessage(),
Bundle.AddFileTypeSignaturePanel_signatureStringFail_text(),
JOptionPane.ERROR_MESSAGE);
@ -134,7 +134,7 @@ class AddFileTypeSignaturePanel extends javax.swing.JPanel {
String sigString = signatureTextField.getText();
if (sigString.isEmpty()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidSignature.message"),
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidSignature.title"),
JOptionPane.ERROR_MESSAGE);
@ -147,7 +147,7 @@ class AddFileTypeSignaturePanel extends javax.swing.JPanel {
sigString = sigString.replaceAll("\\s", ""); //NON-NLS
signatureBytes = DatatypeConverter.parseHexBinary(sigString);
} catch (IllegalArgumentException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidRawSignatureBytes.message"),
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidSignatureBytes.title"),
JOptionPane.ERROR_MESSAGE);
@ -166,14 +166,14 @@ class AddFileTypeSignaturePanel extends javax.swing.JPanel {
try {
offset = Long.parseUnsignedLong(offsetTextField.getText());
if (!isRelativeToStart && signatureBytes.length > offset + 1) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidOffset.length"),
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidOffset.title"),
JOptionPane.ERROR_MESSAGE);
return null;
}
} catch (NumberFormatException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidOffset.message"),
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.invalidOffset.title"),
JOptionPane.ERROR_MESSAGE);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2014-2015 Basis Technology Corp.
* Copyright 2014-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -29,6 +29,7 @@ import java.util.Objects;
import java.util.logging.Level;
import javax.swing.JOptionPane;
import javax.xml.bind.DatatypeConverter;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile;
import org.sleuthkit.datamodel.TskCoreException;
@ -384,7 +385,7 @@ class FileType implements Serializable {
try {
signatureBytesString = new String(this.getSignatureBytes(), "UTF-8");
} catch (UnsupportedEncodingException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
ex.getLocalizedMessage(),
Bundle.AddFileTypeSignaturePanel_signatureStringFail_text(),
JOptionPane.ERROR_MESSAGE);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -207,7 +207,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
}
} catch (CustomFileTypesException ex) {
logger.log(Level.SEVERE, "Failed to get custom file types", ex);
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.loadFileTypes.errorMessage"),
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.loadFailed.title"),
JOptionPane.ERROR_MESSAGE);
@ -263,7 +263,7 @@ final class FileTypeIdGlobalSettingsPanel extends IngestModuleGlobalSettingsPane
CustomFileTypesManager.getInstance().setUserDefinedFileTypes(fileTypes);
} catch (CustomFileTypesManager.CustomFileTypesException ex) {
logger.log(Level.SEVERE, "Failed to set custom file types", ex);
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.saveFileTypes.errorMessage"),
NbBundle.getMessage(FileTypeIdGlobalSettingsPanel.class, "FileTypeIdGlobalSettingsPanel.JOptionPane.storeFailed.title"),
JOptionPane.ERROR_MESSAGE);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -30,6 +30,7 @@ import javax.swing.JOptionPane;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.util.actions.Presenter;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.ingest.IngestManager;
import static org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
@ -150,7 +151,7 @@ final class AddContentToHashDbAction extends AbstractAction implements Presenter
// don't let them add the hash for an empty file to the DB
if (HashUtility.isNoDataMd5(md5Hash)) { //NON-NLS
Logger.getLogger(AddContentToHashDbAction.class.getName()).log(Level.INFO, "Not adding " + file.getName() + " to hash set (empty content)"); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"AddContentToHashDbAction.addFilesToHashSet.unableToAddFileEmptyMsg",
file.getName()),
@ -163,7 +164,7 @@ final class AddContentToHashDbAction extends AbstractAction implements Presenter
hashSet.addHashes(file);
} catch (TskCoreException ex) {
Logger.getLogger(AddContentToHashDbAction.class.getName()).log(Level.SEVERE, "Error adding to hash set", ex); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"AddContentToHashDbAction.addFilesToHashSet.unableToAddFileMsg",
file.getName()),
@ -172,7 +173,7 @@ final class AddContentToHashDbAction extends AbstractAction implements Presenter
JOptionPane.ERROR_MESSAGE);
}
} else {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"AddContentToHashDbAction.addFilesToHashSet.unableToAddFileSzMsg",
files.size() > 1 ? NbBundle

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -18,8 +18,6 @@
*/
package org.sleuthkit.autopsy.modules.hashdatabase;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
@ -59,8 +57,7 @@ public class AddHashValuesToDatabaseDialog extends javax.swing.JDialog {
}
private void display() {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
setVisible(true);
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -19,8 +19,8 @@
package org.sleuthkit.autopsy.modules.hashdatabase;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
@ -61,7 +61,7 @@ public class AddHashValuesToDatabaseProgressDialog extends javax.swing.JDialog {
AddHashValuesToDatabaseProgressDialog(AddHashValuesToDatabaseDialog parent, HashDb hashDb, String text) {
super(parent);
initComponents();
display();
display(parent);
this.hashes = new ArrayList<>();
this.invalidHashes = new ArrayList<>();
this.md5Pattern = Pattern.compile("^[a-fA-F0-9]{32}$"); // NON-NLS
@ -70,9 +70,8 @@ public class AddHashValuesToDatabaseProgressDialog extends javax.swing.JDialog {
this.text = text;
}
private void display() {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
private void display(Component parent) {
setLocationRelativeTo(parent);
setVisible(true);
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -18,8 +18,6 @@
*/
package org.sleuthkit.autopsy.modules.hashdatabase;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
@ -121,8 +119,7 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
}
private void display() {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
setLocationRelativeTo(getOwner());
setVisible(true);
}
@ -165,7 +162,7 @@ final class HashDbCreateDatabaseDialog extends javax.swing.JDialog {
selectedOrg = orgs.get(0);
}
} catch (EamDbException ex) {
JOptionPane.showMessageDialog(null, Bundle.HashDbCreateDatabaseDialog_populateOrgsError_message());
JOptionPane.showMessageDialog(this, Bundle.HashDbCreateDatabaseDialog_populateOrgsError_message());
Logger.getLogger(ImportCentralRepoDbProgressDialog.class.getName()).log(Level.SEVERE, "Failure loading organizations", ex);
}
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011 - 2013 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");
@ -18,8 +18,6 @@
*/
package org.sleuthkit.autopsy.modules.hashdatabase;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
@ -93,8 +91,7 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
}
private void display() {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
setVisible(true);
}
@ -145,7 +142,7 @@ final class HashDbImportDatabaseDialog extends javax.swing.JDialog {
selectedOrg = orgs.get(0);
}
} catch (EamDbException ex) {
JOptionPane.showMessageDialog(null, Bundle.HashDbImportDatabaseDialog_populateOrgsError_message());
JOptionPane.showMessageDialog(this, Bundle.HashDbImportDatabaseDialog_populateOrgsError_message());
Logger.getLogger(ImportCentralRepoDbProgressDialog.class.getName()).log(Level.SEVERE, "Failure loading organizations", ex);
}
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011 - 2016 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");
@ -38,6 +38,7 @@ import org.apache.commons.io.FilenameUtils;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.NbBundle;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.centralrepository.datamodel.CorrelationAttribute;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDb;
import org.sleuthkit.autopsy.centralrepository.datamodel.EamDbException;
@ -579,7 +580,7 @@ public class HashDbManager implements PropertyChangeListener {
}
} catch (TskCoreException ex) {
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error opening hash set", ex); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"HashDbManager.unableToOpenHashDbMsg", hashDbInfo.getHashSetName()),
NbBundle.getMessage(this.getClass(), "HashDbManager.openHashDbErr"),
@ -594,7 +595,7 @@ public class HashDbManager implements PropertyChangeListener {
} catch (TskCoreException ex){
Logger.getLogger(HashDbManager.class.getName()).log(Level.SEVERE, "Error opening hash set", ex); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
Bundle.HashDbManager_centralRepoLoadError_message(),
NbBundle.getMessage(this.getClass(), "HashDbManager.openHashDbErr"),
JOptionPane.ERROR_MESSAGE);
@ -653,7 +654,7 @@ public class HashDbManager implements PropertyChangeListener {
// Give the user an opportunity to find the desired file.
String newPath = null;
if (RuntimeProperties.runningWithGUI() &&
JOptionPane.showConfirmDialog(null,
JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(), "HashDbManager.dlgMsg.dbNotFoundAtLoc",
hashSetName, configuredPath),
NbBundle.getMessage(this.getClass(), "HashDbManager.dlgTitle.MissingDb"),
@ -1420,7 +1421,7 @@ public class HashDbManager implements PropertyChangeListener {
SleuthkitJNI.createLookupIndexForHashDatabase(hashDb.getHandle());
} catch (TskCoreException ex) {
Logger.getLogger(HashDbIndexer.class.getName()).log(Level.SEVERE, "Error indexing hash set " + hashDb.getHashSetName(), ex); //NON-NLS
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"HashDbManager.dlgMsg.errorIndexingHashSet",
hashDb.getHashSetName()),

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011 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");
@ -23,6 +23,7 @@ import org.openide.nodes.Node;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle;
import org.openide.util.actions.CallableSystemAction;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.datamodel.ContentUtils;
import org.sleuthkit.autopsy.directorytree.HashSearchProvider;
import org.sleuthkit.datamodel.AbstractFile;
@ -122,7 +123,7 @@ public class HashDbSearchAction extends CallableSystemAction implements HashSear
if (file != null && HashDbSearcher.countFilesMd5Hashed() > 0) {
doSearch();
} else {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"HashDbSearchAction.dlgMsg.noFilesHaveMD5Calculated"),
NbBundle.getMessage(this.getClass(), "HashDbSearchAction.dlgMsg.title"),

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011 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");
@ -28,6 +28,7 @@ import org.openide.nodes.Children;
import org.openide.nodes.Node;
import org.openide.util.NbBundle;
import org.openide.windows.TopComponent;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.corecomponents.DataResultTopComponent;
import org.sleuthkit.datamodel.AbstractFile;
@ -90,7 +91,7 @@ class HashDbSearchManager {
searchResultWin.requestActive();
} else {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(), "HashDbSearchManager.noResultsFoundMsg"));
}
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011 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");
@ -297,7 +297,7 @@ class HashDbSearchPanel extends javax.swing.JPanel implements ActionListener {
if (HashDbSearcher.countFilesMd5Hashed() > 0) {
return doSearch();
} else {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(this.getClass(),
"HashDbSearchPanel.noFilesHaveMD5HashMsg"),
NbBundle.getMessage(this.getClass(), "HashDbSearchPanel.dlgMsg.title"),

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011 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");
@ -28,6 +28,7 @@ import javax.swing.SwingWorker;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.Cancellable;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.datamodel.AbstractFile;
@ -101,7 +102,7 @@ class HashDbSearchThread extends SwingWorker<Object, Void> {
}
}
if (quit) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(this.getClass(),
"HashDbSearchThread.noMoreFilesWithMD5Msg"));
return;

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011 - 2016 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");
@ -32,6 +32,7 @@ import org.apache.commons.io.FileUtils;
import org.openide.util.NbBundle;
import org.openide.util.io.NbObjectInputStream;
import org.openide.util.io.NbObjectOutputStream;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.core.RuntimeProperties;
import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.PlatformUtil;
@ -185,7 +186,7 @@ final class HashLookupSettings implements Serializable {
} while (hashSetNames.contains(newHashSetName));
logger.log(Level.INFO, "Duplicate hash set name " + hashSetName + " found. Replacing with " + newHashSetName + ".");
if (RuntimeProperties.runningWithGUI()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(HashLookupSettings.class,
"HashDbManager.replacingDuplicateHashsetNameMsg",
hashSetName, newHashSetName),
@ -251,7 +252,7 @@ final class HashLookupSettings implements Serializable {
FileUtils.copyFile(new File(configFilePath), new File(backupFilePath));
logger.log(Level.INFO, "Updated the schema, backup saved at: " + backupFilePath);
if (RuntimeProperties.runningWithGUI()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(HashLookupSettings.class,
"HashDbManager.savedBackupOfOldConfigMsg",
baseMessage, backupFilePath),
@ -260,7 +261,7 @@ final class HashLookupSettings implements Serializable {
}
} catch (IOException ex) {
logger.log(Level.WARNING, "Failed to save backup of old format configuration file to " + backupFilePath, ex); //NON-NLS
JOptionPane.showMessageDialog(null, baseMessage, messageBoxTitle, JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), baseMessage, messageBoxTitle, JOptionPane.INFORMATION_MESSAGE);
}
HashLookupSettings settings;
settings = new HashLookupSettings(hashDbInfoList);

View File

@ -340,7 +340,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
hashSetManager.save();
} catch (HashDbManager.HashDbManagerException ex) {
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_saveFail_message(), Bundle.HashLookupSettingsPanel_saveFail_title(), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(this, Bundle.HashLookupSettingsPanel_saveFail_message(), Bundle.HashLookupSettingsPanel_saveFail_title(), JOptionPane.ERROR_MESSAGE);
});
}
}
@ -388,7 +388,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
try {
hashSetManager.removeHashDatabaseNoSave(hashDb);
} catch (HashDbManager.HashDbManagerException ex) {
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
JOptionPane.showMessageDialog(this, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
}
}
hashSetTableModel.refreshModel();
@ -432,7 +432,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
try {
hashSetManager.save();
} catch (HashDbManager.HashDbManagerException ex) {
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_saveFail_message(), Bundle.HashLookupSettingsPanel_saveFail_title(), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(this, Bundle.HashLookupSettingsPanel_saveFail_message(), Bundle.HashLookupSettingsPanel_saveFail_title(), JOptionPane.ERROR_MESSAGE);
}
}
@ -1003,7 +1003,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
"HashLookupSettingsPanel.promptMessage.deleteHashDb=This will make the hash database unavailable for lookup. Do you want to proceed?\n\nNote: The hash database can still be re-imported later."
})
private void deleteDatabaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteDatabaseButtonActionPerformed
if (JOptionPane.showConfirmDialog(null,
if (JOptionPane.showConfirmDialog(this,
Bundle.HashLookupSettingsPanel_promptMessage_deleteHashDb(),
Bundle.HashLookupSettingsPanel_promptTitle_deleteHashDb(),
JOptionPane.YES_NO_OPTION,
@ -1013,7 +1013,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
try {
hashSetManager.removeHashDatabaseNoSave(hashDb);
} catch (HashDbManager.HashDbManagerException ex) {
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
JOptionPane.showMessageDialog(this, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
}
hashSetTableModel.refreshModel();
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);
@ -1028,7 +1028,7 @@ public final class HashLookupSettingsPanel extends IngestModuleGlobalSettingsPan
try {
hashSetManager.removeHashDatabaseNoSave(hashDb);
} catch (HashDbManager.HashDbManagerException ex) {
JOptionPane.showMessageDialog(null, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
JOptionPane.showMessageDialog(this, Bundle.HashLookupSettingsPanel_removeDatabaseFailure_message(hashDb.getHashSetName()));
}
hashSetTableModel.refreshModel();
firePropertyChange(OptionsPanelController.PROP_CHANGED, null, null);

View File

@ -417,7 +417,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
// feedback when isValidDefinition() is called.
int option = JOptionPane.OK_OPTION;
do {
option = JOptionPane.showConfirmDialog(null, panel, NbBundle.getMessage(FilesSetPanel.class, filterDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
option = JOptionPane.showConfirmDialog(this, panel, NbBundle.getMessage(FilesSetPanel.class, filterDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
} while (option == JOptionPane.OK_OPTION && !panel.isValidDefinition());
// While adding new ruleset(selectedSet == null), if rule set with same name already exists, do not add to the filesSets hashMap.
@ -467,7 +467,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
// feedback when isValidDefinition() is called.
int option = JOptionPane.OK_OPTION;
do {
option = JOptionPane.showOptionDialog(null, panel, NbBundle.getMessage(FilesSetPanel.class, ruleDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, new Object[]{okButton, cancelButton}, okButton);
option = JOptionPane.showOptionDialog(this, panel, NbBundle.getMessage(FilesSetPanel.class, ruleDialogTitle), JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, new Object[]{okButton, cancelButton}, okButton);
} while (option == JOptionPane.OK_OPTION && !panel.isValidRuleDefinition());
@ -1249,7 +1249,7 @@ public final class FilesSetDefsPanel extends IngestModuleGlobalSettingsPanel imp
//if the file already exists ask the user how to proceed
final String FILE_EXISTS_MESSAGE = NbBundle.getMessage(this.getClass(),
"FilesSetDefsPanel.exportButtonActionPerformed.fileExistPrompt", selFile.getName());
boolean shouldWrite = JOptionPane.showConfirmDialog(null, FILE_EXISTS_MESSAGE, FEATURE_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
boolean shouldWrite = JOptionPane.showConfirmDialog(this, FILE_EXISTS_MESSAGE, FEATURE_NAME, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE) == JOptionPane.YES_OPTION;
if (!shouldWrite) {
return;
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -156,7 +156,7 @@ public class STIXReportModuleConfigPanel extends javax.swing.JPanel {
fileChooser.setCurrentDirectory(currentSelection);
}
int result = fileChooser.showOpenDialog(null);
int result = fileChooser.showOpenDialog(this);
if (result == JFileChooser.APPROVE_OPTION) {
stixFile = fileChooser.getSelectedFile().getAbsolutePath();

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2012 Basis Technology Corp.
* Copyright 2012-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -19,14 +19,11 @@
package org.sleuthkit.autopsy.report;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -52,6 +49,9 @@ public class ArtifactSelectionDialog extends javax.swing.JDialog {
/**
* Creates new form ArtifactSelectionDialog
*
* @param parent The parent window
* @param modal Block user-input to other top-level windows.
*/
public ArtifactSelectionDialog(java.awt.Frame parent, boolean modal) {
super(parent, modal);
@ -88,7 +88,7 @@ public class ArtifactSelectionDialog extends javax.swing.JDialog {
artifactTypeSelections.put(type, Boolean.TRUE);
}
} catch (TskCoreException ex) {
Logger.getLogger(ArtifactSelectionDialog.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: " + ex.getLocalizedMessage()); //NON-NLS
Logger.getLogger(ArtifactSelectionDialog.class.getName()).log(Level.SEVERE, "Error getting list of artifacts in use: {0}", ex.getLocalizedMessage()); //NON-NLS
}
}
@ -117,14 +117,7 @@ public class ArtifactSelectionDialog extends javax.swing.JDialog {
*/
Map<BlackboardArtifact.Type, Boolean> display() {
this.setTitle(NbBundle.getMessage(this.getClass(), "ArtifactSelectionDialog.dlgTitle.text"));
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
// set the popUp window / JFrame
int w = this.getSize().width;
int h = this.getSize().height;
// set the location of the popUp Window on the center of the screen
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
this.setLocationRelativeTo(getOwner());
this.setVisible(true);
return artifactTypeSelections;
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -112,7 +112,7 @@ class ReportGenerationPanel extends javax.swing.JPanel {
if (closeable) {
actionListener.actionPerformed(null);
} else {
int result = JOptionPane.showConfirmDialog(null,
int result = JOptionPane.showConfirmDialog(this,
NbBundle.getMessage(this.getClass(),
"ReportGenerationPanel.confDlg.sureToClose.msg"),
NbBundle.getMessage(this.getClass(),
@ -215,7 +215,7 @@ class ReportGenerationPanel extends javax.swing.JPanel {
private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
if (progressPanel.getStatus() == ReportStatus.QUEUING || progressPanel.getStatus() == ReportStatus.RUNNING) {
int result = JOptionPane.showConfirmDialog(null, NbBundle.getMessage(this.getClass(),
int result = JOptionPane.showConfirmDialog(this, NbBundle.getMessage(this.getClass(),
"ReportGenerationPanel.confDlg.cancelReport.msg"),
NbBundle.getMessage(this.getClass(),
"ReportGenerationPanel.cancelButton.text"),

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2013 - 2018 Basis Technology Corp.
* Copyright 2013-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -18,8 +18,6 @@
*/
package org.sleuthkit.autopsy.report;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
@ -118,12 +116,7 @@ class ReportGenerator {
}
});
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
int w = dialog.getSize().width;
int h = dialog.getSize().height;
// set the location of the popUp Window on the center of the screen
dialog.setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
dialog.setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
dialog.setVisible(true);
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -25,6 +25,7 @@ import org.sleuthkit.autopsy.coreutils.Logger;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import org.openide.util.lookup.ServiceProvider;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
import org.sleuthkit.autopsy.modules.hashdatabase.HashDbManager.HashDb;
@ -96,14 +97,14 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule {
failedExports.add(tag.getContent().getName());
}
} else {
JOptionPane.showMessageDialog(null, "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);
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);
break;
}
}
}
} catch (TskCoreException ex) {
Logger.getLogger(AddTaggedHashesToHashDb.class.getName()).log(Level.SEVERE, "Error adding to hash set", ex);
JOptionPane.showMessageDialog(null, "Error getting selected tags for case.", "Hash Export Error", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "Error getting selected tags for case.", "Hash Export Error", JOptionPane.ERROR_MESSAGE);
}
}
if (!failedExports.isEmpty()) {
@ -117,7 +118,7 @@ public class AddTaggedHashesToHashDb implements GeneralReportModule {
errorMessage.append(".");
}
}
JOptionPane.showMessageDialog(null, errorMessage.toString(), "Hash Export Error", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), errorMessage.toString(), "Hash Export Error", JOptionPane.ERROR_MESSAGE);
}
}
progressPanel.setIndeterminate(false);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -70,7 +70,7 @@ class AddTaggedHashesToHashDbConfigPanel extends javax.swing.JPanel {
tagNames = Case.getCurrentCase().getServices().getTagsManager().getTagNamesInUse();
} catch (TskCoreException ex) {
Logger.getLogger(AddTaggedHashesToHashDbConfigPanel.class.getName()).log(Level.SEVERE, "Failed to get tag names", ex);
JOptionPane.showMessageDialog(null, "Error getting tag names for case.", "Tag Names Not Found", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(this, "Error getting tag names for case.", "Tag Names Not Found", JOptionPane.ERROR_MESSAGE);
}
// Mark the tag names as unselected. Note that tagNameSelections is a
@ -299,7 +299,7 @@ class AddTaggedHashesToHashDbConfigPanel extends javax.swing.JPanel {
private void configureHashDatabasesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_configureHashDatabasesButtonActionPerformed
HashLookupSettingsPanel configPanel = new HashLookupSettingsPanel();
configPanel.load();
if (JOptionPane.showConfirmDialog(null, configPanel, "Hash Set Configuration", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) {
if (JOptionPane.showConfirmDialog(this, configPanel, "Hash Set Configuration", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) {
configPanel.store();
populateHashSetComponents();
} else {

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2014-16 Basis Technology Corp.
* Copyright 2014-2018 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
@ -45,6 +45,7 @@ import org.controlsfx.validation.ValidationResult;
import org.controlsfx.validation.ValidationSupport;
import org.controlsfx.validation.Validator;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.coreutils.FileUtil;
import org.sleuthkit.autopsy.coreutils.Logger;
@ -192,22 +193,22 @@ public class SaveSnapshotAsReport extends Action {
try {
Desktop.getDesktop().open(reportHTMLFIle.toFile());
} catch (IOException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
Bundle.OpenReportAction_NoAssociatedEditorMessage(),
Bundle.OpenReportAction_MessageBoxTitle(),
JOptionPane.ERROR_MESSAGE);
} catch (UnsupportedOperationException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
Bundle.OpenReportAction_NoOpenInEditorSupportMessage(),
Bundle.OpenReportAction_MessageBoxTitle(),
JOptionPane.ERROR_MESSAGE);
} catch (IllegalArgumentException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
Bundle.OpenReportAction_MissingReportFileMessage(),
Bundle.OpenReportAction_MessageBoxTitle(),
JOptionPane.ERROR_MESSAGE);
} catch (SecurityException ex) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
Bundle.OpenReportAction_ReportFileOpenPermissionDeniedMessage(),
Bundle.OpenReportAction_MessageBoxTitle(),
JOptionPane.ERROR_MESSAGE);

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -51,6 +51,7 @@ import org.apache.commons.lang3.StringUtils;
import org.joda.time.Interval;
import org.netbeans.api.progress.ProgressHandle;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.services.TagsManager;
import org.sleuthkit.autopsy.coreutils.Logger;
@ -95,7 +96,7 @@ import org.sleuthkit.datamodel.TskData;
*/
public class EventsRepository {
private final static Logger LOGGER = Logger.getLogger(EventsRepository.class.getName());
private final static Logger logger = Logger.getLogger(EventsRepository.class.getName());
private final Executor workerExecutor = Executors.newSingleThreadExecutor(new ThreadFactoryBuilder().setNameFormat("eventrepository-worker-%d").build()); //NON-NLS
private DBPopulationWorker dbWorker;
@ -194,7 +195,7 @@ public class EventsRepository {
try {
return eventStripeCache.get(params);
} catch (ExecutionException ex) {
LOGGER.log(Level.SEVERE, "Failed to load Event Stripes from cache for " + params.toString(), ex); //NON-NLS
logger.log(Level.SEVERE, "Failed to load Event Stripes from cache for " + params.toString(), ex); //NON-NLS
return Collections.emptyList();
}
}
@ -302,7 +303,7 @@ public class EventsRepository {
try {
datasourcesMap.putIfAbsent(id, skCase.getContentById(id).getDataSource().getName());
} catch (TskCoreException ex) {
LOGGER.log(Level.SEVERE, "Failed to get datasource by ID.", ex); //NON-NLS
logger.log(Level.SEVERE, "Failed to get datasource by ID.", ex); //NON-NLS
}
}
@ -310,7 +311,7 @@ public class EventsRepository {
//should this only be tags applied to files or event bearing artifacts?
tagNames.setAll(skCase.getTagNamesInUse());
} catch (TskCoreException ex) {
LOGGER.log(Level.SEVERE, "Failed to get tag names in use.", ex); //NON-NLS
logger.log(Level.SEVERE, "Failed to get tag names in use.", ex); //NON-NLS
}
}
@ -337,7 +338,7 @@ public class EventsRepository {
try {
tagNames.setAll(autoCase.getSleuthkitCase().getTagNamesInUse());
} catch (TskCoreException ex) {
LOGGER.log(Level.SEVERE, "Failed to get tag names in use.", ex); //NON-NLS
logger.log(Level.SEVERE, "Failed to get tag names in use.", ex); //NON-NLS
}
}
@ -407,7 +408,7 @@ public class EventsRepository {
*/
@ThreadConfined(type = ThreadConfined.ThreadType.JFX)
private CancellationProgressTask<Void> rebuildRepository(final DBPopulationMode mode, Consumer<Worker.State> onStateChange) {
LOGGER.log(Level.INFO, "(re)starting {0} db population task", mode); //NON-NLS
logger.log(Level.INFO, "(re)starting {0} db population task", mode); //NON-NLS
if (dbWorker != null) {
dbWorker.cancel();
}
@ -512,7 +513,7 @@ public class EventsRepository {
if (dbPopulationMode == DBPopulationMode.FULL) {
//drop old db, and add back MAC and artifact events
LOGGER.log(Level.INFO, "Beginning population of timeline db."); // NON-NLS
logger.log(Level.INFO, "Beginning population of timeline db."); // NON-NLS
restartProgressHandle(Bundle.progressWindow_msg_gatheringData(), "", -1D, 1, true);
//reset database //TODO: can we do more incremental updates? -jm
eventDB.reInitializeDB();
@ -529,23 +530,23 @@ public class EventsRepository {
//tags
if (dbPopulationMode == DBPopulationMode.TAGS_ONLY) {
trans = eventDB.beginTransaction();
LOGGER.log(Level.INFO, "dropping old tags"); // NON-NLS
logger.log(Level.INFO, "dropping old tags"); // NON-NLS
eventDB.reInitializeTags();
}
LOGGER.log(Level.INFO, "updating content tags"); // NON-NLS
logger.log(Level.INFO, "updating content tags"); // NON-NLS
List<ContentTag> contentTags = tagsManager.getAllContentTags();
int currentWorkTotal = contentTags.size();
restartProgressHandle(Bundle.progressWindow_msg_refreshingFileTags(), "", 0D, currentWorkTotal, true);
insertContentTags(currentWorkTotal, contentTags, trans);
LOGGER.log(Level.INFO, "updating artifact tags"); // NON-NLS
logger.log(Level.INFO, "updating artifact tags"); // NON-NLS
List<BlackboardArtifactTag> artifactTags = tagsManager.getAllBlackboardArtifactTags();
currentWorkTotal = artifactTags.size();
restartProgressHandle(Bundle.progressWindow_msg_refreshingResultTags(), "", 0D, currentWorkTotal, true);
insertArtifactTags(currentWorkTotal, artifactTags, trans);
LOGGER.log(Level.INFO, "committing db"); // NON-NLS
logger.log(Level.INFO, "committing db"); // NON-NLS
Platform.runLater(() -> cancellable.set(false));
restartProgressHandle(Bundle.progressWindow_msg_commitingDb(), "", -1D, 1, false);
eventDB.commitTransaction(trans);
@ -609,14 +610,14 @@ public class EventsRepository {
AbstractFile f = skCase.getAbstractFileById(fID);
if (isNull(f)) {
LOGGER.log(Level.WARNING, "Failed to get data for file : {0}", fID); // NON-NLS
logger.log(Level.WARNING, "Failed to get data for file : {0}", fID); // NON-NLS
} else {
insertEventsForFile(f, trans);
updateProgress(i, numFiles);
updateMessage(f.getName());
}
} catch (TskCoreException tskCoreException) {
LOGGER.log(Level.SEVERE, "Failed to insert MAC time events for file : " + fID, tskCoreException); // NON-NLS
logger.log(Level.SEVERE, "Failed to insert MAC time events for file : " + fID, tskCoreException); // NON-NLS
}
}
}
@ -669,11 +670,11 @@ public class EventsRepository {
try {
get();
} catch (CancellationException ex) {
LOGGER.log(Level.WARNING, "Timeline database population was cancelled by the user. " //NON-NLS
logger.log(Level.WARNING, "Timeline database population was cancelled by the user. " //NON-NLS
+ " Not all events may be present or accurate."); // NON-NLS
} catch (Exception ex) {
LOGGER.log(Level.WARNING, "Unexpected exception while populating database.", ex); // NON-NLS
JOptionPane.showMessageDialog(null, Bundle.msgdlg_problem_text());
logger.log(Level.WARNING, "Unexpected exception while populating database.", ex); // NON-NLS
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), Bundle.msgdlg_problem_text());
}
}
@ -696,11 +697,11 @@ public class EventsRepository {
insertEventForArtifact(type, blackboardArtifacts.get(i), trans);
updateProgress(i, numArtifacts);
} catch (TskCoreException ex) {
LOGGER.log(Level.SEVERE, "There was a problem inserting event for artifact: " + blackboardArtifacts.get(i).getArtifactID(), ex); // NON-NLS
logger.log(Level.SEVERE, "There was a problem inserting event for artifact: " + blackboardArtifacts.get(i).getArtifactID(), ex); // NON-NLS
}
}
} catch (TskCoreException ex) {
LOGGER.log(Level.SEVERE, "There was a problem getting events with sub type " + type.toString() + ".", ex); // NON-NLS
logger.log(Level.SEVERE, "There was a problem getting events with sub type " + type.toString() + ".", ex); // NON-NLS
}
}

View File

@ -1,7 +1,7 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2016 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");
@ -45,6 +45,7 @@ import org.joda.time.DateTime;
import org.joda.time.Interval;
import org.joda.time.Seconds;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.coreutils.ColorUtilities;
import org.sleuthkit.autopsy.timeline.TimeLineController;
import org.sleuthkit.autopsy.timeline.ViewMode;
@ -394,7 +395,7 @@ final class EventCountsChart extends StackedBarChart<String, Number> implements
controller.pushTimeRange(interval);
} else {
int showConfirmDialog = JOptionPane.showConfirmDialog(null,
int showConfirmDialog = JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(),
Bundle.CountsViewPane_detailSwitchMessage(),
Bundle.CountsViewPane_detailSwitchTitle(), JOptionPane.YES_NO_OPTION);
if (showConfirmDialog == JOptionPane.YES_OPTION) {

View File

@ -1,51 +0,0 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2011-2017 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/package org.sleuthkit.autopsy.ingest;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
public class IngestFileFiltersTest {
public IngestFileFiltersTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
@Test
public void testFilters() {
System.out.println("Test filter");
}
}

View File

@ -73,6 +73,8 @@
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="bnPrioritizeCase" max="32767" attributes="0"/>
<Component id="bnPrioritizeJob" max="32767" attributes="0"/>
<Component id="bnDeprioritizeCase" alignment="0" max="32767" attributes="0"/>
<Component id="bnDeprioritizeJob" alignment="0" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
@ -102,10 +104,14 @@
<Component id="pendingScrollPane" min="-2" pref="215" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="82" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="48" max="-2" attributes="0"/>
<Component id="bnPrioritizeCase" linkSize="2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="bnDeprioritizeCase" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
<Component id="bnPrioritizeJob" linkSize="2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="bnDeprioritizeJob" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
@ -608,5 +614,52 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnReprocessJobActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="bnDeprioritizeCase">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestControlPanel.bnDeprioritizeCase.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestControlPanel.bnDeprioritizeCase.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[162, 23]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[162, 23]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[162, 23]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnDeprioritizeCaseActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="bnDeprioritizeJob">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestControlPanel.bnDeprioritizeJob.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestControlPanel.bnDeprioritizeJob.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="actionCommand" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestControlPanel.bnDeprioritizeJob.actionCommand" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[162, 23]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[162, 23]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[162, 23]"/>
</Property>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="bnDeprioritizeJobActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

View File

@ -73,8 +73,6 @@ import org.sleuthkit.autopsy.ingest.IngestProgressSnapshotDialog;
* one such panel per node.
*/
@Messages({
"AutoIngestControlPanel.bnClusterMetrics.text=Auto Ingest Metrics",
"AutoIngestControlPanel.bnPause.text=Pause",
"AutoIngestControlPanel.bnPause.paused=Paused",
"AutoIngestControlPanel.bnPause.running=Running",
"AutoIngestControlPanel.bnPause.confirmHeader=Are you sure you want to pause?",
@ -88,38 +86,15 @@ import org.sleuthkit.autopsy.ingest.IngestProgressSnapshotDialog;
"AutoIngestControlPanel.pendingTable.toolTipText=The Pending table displays the order upcoming Jobs will be processed with the top of the list first",
"AutoIngestControlPanel.runningTable.toolTipText=The Running table displays the currently running Job and information about it",
"AutoIngestControlPanel.completedTable.toolTipText=The Completed table shows all Jobs that have been processed already",
"AutoIngestControlPanel.bnCancelJob.text=&Cancel Job",
"AutoIngestControlPanel.bnCancelJob.toolTipText=Cancel processing of the current Job and move on to the next Job. This functionality is only available for jobs running on current AIM node.",
"AutoIngestControlPanel.bnDeleteCase.text=&Delete Case",
"AutoIngestControlPanel.bnDeleteCase.toolTipText=Delete the selected Case in its entirety",
"AutoIngestControlPanel.bnResume.text=Resume",
"AutoIngestControlPanel.lbPending.text=Pending Jobs",
"AutoIngestControlPanel.lbRunning.text=Running Jobs",
"AutoIngestControlPanel.lbCompleted.text=Completed Jobs",
"AutoIngestControlPanel.bnRefresh.text=&Refresh",
"AutoIngestControlPanel.bnRefresh.toolTipText=Refresh displayed tables",
"AutoIngestControlPanel.bnCancelModule.text=Cancel &Module",
"AutoIngestControlPanel.bnCancelModule.toolTipText=Cancel processing of the current module within the Job and move on to the next module within the Job. This functionality is only available for jobs running on current AIM node.",
"AutoIngestControlPanel.bnExit.text=&Exit",
"AutoIngestControlPanel.bnExit.toolTipText=Exit Application",
"AutoIngestControlPanel.bnOptions.text=&Options",
"AutoIngestControlPanel.bnOptions.toolTipText=Display options panel. All processing must be paused to open the options panel.",
"AutoIngestControlPanel.bnShowProgress.text=Ingest Progress",
"AutoIngestControlPanel.bnShowProgress.toolTipText=Show the progress of the currently running Job. This functionality is only available for jobs running on current AIM node.",
"AutoIngestControlPanel.bnPrioritizeCase.text=Prioritize Case",
"AutoIngestControlPanel.bnPrioritizeCase.toolTipText=Move all images associated with a case to top of Pending queue.",
"AutoIngestControlPanel.bnShowCaseLog.text=Show Case &Log",
"AutoIngestControlPanel.bnShowCaseLog.toolTipText=Display case log file for selected case",
"AutoIngestControlPanel.tbStatusMessage.text=",
"AutoIngestControlPanel.lbStatus.text=Status:",
"AutoIngestControlPanel.bnPrioritizeJob.text=Prioritize Job",
"AutoIngestControlPanel.bnPrioritizeJob.toolTipText=Move this folder to the top of the Pending queue.",
"AutoIngestControlPanel.bnPrioritizeJob.actionCommand=<AutoIngestControlPanel.bnPrioritizeJob.text>",
"AutoIngestControlPanel.lbServicesStatus.text=Services Status:",
"AutoIngestControlPanel.tbServicesStatusMessage.text=",
"AutoIngestControlPanel.bnOpenLogDir.text=Open System Logs Folder",
"AutoIngestControlPanel.bnReprocessJob.text=Reprocess Job",
"AutoIngestControlPanel.bnPrioritizeFolder.label=<AutoIngestControlPanel.bnPrioritizeJob.text>",
"AutoIngestControlPanel.Cancelling=Cancelling...",
"AutoIngestControlPanel.AutoIngestStartupWarning.Title=Automated Ingest Warning",
"AutoIngestControlPanel.AutoIngestStartupWarning.Message=Failed to establish remote communications with other automated ingest nodes.\nAuto ingest dashboard will only be able to display local ingest job events.\nPlease verify Multi-User settings (Options->Multi-User). See application log for details.",
@ -418,7 +393,14 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
return;
}
int row = pendingTable.getSelectedRow();
enablePendingTableButtons((row >= 0) && (row < pendingTable.getRowCount()));
boolean enablePrioritizeButtons = false;
boolean enableDeprioritizeButtons = false;
if ((row >= 0) && (row < pendingTable.getRowCount())) {
enablePrioritizeButtons = true;
enableDeprioritizeButtons = ((Integer) pendingTableModel.getValueAt(row, JobsTableModelColumns.PRIORITY.ordinal()) > 0);
}
enablePrioritizeButtons(enablePrioritizeButtons);
enableDeprioritizeButtons(enableDeprioritizeButtons);
});
/*
@ -622,7 +604,8 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
private void initButtons() {
bnOptions.setEnabled(true);
bnDeleteCase.setEnabled(false);
enablePendingTableButtons(false);
enablePrioritizeButtons(false);
enableDeprioritizeButtons(false);
bnShowCaseLog.setEnabled(false);
bnReprocessJob.setEnabled(false);
bnPause.setText(org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.bnStart.text"));
@ -645,15 +628,26 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
}
/**
* Enables or disables buttons related to pending jobs table.
* Enables or disables prioritize buttons related to the pending jobs table.
*
* @param enable Enable/disable the buttons.
*/
private void enablePendingTableButtons(Boolean enable) {
private void enablePrioritizeButtons(Boolean enable) {
bnPrioritizeCase.setEnabled(enable);
bnPrioritizeJob.setEnabled(enable);
}
/**
* Enables or disables deprioritize buttons related to the pending jobs
* table.
*
* @param enable Enable/disable the buttons.
*/
private void enableDeprioritizeButtons(Boolean enable) {
bnDeprioritizeCase.setEnabled(enable);
bnDeprioritizeJob.setEnabled(enable);
}
/**
* Starts up the auto ingest manager and adds this panel as an observer,
* subscribes to services monitor events and starts a task to populate the
@ -1201,6 +1195,8 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
bnOpenLogDir = new javax.swing.JButton();
bnClusterMetrics = new javax.swing.JButton();
bnReprocessJob = new javax.swing.JButton();
bnDeprioritizeCase = new javax.swing.JButton();
bnDeprioritizeJob = new javax.swing.JButton();
pendingTable.setModel(pendingTableModel);
pendingTable.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.pendingTable.toolTipText")); // NOI18N
@ -1434,6 +1430,29 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
}
});
org.openide.awt.Mnemonics.setLocalizedText(bnDeprioritizeCase, org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.bnDeprioritizeCase.text")); // NOI18N
bnDeprioritizeCase.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.bnDeprioritizeCase.toolTipText")); // NOI18N
bnDeprioritizeCase.setMaximumSize(new java.awt.Dimension(162, 23));
bnDeprioritizeCase.setMinimumSize(new java.awt.Dimension(162, 23));
bnDeprioritizeCase.setPreferredSize(new java.awt.Dimension(162, 23));
bnDeprioritizeCase.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bnDeprioritizeCaseActionPerformed(evt);
}
});
org.openide.awt.Mnemonics.setLocalizedText(bnDeprioritizeJob, org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.bnDeprioritizeJob.text")); // NOI18N
bnDeprioritizeJob.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.bnDeprioritizeJob.toolTipText")); // NOI18N
bnDeprioritizeJob.setActionCommand(org.openide.util.NbBundle.getMessage(AutoIngestControlPanel.class, "AutoIngestControlPanel.bnDeprioritizeJob.actionCommand")); // NOI18N
bnDeprioritizeJob.setMaximumSize(new java.awt.Dimension(162, 23));
bnDeprioritizeJob.setMinimumSize(new java.awt.Dimension(162, 23));
bnDeprioritizeJob.setPreferredSize(new java.awt.Dimension(162, 23));
bnDeprioritizeJob.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bnDeprioritizeJobActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@ -1486,7 +1505,9 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(bnPrioritizeCase, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bnPrioritizeJob, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addComponent(bnPrioritizeJob, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bnDeprioritizeCase, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bnDeprioritizeJob, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
);
@ -1511,10 +1532,14 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pendingScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(82, 82, 82)
.addGap(48, 48, 48)
.addComponent(bnPrioritizeCase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(bnPrioritizeJob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addComponent(bnDeprioritizeCase, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(30, 30, 30)
.addComponent(bnPrioritizeJob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(bnDeprioritizeJob, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbRunning)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -1747,7 +1772,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
*
* @param evt The button click event.
*/
@Messages({"AutoIngestControlPanel.casePrioritization.errorMessage=An error occurred when prioritizing the case. Some or all jobs may not have been prioritized."})
@Messages({"AutoIngestControlPanel.errorMessage.casePrioritization=An error occurred when prioritizing the case. Some or all jobs may not have been prioritized."})
private void bnPrioritizeCaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnPrioritizeCaseActionPerformed
if (pendingTable.getModel().getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
@ -1757,11 +1782,12 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
manager.prioritizeCase(caseName);
} catch (AutoIngestManager.AutoIngestManagerException ex) {
SYS_LOGGER.log(Level.SEVERE, "Error prioritizing a case", ex);
MessageNotifyUtil.Message.error(Bundle.AutoIngestControlPanel_casePrioritization_errorMessage());
MessageNotifyUtil.Message.error(Bundle.AutoIngestControlPanel_errorMessage_casePrioritization());
}
refreshTables();
pendingTable.clearSelection();
enablePendingTableButtons(false);
enablePrioritizeButtons(false);
enableDeprioritizeButtons(false);
AutoIngestControlPanel.this.setCursor(Cursor.getDefaultCursor());
}
}//GEN-LAST:event_bnPrioritizeCaseActionPerformed
@ -1807,7 +1833,7 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
}
}//GEN-LAST:event_bnShowCaseLogActionPerformed
@Messages({"AutoIngestControlPanel.jobPrioritization.errorMessage=An error occurred when prioritizing the job."})
@Messages({"AutoIngestControlPanel.errorMessage.jobPrioritization=An error occurred when prioritizing the job."})
private void bnPrioritizeJobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnPrioritizeJobActionPerformed
if (pendingTable.getModel().getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
@ -1815,12 +1841,13 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
try {
manager.prioritizeJob(manifestFilePath);
} catch (AutoIngestManager.AutoIngestManagerException ex) {
SYS_LOGGER.log(Level.SEVERE, "Error prioritizing a case", ex);
MessageNotifyUtil.Message.error(Bundle.AutoIngestControlPanel_jobPrioritization_errorMessage());
SYS_LOGGER.log(Level.SEVERE, "Error prioritizing a job", ex);
MessageNotifyUtil.Message.error(Bundle.AutoIngestControlPanel_errorMessage_jobPrioritization());
}
refreshTables();
pendingTable.clearSelection();
enablePendingTableButtons(false);
enablePrioritizeButtons(false);
enableDeprioritizeButtons(false);
AutoIngestControlPanel.this.setCursor(Cursor.getDefaultCursor());
}
}//GEN-LAST:event_bnPrioritizeJobActionPerformed
@ -1852,11 +1879,52 @@ public final class AutoIngestControlPanel extends JPanel implements Observer {
new AutoIngestMetricsDialog(this.getTopLevelAncestor());
}//GEN-LAST:event_bnClusterMetricsActionPerformed
@Messages({"AutoIngestControlPanel.errorMessage.caseDeprioritization=An error occurred when deprioritizing the case. Some or all jobs may not have been deprioritized."})
private void bnDeprioritizeCaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnDeprioritizeCaseActionPerformed
if (pendingTable.getModel().getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
String caseName = (pendingTable.getModel().getValueAt(pendingTable.convertRowIndexToModel(pendingTable.getSelectedRow()), JobsTableModelColumns.CASE.ordinal())).toString();
try {
manager.deprioritizeCase(caseName);
} catch (AutoIngestManager.AutoIngestManagerException ex) {
SYS_LOGGER.log(Level.SEVERE, "Error deprioritizing a case", ex);
MessageNotifyUtil.Message.error(Bundle.AutoIngestControlPanel_errorMessage_caseDeprioritization());
}
refreshTables();
pendingTable.clearSelection();
enablePrioritizeButtons(false);
enableDeprioritizeButtons(false);
AutoIngestControlPanel.this.setCursor(Cursor.getDefaultCursor());
}
}//GEN-LAST:event_bnDeprioritizeCaseActionPerformed
@Messages({"AutoIngestControlPanel.errorMessage.jobDeprioritization=An error occurred when deprioritizing the job."})
private void bnDeprioritizeJobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnDeprioritizeJobActionPerformed
if (pendingTable.getModel().getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
Path manifestFilePath = (Path) (pendingTable.getModel().getValueAt(pendingTable.convertRowIndexToModel(pendingTable.getSelectedRow()), JobsTableModelColumns.MANIFEST_FILE_PATH.ordinal()));
try {
manager.deprioritizeJob(manifestFilePath);
} catch (AutoIngestManager.AutoIngestManagerException ex) {
SYS_LOGGER.log(Level.SEVERE, "Error deprioritizing a job", ex);
MessageNotifyUtil.Message.error(Bundle.AutoIngestControlPanel_errorMessage_jobDeprioritization());
}
refreshTables();
pendingTable.clearSelection();
enablePrioritizeButtons(false);
enableDeprioritizeButtons(false);
AutoIngestControlPanel.this.setCursor(Cursor.getDefaultCursor());
}
}//GEN-LAST:event_bnDeprioritizeJobActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton bnCancelJob;
private javax.swing.JButton bnCancelModule;
private javax.swing.JButton bnClusterMetrics;
private javax.swing.JButton bnDeleteCase;
private javax.swing.JButton bnDeprioritizeCase;
private javax.swing.JButton bnDeprioritizeJob;
private javax.swing.JButton bnExit;
private javax.swing.JButton bnOpenLogDir;
private javax.swing.JButton bnOptions;

View File

@ -35,11 +35,15 @@
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="refreshButton" linkSize="1" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="prioritizeJobButton" linkSize="1" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="deprioritizeJobButton" min="-2" pref="127" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="prioritizeCaseButton" linkSize="1" min="-2" pref="100" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="deprioritizeCaseButton" min="-2" pref="127" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="clusterMetricsButton" linkSize="1" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="lbPending" alignment="0" min="-2" max="-2" attributes="0"/>
@ -84,6 +88,8 @@
<Component id="prioritizeJobButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="prioritizeCaseButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="clusterMetricsButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="deprioritizeJobButton" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="deprioritizeCaseButton" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -265,5 +271,33 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="clusterMetricsButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="deprioritizeJobButton">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestDashboard.deprioritizeJobButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestDashboard.deprioritizeJobButton.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deprioritizeJobButtonActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="deprioritizeCaseButton">
<Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestDashboard.deprioritizeCaseButton.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/experimental/autoingest/Bundle.properties" key="AutoIngestDashboard.deprioritizeCaseButton.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deprioritizeCaseButtonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>

View File

@ -247,9 +247,16 @@ final class AutoIngestDashboard extends JPanel implements Observer {
}
int row = pendingTable.getSelectedRow();
boolean enablePrioritizeButtons = (row >= 0 && row < pendingTable.getRowCount());
boolean enablePrioritizeButtons = false;
boolean enableDeprioritizeButtons = false;
if (row >= 0 && row < pendingTable.getRowCount()) {
enablePrioritizeButtons = true;
enableDeprioritizeButtons = (Integer) pendingTableModel.getValueAt(row, JobsTableModelColumns.PRIORITY.ordinal()) > 0;
}
this.prioritizeJobButton.setEnabled(enablePrioritizeButtons);
this.prioritizeCaseButton.setEnabled(enablePrioritizeButtons);
this.deprioritizeJobButton.setEnabled(enableDeprioritizeButtons);
this.deprioritizeCaseButton.setEnabled(enableDeprioritizeButtons);
});
}
@ -655,6 +662,8 @@ final class AutoIngestDashboard extends JPanel implements Observer {
prioritizeJobButton = new javax.swing.JButton();
prioritizeCaseButton = new javax.swing.JButton();
clusterMetricsButton = new javax.swing.JButton();
deprioritizeJobButton = new javax.swing.JButton();
deprioritizeCaseButton = new javax.swing.JButton();
org.openide.awt.Mnemonics.setLocalizedText(jButton1, org.openide.util.NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.jButton1.text")); // NOI18N
@ -759,6 +768,24 @@ final class AutoIngestDashboard extends JPanel implements Observer {
}
});
org.openide.awt.Mnemonics.setLocalizedText(deprioritizeJobButton, org.openide.util.NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.deprioritizeJobButton.text")); // NOI18N
deprioritizeJobButton.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.deprioritizeJobButton.toolTipText")); // NOI18N
deprioritizeJobButton.setEnabled(false);
deprioritizeJobButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
deprioritizeJobButtonActionPerformed(evt);
}
});
org.openide.awt.Mnemonics.setLocalizedText(deprioritizeCaseButton, org.openide.util.NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.deprioritizeCaseButton.text")); // NOI18N
deprioritizeCaseButton.setToolTipText(org.openide.util.NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.deprioritizeCaseButton.toolTipText")); // NOI18N
deprioritizeCaseButton.setEnabled(false);
deprioritizeCaseButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
deprioritizeCaseButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
@ -773,11 +800,15 @@ final class AutoIngestDashboard extends JPanel implements Observer {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGap(18, 18, 18)
.addComponent(prioritizeJobButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(deprioritizeJobButton, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(prioritizeCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(deprioritizeCaseButton, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(clusterMetricsButton))
.addComponent(lbPending, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lbCompleted, javax.swing.GroupLayout.Alignment.LEADING)
@ -816,7 +847,9 @@ final class AutoIngestDashboard extends JPanel implements Observer {
.addComponent(refreshButton)
.addComponent(prioritizeJobButton)
.addComponent(prioritizeCaseButton)
.addComponent(clusterMetricsButton))
.addComponent(clusterMetricsButton)
.addComponent(deprioritizeJobButton)
.addComponent(deprioritizeCaseButton))
.addContainerGap())
);
}// </editor-fold>//GEN-END:initComponents
@ -835,9 +868,7 @@ final class AutoIngestDashboard extends JPanel implements Observer {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}//GEN-LAST:event_refreshButtonActionPerformed
@Messages({
"AutoIngestDashboard.PrioritizeJobError=Failed to prioritize job \"%s\"."
})
@Messages({"AutoIngestDashboard.errorMessage.jobPrioritization=Failed to prioritize job \"%s\"."})
private void prioritizeJobButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_prioritizeJobButtonActionPerformed
if (pendingTableModel.getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
@ -847,7 +878,7 @@ final class AutoIngestDashboard extends JPanel implements Observer {
jobsSnapshot = autoIngestMonitor.prioritizeJob(job);
refreshTables(jobsSnapshot);
} catch (AutoIngestMonitor.AutoIngestMonitorException ex) {
String errorMessage = String.format(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.PrioritizeJobError"), job.getManifest().getFilePath());
String errorMessage = String.format(Bundle.AutoIngestDashboard_errorMessage_jobPrioritization(), job.getManifest().getFilePath());
LOGGER.log(Level.SEVERE, errorMessage, ex);
MessageNotifyUtil.Message.error(errorMessage);
}
@ -855,9 +886,7 @@ final class AutoIngestDashboard extends JPanel implements Observer {
}
}//GEN-LAST:event_prioritizeJobButtonActionPerformed
@Messages({
"AutoIngestDashboard.PrioritizeCaseError=Failed to prioritize job \"%s\"."
})
@Messages({"AutoIngestDashboard.errorMessage.casePrioritization=Failed to prioritize case \"%s\"."})
private void prioritizeCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_prioritizeCaseButtonActionPerformed
if (pendingTableModel.getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
@ -867,7 +896,7 @@ final class AutoIngestDashboard extends JPanel implements Observer {
jobsSnapshot = autoIngestMonitor.prioritizeCase(caseName);
refreshTables(jobsSnapshot);
} catch (AutoIngestMonitor.AutoIngestMonitorException ex) {
String errorMessage = String.format(NbBundle.getMessage(AutoIngestDashboard.class, "AutoIngestDashboard.PrioritizeCaseError"), caseName);
String errorMessage = String.format(Bundle.AutoIngestDashboard_errorMessage_casePrioritization(), caseName);
LOGGER.log(Level.SEVERE, errorMessage, ex);
MessageNotifyUtil.Message.error(errorMessage);
}
@ -879,10 +908,48 @@ final class AutoIngestDashboard extends JPanel implements Observer {
new AutoIngestMetricsDialog(this.getTopLevelAncestor());
}//GEN-LAST:event_clusterMetricsButtonActionPerformed
@Messages({"AutoIngestDashboard.errorMessage.jobDeprioritization=Failed to deprioritize job \"%s\"."})
private void deprioritizeJobButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deprioritizeJobButtonActionPerformed
if (pendingTableModel.getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
AutoIngestJob job = (AutoIngestJob) (pendingTableModel.getValueAt(pendingTable.getSelectedRow(), JobsTableModelColumns.JOB.ordinal()));
JobsSnapshot jobsSnapshot;
try {
jobsSnapshot = autoIngestMonitor.deprioritizeJob(job);
refreshTables(jobsSnapshot);
} catch (AutoIngestMonitor.AutoIngestMonitorException ex) {
String errorMessage = String.format(Bundle.AutoIngestDashboard_errorMessage_jobDeprioritization(), job.getManifest().getFilePath());
LOGGER.log(Level.SEVERE, errorMessage, ex);
MessageNotifyUtil.Message.error(errorMessage);
}
setCursor(Cursor.getDefaultCursor());
}
}//GEN-LAST:event_deprioritizeJobButtonActionPerformed
@Messages({"AutoIngestDashboard.errorMessage.caseDeprioritization=Failed to deprioritize case \"%s\"."})
private void deprioritizeCaseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deprioritizeCaseButtonActionPerformed
if (pendingTableModel.getRowCount() > 0 && pendingTable.getSelectedRow() >= 0) {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
String caseName = (pendingTableModel.getValueAt(pendingTable.getSelectedRow(), JobsTableModelColumns.CASE.ordinal())).toString();
JobsSnapshot jobsSnapshot;
try {
jobsSnapshot = autoIngestMonitor.deprioritizeCase(caseName);
refreshTables(jobsSnapshot);
} catch (AutoIngestMonitor.AutoIngestMonitorException ex) {
String errorMessage = String.format(Bundle.AutoIngestDashboard_errorMessage_caseDeprioritization(), caseName);
LOGGER.log(Level.SEVERE, errorMessage, ex);
MessageNotifyUtil.Message.error(errorMessage);
}
setCursor(Cursor.getDefaultCursor());
}
}//GEN-LAST:event_deprioritizeCaseButtonActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton clusterMetricsButton;
private javax.swing.JScrollPane completedScrollPane;
private javax.swing.JTable completedTable;
private javax.swing.JButton deprioritizeCaseButton;
private javax.swing.JButton deprioritizeJobButton;
private javax.swing.JButton jButton1;
private javax.swing.JLabel lbCompleted;
private javax.swing.JLabel lbPending;

View File

@ -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");
@ -132,6 +132,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
private static final long JOB_STATUS_EVENT_INTERVAL_SECONDS = 10;
private static final String JOB_STATUS_PUBLISHING_THREAD_NAME = "AIM-job-status-event-publisher-%d";
private static final long MAX_MISSED_JOB_STATUS_UPDATES = 10;
private static final int DEFAULT_PRIORITY = 0;
private static final java.util.logging.Logger SYS_LOGGER = AutoIngestSystemLogger.getLogger();
private static AutoIngestManager instance;
private final AutopsyEventPublisher eventPublisher;
@ -530,7 +531,49 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
}
/**
* Removes the priority (set to zero) of all pending ingest jobs for a
* specified case.
*
* @param caseName The name of the case to be deprioritized.
*
* @throws AutoIngestManagerException If there is an error removing the
* priority of the jobs for the case.
*/
void deprioritizeCase(final String caseName) throws AutoIngestManagerException {
if (state != State.RUNNING) {
return;
}
List<AutoIngestJob> jobsToDeprioritize = new ArrayList<>();
synchronized (jobsLock) {
for (AutoIngestJob job : pendingJobs) {
if (job.getManifest().getCaseName().equals(caseName)) {
jobsToDeprioritize.add(job);
}
}
if (!jobsToDeprioritize.isEmpty()) {
for (AutoIngestJob job : jobsToDeprioritize) {
int oldPriority = job.getPriority();
job.setPriority(DEFAULT_PRIORITY);
try {
this.updateCoordinationServiceManifestNode(job);
} catch (CoordinationServiceException | InterruptedException ex) {
job.setPriority(oldPriority);
throw new AutoIngestManagerException("Error updating case priority", ex);
}
}
}
Collections.sort(pendingJobs, new AutoIngestJob.PriorityComparator());
}
if (!jobsToDeprioritize.isEmpty()) {
new Thread(() -> {
eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName));
}).start();
}
}
/**
* Bumps the priority of all pending ingest jobs for a specified case.
*
@ -545,7 +588,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
return;
}
List<AutoIngestJob> prioritizedJobs = new ArrayList<>();
List<AutoIngestJob> jobsToPrioritize = new ArrayList<>();
int maxPriority = 0;
synchronized (jobsLock) {
for (AutoIngestJob job : pendingJobs) {
@ -553,12 +596,12 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
maxPriority = job.getPriority();
}
if (job.getManifest().getCaseName().equals(caseName)) {
prioritizedJobs.add(job);
jobsToPrioritize.add(job);
}
}
if (!prioritizedJobs.isEmpty()) {
if (!jobsToPrioritize.isEmpty()) {
++maxPriority;
for (AutoIngestJob job : prioritizedJobs) {
for (AutoIngestJob job : jobsToPrioritize) {
int oldPriority = job.getPriority();
job.setPriority(maxPriority);
try {
@ -573,7 +616,58 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
Collections.sort(pendingJobs, new AutoIngestJob.PriorityComparator());
}
if (!prioritizedJobs.isEmpty()) {
if (!jobsToPrioritize.isEmpty()) {
new Thread(() -> {
eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName));
}).start();
}
}
/**
* Removes the priority (set to zero) of an auto ingest job.
*
* @param manifestPath The manifest file path for the job to be
* deprioritized.
*
* @throws AutoIngestManagerException If there is an error removing the
* priority of the job.
*/
void deprioritizeJob(Path manifestPath) throws AutoIngestManagerException {
if (state != State.RUNNING) {
return;
}
AutoIngestJob jobToDeprioritize = null;
synchronized (jobsLock) {
/*
* Find the job in the pending jobs list.
*/
for (AutoIngestJob job : pendingJobs) {
if (job.getManifest().getFilePath().equals(manifestPath)) {
jobToDeprioritize = job;
}
}
/*
* Remove the priority and update the coordination service manifest
* node data for the job.
*/
if (null != jobToDeprioritize) {
int oldPriority = jobToDeprioritize.getPriority();
jobToDeprioritize.setPriority(DEFAULT_PRIORITY);
try {
this.updateCoordinationServiceManifestNode(jobToDeprioritize);
} catch (CoordinationServiceException | InterruptedException ex) {
jobToDeprioritize.setPriority(oldPriority);
throw new AutoIngestManagerException("Error updating job priority", ex);
}
}
Collections.sort(pendingJobs, new AutoIngestJob.PriorityComparator());
}
if (null != jobToDeprioritize) {
final String caseName = jobToDeprioritize.getManifest().getCaseName();
new Thread(() -> {
eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName));
}).start();
@ -594,7 +688,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
}
int maxPriority = 0;
AutoIngestJob prioritizedJob = null;
AutoIngestJob jobToPrioritize = null;
synchronized (jobsLock) {
/*
* Find the job in the pending jobs list and record the highest
@ -605,7 +699,7 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
maxPriority = job.getPriority();
}
if (job.getManifest().getFilePath().equals(manifestPath)) {
prioritizedJob = job;
jobToPrioritize = job;
}
}
@ -613,14 +707,14 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
* Bump the priority by one and update the coordination service
* manifest node data for the job.
*/
if (null != prioritizedJob) {
if (null != jobToPrioritize) {
++maxPriority;
int oldPriority = prioritizedJob.getPriority();
prioritizedJob.setPriority(maxPriority);
int oldPriority = jobToPrioritize.getPriority();
jobToPrioritize.setPriority(maxPriority);
try {
this.updateCoordinationServiceManifestNode(prioritizedJob);
this.updateCoordinationServiceManifestNode(jobToPrioritize);
} catch (CoordinationServiceException | InterruptedException ex) {
prioritizedJob.setPriority(oldPriority);
jobToPrioritize.setPriority(oldPriority);
throw new AutoIngestManagerException("Error updating job priority", ex);
}
}
@ -628,8 +722,8 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
Collections.sort(pendingJobs, new AutoIngestJob.PriorityComparator());
}
if (null != prioritizedJob) {
final String caseName = prioritizedJob.getManifest().getCaseName();
if (null != jobToPrioritize) {
final String caseName = jobToPrioritize.getManifest().getCaseName();
new Thread(() -> {
eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName));
}).start();

View File

@ -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");
@ -46,6 +46,7 @@ import org.sleuthkit.autopsy.experimental.autoingest.AutoIngestJob.ProcessingSta
final class AutoIngestMonitor extends Observable implements PropertyChangeListener {
private static final Logger LOGGER = Logger.getLogger(AutoIngestMonitor.class.getName());
private static final int DEFAULT_PRIORITY = 0;
private static final int NUM_COORD_SVC_QUERY_THREADS = 1;
private static final String COORD_SVC_QUERY_THREAD_NAME = "AIM-coord-svc-query-thread-%d"; //NON-NLS
private static final int CORRD_SVC_QUERY_INERVAL_MINS = 5;
@ -271,15 +272,59 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen
LOGGER.log(Level.SEVERE, String.format("Failed to create a job for '%s'", node), ex);
}
}
return newJobsSnapshot;
} catch (CoordinationServiceException ex) {
LOGGER.log(Level.SEVERE, "Failed to get node list from coordination service", ex);
return new JobsSnapshot();
}
}
/**
* Removes the priority (set to zero) of all pending ingest jobs for a
* specified case.
*
* @param caseName The name of the case to be deprioritized.
*
* @throws AutoIngestMonitorException If there is an error removing the
* priority of the jobs for the case.
*
* @return The latest jobs snapshot.
*/
JobsSnapshot deprioritizeCase(final String caseName) throws AutoIngestMonitorException {
List<AutoIngestJob> jobsToDeprioritize = new ArrayList<>();
synchronized (jobsLock) {
for (AutoIngestJob pendingJob : jobsSnapshot.getPendingJobs()) {
if (pendingJob.getManifest().getCaseName().equals(caseName)) {
jobsToDeprioritize.add(pendingJob);
}
}
if (!jobsToDeprioritize.isEmpty()) {
for (AutoIngestJob job : jobsToDeprioritize) {
String manifestNodePath = job.getManifest().getFilePath().toString();
try {
AutoIngestJobNodeData nodeData = new AutoIngestJobNodeData(coordinationService.getNodeData(CoordinationService.CategoryNode.MANIFESTS, manifestNodePath));
nodeData.setPriority(DEFAULT_PRIORITY);
coordinationService.setNodeData(CoordinationService.CategoryNode.MANIFESTS, manifestNodePath, nodeData.toArray());
} catch (AutoIngestJobNodeData.InvalidDataException | CoordinationServiceException | InterruptedException ex) {
throw new AutoIngestMonitorException("Error removing priority for job " + job.toString(), ex);
}
job.setPriority(DEFAULT_PRIORITY);
}
/*
* Publish a deprioritization event.
*/
new Thread(() -> {
eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName));
}).start();
}
return jobsSnapshot;
}
}
/**
* Bumps the priority of all pending ingest jobs for a specified case.
*
@ -287,11 +332,11 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen
*
* @throws AutoIngestMonitorException If there is an error bumping the
* priority of the jobs for the case.
*
*
* @return The latest jobs snapshot.
*/
JobsSnapshot prioritizeCase(final String caseName) throws AutoIngestMonitorException {
List<AutoIngestJob> prioritizedJobs = new ArrayList<>();
List<AutoIngestJob> jobsToPrioritize = new ArrayList<>();
int highestPriority = 0;
synchronized (jobsLock) {
for (AutoIngestJob pendingJob : jobsSnapshot.getPendingJobs()) {
@ -299,12 +344,12 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen
highestPriority = pendingJob.getPriority();
}
if (pendingJob.getManifest().getCaseName().equals(caseName)) {
prioritizedJobs.add(pendingJob);
jobsToPrioritize.add(pendingJob);
}
}
if (!prioritizedJobs.isEmpty()) {
if (!jobsToPrioritize.isEmpty()) {
++highestPriority;
for (AutoIngestJob job : prioritizedJobs) {
for (AutoIngestJob job : jobsToPrioritize) {
String manifestNodePath = job.getManifest().getFilePath().toString();
try {
AutoIngestJobNodeData nodeData = new AutoIngestJobNodeData(coordinationService.getNodeData(CoordinationService.CategoryNode.MANIFESTS, manifestNodePath));
@ -327,20 +372,71 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen
}
}
/**
* Removes the priority (set to zero) of an auto ingest job.
*
* @param job The job to be deprioritized.
*
* @throws AutoIngestMonitorException If there is an error removing the
* priority of the job.
*
* @return The latest jobs snapshot.
*/
JobsSnapshot deprioritizeJob(AutoIngestJob job) throws AutoIngestMonitorException {
synchronized (jobsLock) {
AutoIngestJob jobToDeprioritize = null;
/*
* Make sure the job is still in the pending jobs queue.
*/
for (AutoIngestJob pendingJob : jobsSnapshot.getPendingJobs()) {
if (pendingJob.equals(job)) {
jobToDeprioritize = job;
break;
}
}
/*
* If the job was still in the pending jobs queue, bump its
* priority.
*/
if (null != jobToDeprioritize) {
String manifestNodePath = job.getManifest().getFilePath().toString();
try {
AutoIngestJobNodeData nodeData = new AutoIngestJobNodeData(coordinationService.getNodeData(CoordinationService.CategoryNode.MANIFESTS, manifestNodePath));
nodeData.setPriority(DEFAULT_PRIORITY);
coordinationService.setNodeData(CoordinationService.CategoryNode.MANIFESTS, manifestNodePath, nodeData.toArray());
} catch (AutoIngestJobNodeData.InvalidDataException | CoordinationServiceException | InterruptedException ex) {
throw new AutoIngestMonitorException("Error removing priority for job " + job.toString(), ex);
}
jobToDeprioritize.setPriority(DEFAULT_PRIORITY);
/*
* Publish a deprioritization event.
*/
final String caseName = job.getManifest().getCaseName();
new Thread(() -> {
eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName));
}).start();
}
return jobsSnapshot;
}
}
/**
* Bumps the priority of an auto ingest job.
*
* @param job The job to be prioritized.
*
*
* @throws AutoIngestMonitorException If there is an error bumping the
* priority of the job.
*
*
* @return The latest jobs snapshot.
*/
JobsSnapshot prioritizeJob(AutoIngestJob job) throws AutoIngestMonitorException {
synchronized (jobsLock) {
int highestPriority = 0;
AutoIngestJob prioritizedJob = null;
AutoIngestJob jobToPrioritize = null;
/*
* Get the highest known priority and make sure the job is still in
* the pending jobs queue.
@ -350,7 +446,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen
highestPriority = pendingJob.getPriority();
}
if (pendingJob.equals(job)) {
prioritizedJob = job;
jobToPrioritize = job;
}
}
@ -358,7 +454,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen
* If the job was still in the pending jobs queue, bump its
* priority.
*/
if (null != prioritizedJob) {
if (null != jobToPrioritize) {
++highestPriority;
String manifestNodePath = job.getManifest().getFilePath().toString();
try {
@ -368,7 +464,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen
} catch (AutoIngestJobNodeData.InvalidDataException | CoordinationServiceException | InterruptedException ex) {
throw new AutoIngestMonitorException("Error bumping priority for job " + job.toString(), ex);
}
prioritizedJob.setPriority(highestPriority);
jobToPrioritize.setPriority(highestPriority);
/*
* Publish a prioritization event.
@ -525,7 +621,7 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen
}
}
/**
* Exception type thrown when there is an error completing an auto ingest
* monitor operation.
@ -556,4 +652,4 @@ final class AutoIngestMonitor extends Observable implements PropertyChangeListen
}
}
}
}

View File

@ -227,7 +227,7 @@ AutoIngestDashboard.prioritizeJobButton.text=Prioritize &Job
AutoIngestDashboard.prioritizeCaseButton.toolTipText=Move all images associated with a case to top of Pending queue.
AutoIngestDashboard.prioritizeCaseButton.text=Prioritize &Case
AutoIngestMetricsDialog.reportTextArea.text=
AutoIngestDashboard.clusterMetricsButton.text=Auto Ingest Metrics
AutoIngestDashboard.clusterMetricsButton.text=Auto Ingest &Metrics
AutoIngestMetricsDialog.metricsButton.text=Generate Metrics Report
AutoIngestMetricsDialog.closeButton.text=Close
AutoIngestMetricsDialog.datePicker.toolTipText=Choose a date
@ -236,3 +236,36 @@ ArchiveFilePanel.browseButton.text=Browse
ArchiveFilePanel.pathTextField.text=
ArchiveFilePanel.errorLabel.text=Error Label
AutoIngestMetricsDialog.startingDataLabel.text=Starting Date:
AutoIngestDashboard.deprioritizeJobButton.toolTipText=Move the selected job to the top of the Pending queue.
AutoIngestDashboard.deprioritizeJobButton.text=Deprioritize J&ob
AutoIngestDashboard.deprioritizeCaseButton.text=Deprioritize C&ase
AutoIngestDashboard.deprioritizeCaseButton.toolTipText=Move all images associated with a case to top of Pending queue.
AutoIngestControlPanel.bnDeprioritizeCase.text=Deprioritize Case
AutoIngestControlPanel.bnDeprioritizeJob.text=Deprioritize Job
AutoIngestControlPanel.bnPrioritizeCase.text=Prioritize Case
AutoIngestControlPanel.bnPrioritizeJob.text=Prioritize Job
AutoIngestControlPanel.bnShowProgress.text=Ingest Progress
AutoIngestControlPanel.bnCancelJob.text=&Cancel Job
AutoIngestControlPanel.bnCancelModule.text=Cancel &Module
AutoIngestControlPanel.bnReprocessJob.text=Reprocess Job
AutoIngestControlPanel.bnDeleteCase.text=&Delete Case
AutoIngestControlPanel.bnShowCaseLog.text=Show Case &Log
AutoIngestControlPanel.bnPause.text=Pause
AutoIngestControlPanel.bnRefresh.text=&Refresh
AutoIngestControlPanel.bnOptions.text=&Options
AutoIngestControlPanel.bnOpenLogDir.text=Open System Logs Folder
AutoIngestControlPanel.bnClusterMetrics.text=Auto Ingest Metrics
AutoIngestControlPanel.bnExit.text=&Exit
AutoIngestControlPanel.lbStatus.text=Status:
AutoIngestControlPanel.lbServicesStatus.text=Services Status:
AutoIngestControlPanel.lbPending.text=Pending Jobs
AutoIngestControlPanel.lbRunning.text=Running Jobs
AutoIngestControlPanel.lbCompleted.text=Completed Jobs
AutoIngestControlPanel.tbStatusMessage.text=
AutoIngestControlPanel.tbServicesStatusMessage.text=
AutoIngestControlPanel.bnDeprioritizeJob.toolTipText=
AutoIngestControlPanel.bnDeprioritizeCase.toolTipText=
AutoIngestControlPanel.bnPrioritizeJob.toolTipText=Move this folder to the top of the Pending queue.
AutoIngestControlPanel.bnPrioritizeCase.toolTipText=Move all images associated with a case to top of Pending queue.
AutoIngestControlPanel.bnPrioritizeJob.actionCommand=Prioritize Job
AutoIngestControlPanel.bnDeprioritizeJob.actionCommand=Deprioritize Job

View File

@ -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");
@ -1422,7 +1422,7 @@ public final class FileExporterSettingsPanel extends JPanel {
}
populateRuleTree(ruleName);
} else {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(FileExporterSettingsPanel.class, "FileExporterSettingsPanel.RuleNotSaved"),
NbBundle.getMessage(FileExporterSettingsPanel.class, "FileExporterSettingsPanel.MalformedRule"),
JOptionPane.OK_OPTION);

View File

@ -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");
@ -226,7 +226,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
if (needsRestart) {
SwingUtilities.invokeLater(() -> {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(this,
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.MustRestart"),
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.restartRequiredLabel.text"),
JOptionPane.WARNING_MESSAGE);
@ -530,7 +530,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
add(ingestJobSettingsPanel, BorderLayout.PAGE_START);
if (JOptionPane.showConfirmDialog(null, ingestJobSettingsPanel, "Ingest Module Configuration", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) {
if (JOptionPane.showConfirmDialog(this, ingestJobSettingsPanel, "Ingest Module Configuration", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) {
// store the updated settings
ingestJobSettings = ingestJobSettingsPanel.getSettings();
ingestJobSettings.save();
@ -547,7 +547,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
for (String warning : warnings) {
warningMessage.append(warning).append("\n");
}
JOptionPane.showMessageDialog(null, warningMessage.toString());
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), warningMessage.toString());
}
}
@ -1082,7 +1082,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
private void bnAdvancedSettingsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bnAdvancedSettingsActionPerformed
AdvancedAutoIngestSettingsPanel advancedAutoIngestSettingsPanel = new AdvancedAutoIngestSettingsPanel(getModeFromRadioButtons());
if (JOptionPane.showConfirmDialog(null, advancedAutoIngestSettingsPanel,
if (JOptionPane.showConfirmDialog(this, advancedAutoIngestSettingsPanel,
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.AdvancedAutoIngestSettingsPanel.Title"),
JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE) == JOptionPane.OK_OPTION) {
advancedAutoIngestSettingsPanel.store();
@ -1175,7 +1175,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
if (uploadResult == SharedConfiguration.SharedConfigResult.LOCKED) {
jLabelTaskDescription.setText("Transfer of shared configuration incomplete");
JOptionPane.showMessageDialog(null, "Shared configuration folder is currently locked by another node - try again in a few minutes", "Error", JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), "Shared configuration folder is currently locked by another node - try again in a few minutes", "Error", JOptionPane.ERROR_MESSAGE);
} else if (errorMessage != null) {
//MessageNotifyUtil.Message.info(errorMessage);
jLabelTaskDescription.setText("Transfer of shared configuration incomplete");
@ -1186,7 +1186,7 @@ public class AutoIngestSettingsPanel extends javax.swing.JPanel {
// Check if anything requiring a reset has changed and update the UI
if (isResetNeeded()) {
JOptionPane.showMessageDialog(null,
JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(),
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.MustRestart"),
NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.restartRequiredLabel.text"),
JOptionPane.WARNING_MESSAGE);

View File

@ -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");
@ -19,7 +19,6 @@
package org.sleuthkit.autopsy.experimental.configuration;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
@ -57,15 +56,8 @@ public final class StartupWindow extends JDialog implements StartupWindowInterfa
* Shows the startup window.
*/
private void init() {
Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
// set the popUp window / JFrame
setSize(DIMENSIONS);
int w = getSize().width;
int h = getSize().height;
// set the location of the popUp Window on the center of the screen
setLocation((screenDimension.width - w) / 2, (screenDimension.height - h) / 2);
setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
addPanelForMode();

Some files were not shown because too many files have changed in this diff Show More