19 package org.sleuthkit.autopsy.datamodel;
21 import java.sql.ResultSet;
22 import java.sql.SQLException;
23 import java.util.logging.Level;
24 import org.openide.nodes.Sheet;
25 import org.openide.util.NbBundle;
52 if (ld.isDataSource()) {
53 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/fileset-icon-16.png");
55 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/folder-icon-virtual.png");
60 @NbBundle.Messages({
"VirtualDirectoryNode.createSheet.size.name=Size (Bytes)",
61 "VirtualDirectoryNode.createSheet.size.displayName=Size (Bytes)",
62 "VirtualDirectoryNode.createSheet.size.desc=Size of the data source in bytes.",
63 "VirtualDirectoryNode.createSheet.type.name=Type",
64 "VirtualDirectoryNode.createSheet.type.displayName=Type",
65 "VirtualDirectoryNode.createSheet.type.desc=Type of the image.",
66 "VirtualDirectoryNode.createSheet.type.text=Logical File Set",
67 "VirtualDirectoryNode.createSheet.timezone.name=Timezone",
68 "VirtualDirectoryNode.createSheet.timezone.displayName=Timezone",
69 "VirtualDirectoryNode.createSheet.timezone.desc=Timezone of the image",
70 "VirtualDirectoryNode.createSheet.deviceId.name=Device ID",
71 "VirtualDirectoryNode.createSheet.deviceId.displayName=Device ID",
72 "VirtualDirectoryNode.createSheet.deviceId.desc=Device ID of the image"})
75 if(this.content.isDataSource()){
76 Sheet sheet =
new Sheet();
77 Sheet.Set sheetSet = Sheet.createPropertiesSet();
80 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VirtualDirectoryNode.createSheet.name.name"),
81 NbBundle.getMessage(
this.getClass(),
82 "VirtualDirectoryNode.createSheet.name.displayName"),
83 NbBundle.getMessage(
this.getClass(),
"VirtualDirectoryNode.createSheet.name.desc"),
86 sheetSet.put(
new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_type_name(),
87 Bundle.VirtualDirectoryNode_createSheet_type_displayName(),
88 Bundle.VirtualDirectoryNode_createSheet_type_desc(),
89 Bundle.VirtualDirectoryNode_createSheet_type_text()));
90 sheetSet.put(
new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_size_name(),
91 Bundle.VirtualDirectoryNode_createSheet_size_displayName(),
92 Bundle.VirtualDirectoryNode_createSheet_size_desc(),
93 this.content.getSize()));
95 ResultSet timeZoneSet = query.getResultSet();
96 if (timeZoneSet.next()) {
97 sheetSet.put(
new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_timezone_name(),
98 Bundle.VirtualDirectoryNode_createSheet_timezone_displayName(),
99 Bundle.VirtualDirectoryNode_createSheet_timezone_desc(),
100 timeZoneSet.getString(
"time_zone")));
103 logger.log(Level.SEVERE,
"Failed to get time zone for the following image: " +
this.content.getId(), ex);
106 ResultSet deviceIdSet = query.getResultSet();
107 if (deviceIdSet.next()) {
108 sheetSet.put(
new NodeProperty<>(Bundle.VirtualDirectoryNode_createSheet_deviceId_name(),
109 Bundle.VirtualDirectoryNode_createSheet_deviceId_displayName(),
110 Bundle.VirtualDirectoryNode_createSheet_deviceId_desc(),
111 deviceIdSet.getString(
"device_id")));
114 logger.log(Level.SEVERE,
"Failed to get device id for the following image: " +
this.content.getId(), ex);
120 Sheet defaultSheet = super.createSheet();
121 Sheet.Set defaultSheetSet = defaultSheet.get(Sheet.PROPERTIES);
125 String locationCol = NbBundle.getMessage(
AbstractAbstractFileNode.class,
"AbstractAbstractFileNode.locationColLbl");
126 for (Property<?> p : defaultSheetSet.getProperties()) {
127 if(locationCol.equals(p.getName())) {
128 defaultSheetSet.remove(p.getName());
136 public <T> T accept(ContentNodeVisitor<T> visitor) {
137 return visitor.visit(
this);
141 public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
142 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)