19package org.sleuthkit.autopsy.datamodel;
21import java.util.ArrayList;
22import java.util.Arrays;
23import java.util.Collection;
24import java.util.HashSet;
26import java.util.logging.Level;
27import javax.swing.Action;
28import org.openide.util.NbBundle;
29import org.openide.util.Utilities;
30import org.sleuthkit.autopsy.actions.AddContentTagAction;
31import org.sleuthkit.autopsy.actions.DeleteFileContentTagAction;
32import org.sleuthkit.autopsy.coreutils.ContextMenuExtensionPoint;
33import org.sleuthkit.autopsy.coreutils.Logger;
34import org.sleuthkit.autopsy.directorytree.ExportCSVAction;
35import org.sleuthkit.autopsy.directorytree.ExternalViewerAction;
36import org.sleuthkit.autopsy.directorytree.ExternalViewerShortcutAction;
37import org.sleuthkit.autopsy.directorytree.ExtractAction;
38import org.sleuthkit.autopsy.directorytree.NewWindowViewAction;
39import org.sleuthkit.autopsy.directorytree.ViewContextAction;
40import org.sleuthkit.autopsy.modules.embeddedfileextractor.ExtractArchiveWithPasswordAction;
41import org.sleuthkit.datamodel.AbstractFile;
42import org.sleuthkit.datamodel.BlackboardArtifact;
43import org.sleuthkit.datamodel.TskCoreException;
48public class LocalFileNode extends AbstractAbstractFileNode<AbstractFile> {
55 this.setDisplayName(af.getName());
59 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/Folder-icon.png");
61 this.setIconBaseWithExtension(
FileNode.getIconForFileType(af));
68 List<Action> actionsList =
new ArrayList<>();
70 actionsList.add(
new ViewContextAction(NbBundle.getMessage(
this.getClass(),
"LocalFileNode.viewFileInDir.text"),
this.content));
71 actionsList.add(
null);
73 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.getActions.viewInNewWin.text"),
this));
74 final Collection<AbstractFile> selectedFilesList
75 =
new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
76 if (selectedFilesList.size() == 1) {
78 NbBundle.getMessage(
this.getClass(),
"LocalFileNode.getActions.openInExtViewer.text"),
this));
82 actionsList.add(
null);
86 actionsList.add(
null);
89 if (selectedFilesList.size() == 1) {
96 if (this.
content.getArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED).size() > 0) {
99 }
catch (TskCoreException ex) {
100 logger.log(Level.WARNING,
"Unable to add unzip with password action to context menus", ex);
104 actionsList.add(
null);
105 actionsList.addAll(Arrays.asList(super.getActions(
true)));
107 return actionsList.toArray(
new Action[actionsList.size()]);
112 return visitor.
visit(
this);
116 public <T> T accept(DisplayableItemNodeVisitor<T> visitor) {
117 return visitor.visit(
this);
130 return getClass().getName();
static synchronized AddContentTagAction getInstance()
static synchronized DeleteFileContentTagAction getInstance()
synchronized static Logger getLogger(String name)
static List< String > getArchiveExtensions()
LocalFileNode(AbstractFile af)
static final Logger logger
Action[] getActions(boolean context)
static synchronized ExportCSVAction getInstance()
static synchronized ExternalViewerShortcutAction getInstance()