23 package org.sleuthkit.autopsy.recentactivity;
25 import java.util.ArrayList;
26 import java.util.List;
27 import java.util.logging.Level;
29 import org.openide.util.NbBundle;
31 import java.util.Collection;
50 class RecentDocumentsByLnk
extends Extract {
52 private static final Logger logger = Logger.getLogger(RecentDocumentsByLnk.class.getName());
53 private IngestServices services = IngestServices.getInstance();
55 private IngestJobContext context;
64 private void getRecentDocuments() {
67 List<AbstractFile> recentFiles;
69 recentFiles = fileManager.
findFiles(dataSource,
"%.lnk",
"Recent");
71 logger.log(Level.WARNING,
"Error searching for .lnk files.");
73 NbBundle.getMessage(
this.getClass(),
"RecentDocumentsByLnk.getRecDoc.errMsg.errGetLnkFiles",
78 if (recentFiles.isEmpty()) {
79 logger.log(Level.INFO,
"Didn't find any recent files.");
85 if (context.dataSourceIngestIsCancelled()) {
89 if (recentFile.getSize() == 0) {
95 lnk = lnkParser.parse();
96 }
catch (JLnkParserException e) {
100 if (unalloc ==
false) {
101 logger.log(Level.WARNING,
"Error lnk parsing the file to get recent files {0}", recentFile);
106 Collection<BlackboardAttribute> bbattributes =
new ArrayList<>();
107 String path = lnk.getBestPath();
109 NbBundle.getMessage(
this.getClass(),
110 "RecentDocumentsByLnk.parentModuleName.noSpace"),
113 NbBundle.getMessage(
this.getClass(),
114 "RecentDocumentsByLnk.parentModuleName.noSpace"),
115 Util.findID(dataSource, path)));
117 NbBundle.getMessage(
this.getClass(),
118 "RecentDocumentsByLnk.parentModuleName.noSpace"),
119 recentFile.getCrtime()));
120 this.addArtifact(ARTIFACT_TYPE.TSK_RECENT_OBJECT, recentFile, bbattributes);
122 services.fireModuleDataEvent(
new ModuleDataEvent(
123 NbBundle.getMessage(
this.getClass(),
"RecentDocumentsByLnk.parentModuleName"),
128 public void process(
Content dataSource, IngestJobContext context) {
129 this.dataSource = dataSource;
130 this.context = context;
132 this.getRecentDocuments();
synchronized List< AbstractFile > findFiles(String fileName)