19 package org.sleuthkit.autopsy.report;
21 import org.openide.util.NbBundle;
33 enum FileReportDataTypes {
35 NAME(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.filename.text")) {
37 public String getValue(AbstractFile file) {
38 return file.getName();
41 FILE_EXT(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.fileExt.text")) {
43 public String getValue(AbstractFile file) {
44 String name = file.getName();
45 int extIndex = name.lastIndexOf(
".");
46 return (extIndex == -1 ?
"" : name.substring(extIndex));
49 FILE_TYPE(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.fileType.text")) {
51 public String getValue(AbstractFile file) {
52 return file.getMetaTypeAsString();
55 DELETED(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.isDel.text")) {
57 public String getValue(AbstractFile file) {
58 if (file.getMetaFlagsAsString().equals(TskData.TSK_FS_META_FLAG_ENUM.UNALLOC.toString())) {
64 A_TIME(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.aTime.text")) {
66 public String getValue(AbstractFile file) {
67 return file.getAtimeAsDate();
70 CR_TIME(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.crTime.text")) {
72 public String getValue(AbstractFile file) {
73 return file.getCrtimeAsDate();
76 M_TIME(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.mTime.text")) {
78 public String getValue(AbstractFile file) {
79 return file.getMtimeAsDate();
82 SIZE(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.size.text")) {
84 public String getValue(AbstractFile file) {
85 return String.valueOf(file.getSize());
88 ADDRESS(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.address.text")) {
90 public String getValue(AbstractFile file) {
91 return String.valueOf(file.getMetaAddr());
94 HASH_VALUE(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.hash.text")) {
96 public String getValue(AbstractFile file) {
97 return file.getMd5Hash();
100 KNOWN_STATUS(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.knownStatus.text")) {
102 public String getValue(AbstractFile file) {
103 return file.getKnown().getName();
106 PERMISSIONS(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.perms.text")) {
108 public String getValue(AbstractFile file) {
109 return file.getModesAsString();
112 FULL_PATH(NbBundle.getMessage(FileReportText.class,
"FileReportDataTypes.path.text")) {
114 public String getValue(AbstractFile file) {
116 return file.getUniquePath();
117 }
catch (TskCoreException ex) {
125 FileReportDataTypes(String name) {
129 public String getName() {
138 public abstract String getValue(AbstractFile file);