19 package org.sleuthkit.autopsy.datamodel;
21 import java.sql.ResultSet;
22 import java.sql.SQLException;
23 import java.util.LinkedHashMap;
25 import java.util.logging.Level;
26 import org.openide.nodes.Sheet;
27 import org.openide.util.NbBundle;
54 if (ld.isDataSource()) {
55 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/fileset-icon-16.png");
57 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/folder-icon-virtual.png");
62 @NbBundle.Messages({
"VirtualDirectoryNode.createSheet.size.name=Size (Bytes)",
63 "VirtualDirectoryNode.createSheet.size.displayName=Size (Bytes)",
64 "VirtualDirectoryNode.createSheet.size.desc=Size of the data source in bytes.",
65 "VirtualDirectoryNode.createSheet.type.name=Type",
66 "VirtualDirectoryNode.createSheet.type.displayName=Type",
67 "VirtualDirectoryNode.createSheet.type.desc=Type of the image.",
68 "VirtualDirectoryNode.createSheet.type.text=Logical File Set",
69 "VirtualDirectoryNode.createSheet.timezone.name=Timezone",
70 "VirtualDirectoryNode.createSheet.timezone.displayName=Timezone",
71 "VirtualDirectoryNode.createSheet.timezone.desc=Timezone of the image",
72 "VirtualDirectoryNode.createSheet.deviceId.name=Device ID",
73 "VirtualDirectoryNode.createSheet.deviceId.displayName=Device ID",
74 "VirtualDirectoryNode.createSheet.deviceId.desc=Device ID of the image"})
77 if(this.content.isDataSource()){
78 Sheet sheet =
new Sheet();
79 Sheet.Set sheetSet = Sheet.createPropertiesSet();
82 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VirtualDirectoryNode.createSheet.name.name"),
83 NbBundle.getMessage(
this.getClass(),
84 "VirtualDirectoryNode.createSheet.name.displayName"),
85 NbBundle.getMessage(
this.getClass(),
"VirtualDirectoryNode.createSheet.name.desc"),
88 sheetSet.put(
new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_type_name(),
89 Bundle.VirtualDirectoryNode_createSheet_type_displayName(),
90 Bundle.VirtualDirectoryNode_createSheet_type_desc(),
91 Bundle.VirtualDirectoryNode_createSheet_type_text()));
92 sheetSet.put(
new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_size_name(),
93 Bundle.VirtualDirectoryNode_createSheet_size_displayName(),
94 Bundle.VirtualDirectoryNode_createSheet_size_desc(),
95 this.content.getSize()));
97 ResultSet timeZoneSet = query.getResultSet();
98 if (timeZoneSet.next()) {
99 sheetSet.put(
new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_timezone_name(),
100 Bundle.VirtualDirectoryNode_createSheet_timezone_displayName(),
101 Bundle.VirtualDirectoryNode_createSheet_timezone_desc(),
102 timeZoneSet.getString(
"time_zone")));
105 logger.log(Level.SEVERE,
"Failed to get time zone for the following image: " +
this.content.getId(), ex);
108 ResultSet deviceIdSet = query.getResultSet();
109 if (deviceIdSet.next()) {
110 sheetSet.put(
new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_deviceId_name(),
111 Bundle.VirtualDirectoryNode_createSheet_deviceId_displayName(),
112 Bundle.VirtualDirectoryNode_createSheet_deviceId_desc(),
113 deviceIdSet.getString(
"device_id")));
116 logger.log(Level.SEVERE,
"Failed to get device id for the following image: " +
this.content.getId(), ex);
122 return super.createSheet();
126 public <T> T accept(ContentNodeVisitor<T> visitor) {
127 return visitor.visit(
this);
131 public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
132 return visitor.visit(
this);
VirtualDirectoryNode(VirtualDirectory ld)
static final Logger logger
SleuthkitCase getSleuthkitCase()
synchronized static Logger getLogger(String name)
static Case getCurrentCaseThrows()
static final String LOGICAL_FILE_SET_PREFIX
static String nameForVirtualDirectory(VirtualDirectory ld)