mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
keyword search ingest: more granular cancellation
This commit is contained in:
parent
7a581bf487
commit
3cc94caeca
@ -70,7 +70,6 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
private volatile int messageID = 0;
|
||||
private volatile boolean finalRun = false;
|
||||
private SleuthkitCase caseHandle = null;
|
||||
|
||||
// TODO: use a more robust method than checking file extension to determine
|
||||
// whether to try a file
|
||||
// supported extensions list from http://www.lucidimagination.com/devzone/technical-articles/content-extraction-tika
|
||||
@ -81,8 +80,7 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
|
||||
public enum IngestStatus {
|
||||
|
||||
INGESTED, EXTRACTED_INGESTED, SKIPPED,
|
||||
};
|
||||
INGESTED, EXTRACTED_INGESTED, SKIPPED,};
|
||||
private Map<Long, IngestStatus> ingestStatus;
|
||||
private Map<String, List<FsContent>> reportedHits; //already reported hits
|
||||
|
||||
@ -229,8 +227,9 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
public boolean hasBackgroundJobsRunning() {
|
||||
if (searcher != null && searcherDone == false) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
else return false;
|
||||
|
||||
//no need to check timer thread
|
||||
|
||||
@ -294,9 +293,10 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
keywords.clear();
|
||||
keywordLists.clear();
|
||||
|
||||
for(KeywordSearchList list : loader.getListsL()){
|
||||
if(list.getUseForIngest())
|
||||
for (KeywordSearchList list : loader.getListsL()) {
|
||||
if (list.getUseForIngest()) {
|
||||
keywordLists.add(list.getName());
|
||||
}
|
||||
keywords.addAll(list.getKeywords());
|
||||
}
|
||||
}
|
||||
@ -309,7 +309,7 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
|
||||
keywords.clear();
|
||||
|
||||
for(String name : keywordLists) {
|
||||
for (String name : keywordLists) {
|
||||
keywords.addAll(loader.getList(name).getKeywords());
|
||||
}
|
||||
}
|
||||
@ -319,9 +319,10 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
}
|
||||
|
||||
void addToKeywordLists(String name) {
|
||||
if(!keywordLists.contains(name))
|
||||
if (!keywordLists.contains(name)) {
|
||||
keywordLists.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
//CommitTimer wakes up every interval ms
|
||||
//and sets a flag for indexer to commit after indexing next file
|
||||
@ -510,6 +511,9 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
||||
//write results to BB
|
||||
Collection<BlackboardArtifact> newArtifacts = new ArrayList<BlackboardArtifact>(); //new artifacts to report
|
||||
for (FsContent hitFile : newResults) {
|
||||
if (this.isCancelled()) {
|
||||
return null;
|
||||
}
|
||||
Collection<KeywordWriteResult> written = del.writeToBlackBoard(hitFile);
|
||||
for (KeywordWriteResult res : written) {
|
||||
newArtifacts.add(res.getArtifact());
|
||||
|
Loading…
x
Reference in New Issue
Block a user