mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 07:56:16 +00:00
Merge branch 'develop' of github.com:sleuthkit/autopsy into jdk17_upgrade
This commit is contained in:
commit
ef4075f592
@ -393,7 +393,12 @@ final class InlineSearcher {
|
|||||||
UniqueKeywordHit hit = hitList.get(0);
|
UniqueKeywordHit hit = hitList.get(0);
|
||||||
SleuthkitCase tskCase = Case.getCurrentCase().getSleuthkitCase();
|
SleuthkitCase tskCase = Case.getCurrentCase().getSleuthkitCase();
|
||||||
Content content = tskCase.getContentById(hit.getContentID());
|
Content content = tskCase.getContentById(hit.getContentID());
|
||||||
BlackboardArtifact artifact = RegexQuery.createKeywordHitArtifact(content, originalKeyword, hitKeyword, hit, hit.getSnippet(), hitKeyword.getListName(), sourceId);
|
BlackboardArtifact artifact;
|
||||||
|
if (hit.isLiteral() && hit.isWholeWord()) {
|
||||||
|
artifact = LuceneQuery.createKeywordHitArtifact(content, originalKeyword, hitKeyword, hit, hit.getSnippet(), hitKeyword.getListName(), sourceId);
|
||||||
|
} else {
|
||||||
|
artifact = RegexQuery.createKeywordHitArtifact(content, originalKeyword, hitKeyword, hit, hit.getSnippet(), hitKeyword.getListName(), sourceId);
|
||||||
|
}
|
||||||
// createKeywordHitArtifact has the potential to return null
|
// createKeywordHitArtifact has the potential to return null
|
||||||
// when a CCN account is created.
|
// when a CCN account is created.
|
||||||
if (artifact != null) {
|
if (artifact != null) {
|
||||||
|
@ -234,6 +234,10 @@ class LuceneQuery implements KeywordSearchQuery {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public BlackboardArtifact createKeywordHitArtifact(Content content, Keyword foundKeyword, KeywordHit hit, String snippet, String listName, Long ingestJobId) {
|
public BlackboardArtifact createKeywordHitArtifact(Content content, Keyword foundKeyword, KeywordHit hit, String snippet, String listName, Long ingestJobId) {
|
||||||
|
return createKeywordHitArtifact(content, originalKeyword, foundKeyword, hit, snippet, listName, ingestJobId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BlackboardArtifact createKeywordHitArtifact(Content content, Keyword originalKW, Keyword foundKeyword, KeywordHit hit, String snippet, String listName, Long ingestJobId) {
|
||||||
final String MODULE_NAME = KeywordSearchModuleFactory.getModuleName();
|
final String MODULE_NAME = KeywordSearchModuleFactory.getModuleName();
|
||||||
|
|
||||||
Collection<BlackboardAttribute> attributes = new ArrayList<>();
|
Collection<BlackboardAttribute> attributes = new ArrayList<>();
|
||||||
@ -245,13 +249,13 @@ class LuceneQuery implements KeywordSearchQuery {
|
|||||||
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_SET_NAME, MODULE_NAME, listName));
|
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_SET_NAME, MODULE_NAME, listName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (originalKeyword != null) {
|
if (originalKW != null) {
|
||||||
BlackboardAttribute.ATTRIBUTE_TYPE selType = originalKeyword.getArtifactAttributeType();
|
BlackboardAttribute.ATTRIBUTE_TYPE selType = originalKW.getArtifactAttributeType();
|
||||||
if (selType != null) {
|
if (selType != null) {
|
||||||
attributes.add(new BlackboardAttribute(selType, MODULE_NAME, foundKeyword.getSearchTerm()));
|
attributes.add(new BlackboardAttribute(selType, MODULE_NAME, foundKeyword.getSearchTerm()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (originalKeyword.searchTermIsWholeWord()) {
|
if (originalKW.searchTermIsWholeWord()) {
|
||||||
attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_TYPE, MODULE_NAME, KeywordSearch.QueryType.LITERAL.ordinal()));
|
attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_TYPE, MODULE_NAME, KeywordSearch.QueryType.LITERAL.ordinal()));
|
||||||
} else {
|
} else {
|
||||||
attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_TYPE, MODULE_NAME, KeywordSearch.QueryType.SUBSTRING.ordinal()));
|
attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_TYPE, MODULE_NAME, KeywordSearch.QueryType.SUBSTRING.ordinal()));
|
||||||
|
@ -591,11 +591,7 @@ final class RegexQuery implements KeywordSearchQuery {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (originalKW.searchTermIsLiteral()) {
|
if (originalKW.searchTermIsLiteral()) {
|
||||||
if(!originalKW.searchTermIsWholeWord()) {
|
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_TYPE, MODULE_NAME, KeywordSearch.QueryType.SUBSTRING.ordinal()));
|
||||||
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_TYPE, MODULE_NAME, KeywordSearch.QueryType.SUBSTRING.ordinal()));
|
|
||||||
} else {
|
|
||||||
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_TYPE, MODULE_NAME, KeywordSearch.QueryType.LITERAL.ordinal()));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_TYPE, MODULE_NAME, KeywordSearch.QueryType.REGEX.ordinal()));
|
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_KEYWORD_SEARCH_TYPE, MODULE_NAME, KeywordSearch.QueryType.REGEX.ordinal()));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user