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.autopsy.timeline.actions.ViewFileInTimelineAction;
42import org.sleuthkit.datamodel.AbstractFile;
43import org.sleuthkit.datamodel.BlackboardArtifact;
44import org.sleuthkit.datamodel.LayoutFile;
45import org.sleuthkit.datamodel.TskCoreException;
46import org.sleuthkit.datamodel.TskData;
60 public String toString() {
61 return NbBundle.getMessage(this.getClass(),
"LayoutFileNode.propertyType.parts");
75 if (lf.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.CARVED)) {
76 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/carved-file-x-icon-16.png");
77 }
else if (lf.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.LAYOUT_FILE)) {
78 if (lf.isDirNameFlagSet(TskData.TSK_FS_NAME_FLAG_ENUM.UNALLOC)) {
79 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/file-icon-deleted.png");
81 this.setIconBaseWithExtension(
FileNode.getIconForFileType(lf));
84 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/file-icon-deleted.png");
89 return visitor.
visit(
this);
99 return visitor.
visit(
this);
104 "LayoutFileNode.getActions.viewFileInDir.text=View File in Directory"})
106 List<Action> actionsList =
new ArrayList<>();
107 actionsList.add(
new ViewContextAction(Bundle.LayoutFileNode_getActions_viewFileInDir_text(),
this));
108 actionsList.add(
null);
111 NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.getActions.viewInNewWin.text"),
this));
112 final Collection<AbstractFile> selectedFilesList
113 =
new HashSet<>(Utilities.actionsGlobalContext().lookupAll(AbstractFile.class));
114 if (selectedFilesList.size() == 1) {
116 NbBundle.getMessage(
this.getClass(),
"LayoutFileNode.getActions.openInExtViewer.text"),
this));
121 actionsList.add(
null);
124 actionsList.add(
null);
127 if (selectedFilesList.size() == 1) {
134 if (this.
content.getArtifacts(BlackboardArtifact.ARTIFACT_TYPE.TSK_ENCRYPTION_DETECTED).size() > 0) {
137 }
catch (TskCoreException ex) {
138 logger.log(Level.WARNING,
"Unable to add unzip with password action to context menus", ex);
141 actionsList.add(
null);
142 actionsList.addAll(Arrays.asList(super.getActions(
true)));
143 return actionsList.toArray(
new Action[actionsList.size()]);
148 return getClass().getName();
static synchronized AddContentTagAction getInstance()
static synchronized DeleteFileContentTagAction getInstance()
synchronized static Logger getLogger(String name)
static List< String > getArchiveExtensions()
static String nameForLayoutFile(LayoutFile lf)
Action[] getActions(boolean context)
LayoutFileNode(LayoutFile lf)
static final Logger logger
static synchronized ExportCSVAction getInstance()
static synchronized ExternalViewerShortcutAction getInstance()
static ViewFileInTimelineAction createViewFileAction(AbstractFile file)
T visit(DataSourceFilesNode in)