mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 11:07:43 +00:00
Merge pull request #4452 from APriestman/4428_showAcquisitionDetails
4428 show acquisition details
This commit is contained in:
commit
01c6dc45d8
@ -19,13 +19,17 @@
|
|||||||
package org.sleuthkit.autopsy.contentviewers;
|
package org.sleuthkit.autopsy.contentviewers;
|
||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.openide.nodes.Node;
|
import org.openide.nodes.Node;
|
||||||
import org.openide.util.NbBundle;
|
import org.openide.util.NbBundle;
|
||||||
import org.openide.util.NbBundle.Messages;
|
import org.openide.util.NbBundle.Messages;
|
||||||
import org.openide.util.lookup.ServiceProvider;
|
import org.openide.util.lookup.ServiceProvider;
|
||||||
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
|
import org.sleuthkit.autopsy.corecomponentinterfaces.DataContentViewer;
|
||||||
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
import org.sleuthkit.autopsy.datamodel.ContentUtils;
|
||||||
|
import org.sleuthkit.autopsy.coreutils.Logger;
|
||||||
import org.sleuthkit.datamodel.AbstractFile;
|
import org.sleuthkit.datamodel.AbstractFile;
|
||||||
|
import org.sleuthkit.datamodel.DataSource;
|
||||||
import org.sleuthkit.datamodel.Image;
|
import org.sleuthkit.datamodel.Image;
|
||||||
import org.sleuthkit.datamodel.FsContent;
|
import org.sleuthkit.datamodel.FsContent;
|
||||||
import org.sleuthkit.datamodel.TskCoreException;
|
import org.sleuthkit.datamodel.TskCoreException;
|
||||||
@ -40,6 +44,8 @@ import org.sleuthkit.datamodel.TskData.TSK_DB_FILES_TYPE_ENUM;
|
|||||||
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
|
@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
|
||||||
public class Metadata extends javax.swing.JPanel implements DataContentViewer {
|
public class Metadata extends javax.swing.JPanel implements DataContentViewer {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = Logger.getLogger(Metadata.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form Metadata
|
* Creates new form Metadata
|
||||||
*/
|
*/
|
||||||
@ -130,11 +136,14 @@ public class Metadata extends javax.swing.JPanel implements DataContentViewer {
|
|||||||
"Metadata.tableRowTitle.imageType=Type",
|
"Metadata.tableRowTitle.imageType=Type",
|
||||||
"Metadata.tableRowTitle.sectorSize=Sector Size",
|
"Metadata.tableRowTitle.sectorSize=Sector Size",
|
||||||
"Metadata.tableRowTitle.timezone=Time Zone",
|
"Metadata.tableRowTitle.timezone=Time Zone",
|
||||||
"Metadata.tableRowTitle.deviceId=Device ID"})
|
"Metadata.tableRowTitle.deviceId=Device ID",
|
||||||
|
"Metadata.tableRowTitle.acquisitionDetails=Acquisition Details",
|
||||||
|
"Metadata.nodeText.unknown=Unknown"})
|
||||||
@Override
|
@Override
|
||||||
public void setNode(Node node) {
|
public void setNode(Node node) {
|
||||||
AbstractFile file = node.getLookup().lookup(AbstractFile.class);
|
AbstractFile file = node.getLookup().lookup(AbstractFile.class);
|
||||||
Image image = node.getLookup().lookup((Image.class));
|
Image image = node.getLookup().lookup(Image.class);
|
||||||
|
DataSource dataSource = node.getLookup().lookup(DataSource.class);
|
||||||
if (file == null && image == null) {
|
if (file == null && image == null) {
|
||||||
setText(NbBundle.getMessage(this.getClass(), "Metadata.nodeText.nonFilePassedIn"));
|
setText(NbBundle.getMessage(this.getClass(), "Metadata.nodeText.nonFilePassedIn"));
|
||||||
return;
|
return;
|
||||||
@ -167,6 +176,7 @@ public class Metadata extends javax.swing.JPanel implements DataContentViewer {
|
|||||||
}
|
}
|
||||||
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.md5"), md5);
|
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.md5"), md5);
|
||||||
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.hashLookupResults"), file.getKnown().toString());
|
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.hashLookupResults"), file.getKnown().toString());
|
||||||
|
addAcquisitionDetails(sb, dataSource);
|
||||||
|
|
||||||
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.internalid"), Long.toString(file.getId()));
|
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.internalid"), Long.toString(file.getId()));
|
||||||
if (file.getType().compareTo(TSK_DB_FILES_TYPE_ENUM.LOCAL) == 0) {
|
if (file.getType().compareTo(TSK_DB_FILES_TYPE_ENUM.LOCAL) == 0) {
|
||||||
@ -235,6 +245,7 @@ public class Metadata extends javax.swing.JPanel implements DataContentViewer {
|
|||||||
}
|
}
|
||||||
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.sectorSize"), Long.toString(image.getSsize()));
|
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.sectorSize"), Long.toString(image.getSsize()));
|
||||||
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.timezone"), image.getTimeZone());
|
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.timezone"), image.getTimeZone());
|
||||||
|
addAcquisitionDetails(sb, dataSource);
|
||||||
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.deviceId"), image.getDeviceId());
|
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.deviceId"), image.getDeviceId());
|
||||||
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.internalid"), Long.toString(image.getId()));
|
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.internalid"), Long.toString(image.getId()));
|
||||||
|
|
||||||
@ -256,6 +267,27 @@ public class Metadata extends javax.swing.JPanel implements DataContentViewer {
|
|||||||
this.setCursor(null);
|
this.setCursor(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add the acquisition details to the results (if applicable)
|
||||||
|
*
|
||||||
|
* @param sb The output StringBuilder object
|
||||||
|
* @param dataSource The data source (may be null)
|
||||||
|
*/
|
||||||
|
private void addAcquisitionDetails(StringBuilder sb, DataSource dataSource) {
|
||||||
|
if (dataSource != null) {
|
||||||
|
try {
|
||||||
|
String details = dataSource.getAcquisitionDetails();
|
||||||
|
if (StringUtils.isEmpty(details)) {
|
||||||
|
details = Bundle.Metadata_nodeText_unknown();
|
||||||
|
}
|
||||||
|
details = details.replaceAll("\n", "<br>");
|
||||||
|
addRow(sb, NbBundle.getMessage(this.getClass(), "Metadata.tableRowTitle.acquisitionDetails"), details);
|
||||||
|
} catch (TskCoreException ex) {
|
||||||
|
LOGGER.log(Level.SEVERE, "Error reading acquisition details from case database", ex); //NON-NLS
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return NbBundle.getMessage(this.getClass(), "Metadata.title");
|
return NbBundle.getMessage(this.getClass(), "Metadata.title");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user