19 package org.sleuthkit.autopsy.datamodel;
21 import java.util.ArrayList;
22 import java.util.Arrays;
23 import java.util.Collection;
24 import java.util.HashSet;
25 import java.util.LinkedHashMap;
26 import java.util.List;
28 import java.util.logging.Level;
29 import javax.swing.Action;
30 import org.openide.nodes.Sheet;
31 import org.openide.util.NbBundle;
32 import org.openide.util.Utilities;
60 this.setDisplayName(af.getName());
64 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/Folder-icon.png");
66 this.setIconBaseWithExtension(
FileNode.getIconForFileType(af));
73 Sheet sheet = super.createSheet();
74 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
75 if (sheetSet == null) {
76 sheetSet = Sheet.createPropertiesSet();
80 Map<String, Object> map =
new LinkedHashMap<>();
83 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"LocalFileNode.createSheet.name.name"),
84 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.createSheet.name.displayName"),
85 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.createSheet.name.desc"),
99 final String
NO_DESCR = NbBundle.getMessage(this.getClass(),
"LocalFileNode.createSheet.noDescr.text");
100 for (Map.Entry<String, Object> entry : map.entrySet()) {
109 List<Action> actionsList =
new ArrayList<>();
110 actionsList.addAll(Arrays.asList(super.getActions(
true)));
112 actionsList.add(
new ViewContextAction(NbBundle.getMessage(
this.getClass(),
"LocalFileNode.viewFileInDir.text"), this.content));
113 actionsList.add(null);
115 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.getActions.viewInNewWin.text"),
this));
117 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.getActions.openInExtViewer.text"),
this));
118 actionsList.add(null);
121 actionsList.add(null);
124 final Collection<AbstractFile> selectedFilesList
125 =
new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
126 if (selectedFilesList.size() == 1) {
133 if (this.content.getArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED).size() > 0) {
136 }
catch (TskCoreException ex) {
137 logger.log(Level.WARNING,
"Unable to add unzip with password action to context menus", ex);
140 return actionsList.toArray(
new Action[actionsList.size()]);
144 public <T> T accept(ContentNodeVisitor<T> visitor) {
145 return visitor.visit(
this);
149 public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
150 return visitor.visit(
this);
163 return getClass().getName();
final void addScoreProperty(Sheet.Set sheetSet, List< ContentTag > tags)
static List< String > getArchiveExtensions()
final CorrelationAttributeInstance getCorrelationAttributeInstance()
static boolean useCentralRepo()
LocalFileNode(AbstractFile af)
static void fillPropertyMap(Map< String, Object > map, AbstractFile content)
Action[] getActions(boolean context)
static synchronized DeleteFileContentTagAction getInstance()
static final Logger logger
static final String NO_DESCR
final void addCountProperty(Sheet.Set sheetSet, CorrelationAttributeInstance attribute)
final void addCommentProperty(Sheet.Set sheetSet, List< ContentTag > tags, CorrelationAttributeInstance attribute)
synchronized static Logger getLogger(String name)
static boolean hideCentralRepoCommentsAndOccurrences()
final List< ContentTag > getContentTagsFromDatabase()
static synchronized AddContentTagAction getInstance()