19 package org.sleuthkit.autopsy.datamodel;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import java.util.ArrayList;
24 import java.util.EnumSet;
25 import java.util.List;
27 import java.util.logging.Level;
28 import javax.swing.Action;
29 import org.apache.commons.lang3.tuple.Pair;
30 import org.openide.nodes.Sheet;
31 import org.openide.util.NbBundle;
66 static String nameForVolume(Volume vol) {
67 return "vol" + Long.toString(vol.getAddr());
78 String volName = nameForVolume(vol);
80 long end = vol.getStart() + (vol.getLength() - 1);
81 String tempVolName = volName +
" (" + vol.getDescription() +
": " + vol.getStart() +
"-" + end +
")";
82 this.setDisplayName(tempVolName);
84 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/vol-icon.png");
100 private final PropertyChangeListener
pcl = (PropertyChangeEvent evt) -> {
101 String eventType = evt.getPropertyName();
109 if ((moduleContentEvent.getSource() instanceof Content) ==
false) {
112 Content newContent = (Content) moduleContentEvent.getSource();
115 Content parent = newContent.getParent();
116 if (parent != null) {
118 if (parent.getName().equals(VirtualDirectory.NAME_CARVED)) {
120 if (newContent.getDataSource().getId() ==
getContent().getDataSource().getId()) {
123 while ((parent = parent.getParent()) != null) {
132 }
catch (TskCoreException ex) {
135 logger.log(Level.WARNING, eventType, ex);
138 if (evt.getNewValue() == null) {
154 List<Action> actionsList =
new ArrayList<>();
156 for (Action a : super.getActions(
true)) {
161 NbBundle.getMessage(
this.getClass(),
"VolumeNode.getActions.viewInNewWin.text"),
this));
164 return actionsList.toArray(
new Action[actionsList.size()]);
169 Sheet sheet = super.createSheet();
170 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
171 if (sheetSet == null) {
172 sheetSet = Sheet.createPropertiesSet();
176 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.name"),
177 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.displayName"),
178 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.name.desc"),
179 this.getDisplayName()));
180 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.name"),
181 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.displayName"),
182 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.id.desc"),
184 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.name"),
185 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.displayName"),
186 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.startSector.desc"),
187 content.getStart()));
188 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.name"),
189 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.displayName"),
190 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.lenSectors.desc"),
191 content.getLength()));
192 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.name"),
193 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.displayName"),
194 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.description.desc"),
195 content.getDescription()));
196 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.name"),
197 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.displayName"),
198 NbBundle.getMessage(
this.getClass(),
"VolumeNode.createSheet.flags.desc"),
199 content.getFlagsAsString()));
205 public <T> T accept(ContentNodeVisitor<T> visitor) {
206 return visitor.visit(
this);
216 return visitor.
visit(
this);
233 return new ArrayList<>();
void removeIngestModuleEventListener(final PropertyChangeListener listener)
Pair< Long, String > getCountPropertyAndDescription(CorrelationAttributeInstance.Type attributeType, String attributeValue, String defaultDescription)
static synchronized IngestManager getInstance()
Action[] getActions(boolean popup)
static final Set< IngestManager.IngestModuleEvent > INGEST_MODULE_EVENTS_OF_INTEREST
Pair< DataResultViewerTable.Score, String > getScorePropertyAndDescription(List< Tag > tags)
static List< Action > getActions(Content c)
static final Logger logger
DataResultViewerTable.HasCommentStatus getCommentProperty(List< Tag > tags, CorrelationAttributeInstance attribute)
T visit(DataSourcesNode in)
CorrelationAttributeInstance getCorrelationAttributeInstance()
List< Tag > getAllTagsFromDatabase()
final PropertyChangeListener pcl
static void post(String nodeName, Object event)
void addIngestModuleEventListener(final PropertyChangeListener listener)
synchronized static Logger getLogger(String name)
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
static void removeEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
static final String NO_DESCR