23 package org.sleuthkit.autopsy.recentactivity;
26 import java.util.ArrayList;
27 import java.util.List;
28 import java.util.logging.Level;
29 import org.openide.util.NbBundle;
47 private final List<Extract>
extracters =
new ArrayList<>();
60 Extract registry =
new ExtractRegistry();
61 Extract iexplore =
new ExtractIE();
62 Extract recentDocuments =
new RecentDocumentsByLnk();
63 Extract chrome =
new Chrome();
64 Extract firefox =
new Firefox();
65 Extract SEUQA =
new SearchEngineURLQueryAnalyzer();
67 extracters.add(chrome);
68 extracters.add(firefox);
69 extracters.add(iexplore);
70 extracters.add(recentDocuments);
71 extracters.add(SEUQA);
72 extracters.add(registry);
74 browserExtracters.add(chrome);
75 browserExtracters.add(firefox);
76 browserExtracters.add(iexplore);
78 for (Extract extracter : extracters) {
86 NbBundle.getMessage(this.getClass(),
87 "RAImageIngestModule.process.started",
88 dataSource.getName())));
92 ArrayList<String> errors =
new ArrayList<>();
94 for (
int i = 0; i < extracters.size(); i++) {
95 Extract extracter = extracters.get(i);
97 logger.log(Level.INFO,
"Recent Activity has been canceled, quitting before {0}", extracter.getName());
101 progressBar.
progress(extracter.getName(), i);
104 extracter.process(dataSource, context);
105 }
catch (Exception ex) {
106 logger.log(Level.SEVERE,
"Exception occurred in " + extracter.getName(), ex);
107 subCompleted.append(NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.errModFailed",
108 extracter.getName()));
113 errors.addAll(extracter.getErrorMessages());
117 StringBuilder errorMessage =
new StringBuilder();
118 String errorMsgSubject;
120 if (errors.isEmpty() ==
false) {
123 NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.errMsg.errsEncountered"));
124 for (String msg : errors) {
125 errorMessage.append(
"<li>").append(msg).append(
"</li>\n");
127 errorMessage.append(
"</ul>\n");
129 if (errors.size() == 1) {
130 errorMsgSubject = NbBundle.getMessage(this.getClass(),
"RAImageIngestModule.process.errMsgSub.oneErr");
132 errorMsgSubject = NbBundle.getMessage(this.getClass(),
133 "RAImageIngestModule.process.errMsgSub.nErrs", errors.size());
136 errorMessage.append(NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.errMsg.noErrs"));
137 errorMsgSubject = NbBundle.getMessage(this.getClass(),
"RAImageIngestModule.process.errMsgSub.noErrs");
140 NbBundle.getMessage(this.getClass(),
141 "RAImageIngestModule.process.ingestMsg.finished",
142 dataSource.getName(), errorMsgSubject),
143 errorMessage.toString());
146 StringBuilder historyMsg =
new StringBuilder();
148 NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.process.histMsg.title", dataSource.getName()));
149 for (Extract module : browserExtracters) {
150 historyMsg.append(
"<li>").append(module.getName());
151 historyMsg.append(
": ").append((module.foundData()) ? NbBundle
152 .getMessage(this.getClass(),
"RAImageIngestModule.process.histMsg.found") : NbBundle
153 .getMessage(this.getClass(),
"RAImageIngestModule.process.histMsg.notFnd"));
154 historyMsg.append(
"</li>");
156 historyMsg.append(
"</ul>");
158 NbBundle.getMessage(this.getClass(),
159 "RAImageIngestModule.process.ingestMsg.results",
160 dataSource.getName()),
161 historyMsg.toString());
168 for (
int i = 0; i < extracters.size(); i++) {
169 Extract extracter = extracters.get(i);
171 extracter.complete();
172 }
catch (Exception ex) {
173 logger.log(Level.SEVERE,
"Exception occurred when completing " + extracter.getName(), ex);
174 subCompleted.append(NbBundle.getMessage(
this.getClass(),
"RAImageIngestModule.complete.errMsg.failed",
175 extracter.getName()));
193 String tmpDir = a_case.
getTempDirectory() + File.separator +
"RecentActivity" + File.separator + mod;
194 File dir =
new File(tmpDir);
195 if (dir.exists() ==
false) {
212 String tmpDir = a_case.
getModuleDirectory() + File.separator +
"RecentActivity" + File.separator + mod;
213 File dir =
new File(tmpDir);
214 if (dir.exists() ==
false) {
final List< Extract > browserExtracters
static final Logger logger
String getTempDirectory()
final List< Extract > extracters
static String getRATempPath(Case a_case, String mod)
StringBuilder subCompleted
static IngestMessage createMessage(MessageType messageType, String source, String subject, String detailsHtml)
ProcessResult process(Content dataSource, DataSourceIngestModuleProgress progressBar)
static String getRAOutputPath(Case a_case, String mod)
void postMessage(final IngestMessage message)
String getModuleDirectory()
void startUp(IngestJobContext context)
boolean dataSourceIngestIsCancelled()
void switchToDeterminate(int workUnits)
synchronized static Logger getLogger(String name)
void progress(int workUnits)
static synchronized IngestServices getInstance()