19 package org.sleuthkit.autopsy.datamodel;
21 import java.util.ArrayList;
22 import java.util.List;
23 import javax.swing.Action;
25 import org.openide.util.NbBundle;
53 super(file, directoryBrowseMode);
62 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/carved-file-icon-16.png");
64 this.setIconBaseWithExtension(
"org/sleuthkit/autopsy/images/file-icon-deleted.png");
67 this.setIconBaseWithExtension(getIconForFileType(file));
79 List<Action> actionsList =
new ArrayList<>();
81 actionsList.add(
new ViewContextAction(NbBundle.getMessage(
this.getClass(),
"FileNode.viewFileInDir.text"),
this));
82 actionsList.add(null);
85 NbBundle.getMessage(
this.getClass(),
"FileNode.getActions.viewInNewWin.text"),
this));
87 NbBundle.getMessage(
this.getClass(),
"FileNode.getActions.openInExtViewer.text"),
this));
88 actionsList.add(null);
91 NbBundle.getMessage(
this.getClass(),
"FileNode.getActions.searchFilesSameMD5.text"),
this));
92 actionsList.add(null);
95 return actionsList.toArray(
new Action[0]);
99 public <T> T accept(ContentNodeVisitor< T> v) {
100 return v.visit(
this);
104 public <T> T accept(DisplayableItemNodeVisitor< T> v) {
105 return v.visit(
this);
110 static String getIconForFileType(AbstractFile file) {
112 String name = file.getName();
113 int dotIndex = name.lastIndexOf(
".");
114 if (dotIndex == -1) {
115 return "org/sleuthkit/autopsy/images/file-icon.png";
117 String ext = name.substring(dotIndex).toLowerCase();
120 for (String s : FileTypeExtensions.getImageExtensions()) {
122 return "org/sleuthkit/autopsy/images/image-file.png";
126 for (String s : FileTypeExtensions.getVideoExtensions()) {
128 return "org/sleuthkit/autopsy/images/video-file.png";
132 for (String s : FileTypeExtensions.getAudioExtensions()) {
134 return "org/sleuthkit/autopsy/images/audio-file.png";
138 for (String s : FileTypeExtensions.getDocumentExtensions()) {
140 return "org/sleuthkit/autopsy/images/doc-file.png";
144 for (String s : FileTypeExtensions.getExecutableExtensions()) {
146 return "org/sleuthkit/autopsy/images/exe-file.png";
150 for (String s : FileTypeExtensions.getTextExtensions()) {
152 return "org/sleuthkit/autopsy/images/text-file.png";
156 for (String s : FileTypeExtensions.getWebExtensions()) {
158 return "org/sleuthkit/autopsy/images/web-file.png";
162 for (String s : FileTypeExtensions.getPDFExtensions()) {
164 return "org/sleuthkit/autopsy/images/pdf-file.png";
168 for (String s : FileTypeExtensions.getArchiveExtensions()) {
170 return "org/sleuthkit/autopsy/images/archive-file.png";
174 return "org/sleuthkit/autopsy/images/file-icon.png";
boolean isDirNameFlagSet(TSK_FS_NAME_FLAG_ENUM flag)
Action[] getActions(boolean popup)
TskData.TSK_DB_FILES_TYPE_ENUM getType()
boolean directoryBrowseMode
void setIcon(AbstractFile file)
FileNode(AbstractFile file, boolean directoryBrowseMode)
FileNode(AbstractFile file)
static synchronized AddContentTagAction getInstance()
boolean getDirectoryBrowseMode()