mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-14 17:06:16 +00:00
Merge branch 'develop' of https://github.com/sleuthkit/autopsy into 7634-DataSourceSummaryDialogEDTQueries
This commit is contained in:
commit
f7daee52b7
@ -147,6 +147,9 @@ public class AnalysisResultsContentPanel extends javax.swing.JPanel {
|
||||
Optional<AnalysisResult> selectedResult = nodeResults.getSelectedResult();
|
||||
if (selectedResult.isPresent()) {
|
||||
textPanel.scrollToReference(getAnchor(selectedResult.get()));
|
||||
} else {
|
||||
// otherwise, scroll to the beginning.
|
||||
textPanel.setCaretPosition(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -349,11 +349,7 @@ public abstract class AbstractContentNode<T extends Content> extends ContentNode
|
||||
protected Pair<Score, String> getScorePropertyAndDescription(List<Tag> tags) {
|
||||
Score score = Score.SCORE_UNKNOWN;
|
||||
try {
|
||||
if (content instanceof AnalysisResult) {
|
||||
score = ((AnalysisResult) content).getScore();
|
||||
} else {
|
||||
score = this.content.getAggregateScore();
|
||||
}
|
||||
score = this.content.getAggregateScore();
|
||||
} catch (TskCoreException ex) {
|
||||
logger.log(Level.WARNING, "Unable to get aggregate score for content with id: " + this.content.getId(), ex);
|
||||
}
|
||||
|
@ -1123,7 +1123,6 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
|
||||
|
||||
private final List<AutoIngestJob> newPendingJobsList = new ArrayList<>();
|
||||
private final List<AutoIngestJob> newCompletedJobsList = new ArrayList<>();
|
||||
private Lock currentDirLock;
|
||||
|
||||
/**
|
||||
* Searches the input directories for manifest files. The search results
|
||||
@ -1131,27 +1130,29 @@ final class AutoIngestManager extends Observable implements PropertyChangeListen
|
||||
* list.
|
||||
*/
|
||||
private void scan() {
|
||||
synchronized (jobsLock) {
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
newPendingJobsList.clear();
|
||||
newCompletedJobsList.clear();
|
||||
Files.walkFileTree(rootInputDirectory, EnumSet.of(FOLLOW_LINKS), Integer.MAX_VALUE, this);
|
||||
Collections.sort(newPendingJobsList);
|
||||
|
||||
if (Thread.currentThread().isInterrupted()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
newPendingJobsList.clear();
|
||||
newCompletedJobsList.clear();
|
||||
Files.walkFileTree(rootInputDirectory, EnumSet.of(FOLLOW_LINKS), Integer.MAX_VALUE, this);
|
||||
Collections.sort(newPendingJobsList);
|
||||
synchronized (jobsLock) {
|
||||
AutoIngestManager.this.pendingJobs = newPendingJobsList;
|
||||
AutoIngestManager.this.completedJobs = newCompletedJobsList;
|
||||
|
||||
} catch (Exception ex) {
|
||||
/*
|
||||
* NOTE: Need to catch all unhandled exceptions here.
|
||||
* Otherwise uncaught exceptions will propagate up to the
|
||||
* calling thread and may stop it from running.
|
||||
*/
|
||||
sysLogger.log(Level.SEVERE, String.format("Error scanning the input directory %s", rootInputDirectory), ex);
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
/*
|
||||
* NOTE: Need to catch all unhandled exceptions here. Otherwise
|
||||
* uncaught exceptions will propagate up to the calling thread
|
||||
* and may stop it from running.
|
||||
*/
|
||||
sysLogger.log(Level.SEVERE, String.format("Error scanning the input directory %s", rootInputDirectory), ex);
|
||||
}
|
||||
|
||||
synchronized (scanMonitor) {
|
||||
scanMonitor.notify();
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ KeywordSearchResultFactory.createNodeForKey.noResultsFound.text=No results found
|
||||
KeywordSearchResultFactory.query.exception.msg=Could not perform the query
|
||||
OpenIDE-Module-Display-Category=Ingest Module
|
||||
|
||||
OpenIDE-Module-Long-Description=Keyword Search ingest module.\n\nThe module indexes files found in the disk image at ingest time.\nIt then periodically runs the search on the indexed files using one or more keyword lists (containing pure words and/or regular expressions) and posts results.\n\n\The module also contains additional tools integrated in the main GUI, such as keyword list configuration, keyword search bar in the top-right corner, extracted text viewer and search results viewer showing highlighted keywords found.
|
||||
OpenIDE-Module-Long-Description=Keyword Search ingest module.\n\nThe module indexes files found in the disk image at ingest time.\nIt then periodically runs the search on the indexed files using one or more keyword lists (containing pure words and/or regular expressions) and posts results.\n\nThe module also contains additional tools integrated in the main GUI, such as keyword list configuration, keyword search bar in the top-right corner, extracted text viewer and search results viewer showing highlighted keywords found.
|
||||
OpenIDE-Module-Name=KeywordSearch
|
||||
OptionsCategory_Name_KeywordSearchOptions=Keyword Search
|
||||
OptionsCategory_Keywords_KeywordSearchOptions=Keyword Search
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2018 Basis Technology Corp.
|
||||
* Copyright 2011-2021 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -64,6 +64,7 @@ class Ingester {
|
||||
private static Ingester instance;
|
||||
private final LanguageSpecificContentIndexingHelper languageSpecificContentIndexingHelper
|
||||
= new LanguageSpecificContentIndexingHelper();
|
||||
private static final int LANGUAGE_DETECTION_STRING_SIZE = 4096;
|
||||
|
||||
private Ingester() {
|
||||
}
|
||||
@ -198,6 +199,7 @@ class Ingester {
|
||||
int numChunks = 0; //unknown until chunking is done
|
||||
|
||||
Map<String, String> contentFields = Collections.unmodifiableMap(getContentFields(source));
|
||||
Optional<Language> language = Optional.empty();
|
||||
//Get a reader for the content of the given source
|
||||
try (BufferedReader reader = new BufferedReader(sourceReader)) {
|
||||
Chunker chunker = new Chunker(reader);
|
||||
@ -212,11 +214,15 @@ class Ingester {
|
||||
String chunkId = Server.getChunkIdString(sourceID, numChunks + 1);
|
||||
fields.put(Server.Schema.ID.toString(), chunkId);
|
||||
fields.put(Server.Schema.CHUNK_SIZE.toString(), String.valueOf(chunk.getBaseChunkLength()));
|
||||
Optional<Language> language = Optional.empty();
|
||||
|
||||
if (doLanguageDetection) {
|
||||
language = languageSpecificContentIndexingHelper.detectLanguageIfNeeded(chunk);
|
||||
language.ifPresent(lang -> languageSpecificContentIndexingHelper.updateLanguageSpecificFields(fields, chunk, lang));
|
||||
int size = Math.min(chunk.getBaseChunkLength(), LANGUAGE_DETECTION_STRING_SIZE);
|
||||
language = languageSpecificContentIndexingHelper.detectLanguageIfNeeded(chunk.toString().substring(0, size));
|
||||
|
||||
// only do language detection on the first chunk of the document
|
||||
doLanguageDetection = false;
|
||||
}
|
||||
language.ifPresent(lang -> languageSpecificContentIndexingHelper.updateLanguageSpecificFields(fields, chunk, lang));
|
||||
try {
|
||||
//add the chunk text to Solr index
|
||||
indexChunk(chunk.toString(), chunk.geLowerCasedChunk(), sourceName, fields);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Autopsy Forensic Browser
|
||||
*
|
||||
* Copyright 2011-2019 Basis Technology Corp.
|
||||
* Copyright 2011-2021 Basis Technology Corp.
|
||||
* Contact: carrier <at> sleuthkit <dot> org
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@ -35,15 +35,15 @@ import java.util.Optional;
|
||||
class LanguageSpecificContentIndexingHelper {
|
||||
|
||||
private final LanguageDetector languageDetector = new LanguageDetector();
|
||||
|
||||
Optional<Language> detectLanguageIfNeeded(Chunker.Chunk chunk) throws NoOpenCoreException {
|
||||
|
||||
Optional<Language> detectLanguageIfNeeded(String text) throws NoOpenCoreException {
|
||||
double indexSchemaVersion = NumberUtils.toDouble(KeywordSearch.getServer().getIndexInfo().getSchemaVersion());
|
||||
if (2.2 <= indexSchemaVersion) {
|
||||
return languageDetector.detect(chunk.toString());
|
||||
return languageDetector.detect(text);
|
||||
} else {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void updateLanguageSpecificFields(Map<String, Object> fields, Chunker.Chunk chunk, Language language) {
|
||||
List<String> values = new ArrayList<>();
|
||||
|
@ -211,6 +211,11 @@ final class ExtractZoneIdentifier extends Extract {
|
||||
* @return true if possibleDownloadFile corresponds to zoneFile, false otherwise.
|
||||
*/
|
||||
private boolean isZoneFileMatch(AbstractFile zoneFile, String expectedDownloadFileName, AbstractFile possibleDownloadFile) {
|
||||
|
||||
if (zoneFile == null || possibleDownloadFile == null || expectedDownloadFileName == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (zoneFile.getMetaAddr() != possibleDownloadFile.getMetaAddr()) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user