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;
57 this.setDisplayName(af.getName());
61 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/Folder-icon.png");
63 this.setIconBaseWithExtension(
FileNode.getIconForFileType(af));
70 Sheet sheet = super.createSheet();
71 Sheet.Set sheetSet = sheet.get(Sheet.PROPERTIES);
72 if (sheetSet == null) {
73 sheetSet = Sheet.createPropertiesSet();
77 Map<String, Object> map =
new LinkedHashMap<>();
80 sheetSet.put(
new NodeProperty<>(NbBundle.getMessage(
this.getClass(),
"LocalFileNode.createSheet.name.name"),
81 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.createSheet.name.displayName"),
82 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.createSheet.name.desc"),
85 final String
NO_DESCR = NbBundle.getMessage(this.getClass(),
"LocalFileNode.createSheet.noDescr.text");
86 for (Map.Entry<String, Object> entry : map.entrySet()) {
98 List<Action> actionsList =
new ArrayList<>();
99 actionsList.addAll(Arrays.asList(super.getActions(
true)));
101 actionsList.add(
new ViewContextAction(NbBundle.getMessage(
this.getClass(),
"LocalFileNode.viewFileInDir.text"), this.content));
102 actionsList.add(null);
104 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.getActions.viewInNewWin.text"),
this));
106 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.getActions.openInExtViewer.text"),
this));
107 actionsList.add(null);
111 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.getActions.searchFilesSameMd5.text"),
this));
112 actionsList.add(null);
115 final Collection<AbstractFile> selectedFilesList
116 =
new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
117 if (selectedFilesList.size() == 1) {
124 if (this.content.getArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED).size() > 0) {
127 }
catch (TskCoreException ex) {
128 logger.log(Level.WARNING,
"Unable to add unzip with password action to context menus", ex);
131 return actionsList.toArray(
new Action[0]);
135 public <T> T accept(ContentNodeVisitor<T> visitor) {
136 return visitor.visit(
this);
140 public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
141 return visitor.visit(
this);
154 return getClass().getName();
static List< String > getArchiveExtensions()
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
synchronized static Logger getLogger(String name)
void addTagProperty(Sheet.Set sheetSet)
static synchronized AddContentTagAction getInstance()