mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-19 19:14:55 +00:00
Keyword search: message formatting improved
This commit is contained in:
parent
810a8742b0
commit
37ba8bcf7b
@ -614,8 +614,8 @@ class IngestMessagePanel extends javax.swing.JPanel {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
b.append(details);
|
b.append(details);
|
||||||
//b.append("<hr />");
|
|
||||||
b.append("<br />");
|
b.append("<br />");
|
||||||
|
b.append("<hr />");
|
||||||
}
|
}
|
||||||
|
|
||||||
return b.toString();
|
return b.toString();
|
||||||
|
@ -81,7 +81,6 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
"bmp", "gif", "png", "jpeg", "tiff", "mp3", "aiff", "au", "midi", "wav",
|
"bmp", "gif", "png", "jpeg", "tiff", "mp3", "aiff", "au", "midi", "wav",
|
||||||
"pst", "xml", "class"};
|
"pst", "xml", "class"};
|
||||||
|
|
||||||
|
|
||||||
public enum IngestStatus {
|
public enum IngestStatus {
|
||||||
|
|
||||||
INGESTED, EXTRACTED_INGESTED, SKIPPED,
|
INGESTED, EXTRACTED_INGESTED, SKIPPED,
|
||||||
@ -567,7 +566,12 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
StringBuilder detailsSb = new StringBuilder();
|
StringBuilder detailsSb = new StringBuilder();
|
||||||
//final int hitFiles = newResults.size();
|
//final int hitFiles = newResults.size();
|
||||||
|
|
||||||
subjectSb.append("Keyword hit: ").append("<");
|
if (!query.isLiteral()) {
|
||||||
|
subjectSb.append("RegExp hit: ");
|
||||||
|
} else {
|
||||||
|
subjectSb.append("Keyword hit: ");
|
||||||
|
}
|
||||||
|
subjectSb.append("<");
|
||||||
String uniqueKey = null;
|
String uniqueKey = null;
|
||||||
BlackboardAttribute attr = res.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID());
|
BlackboardAttribute attr = res.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD.getTypeID());
|
||||||
if (attr != null) {
|
if (attr != null) {
|
||||||
@ -580,37 +584,49 @@ public final class KeywordSearchIngestService implements IngestServiceFsContent
|
|||||||
//String uniqueKey = queryStr;
|
//String uniqueKey = queryStr;
|
||||||
|
|
||||||
//details
|
//details
|
||||||
//title
|
detailsSb.append("<table border='0' cellpadding='4' width='280'>");
|
||||||
detailsSb.append("<table border='1' width='200'><tr><th>Keyword hit</th><th>Preview</th>");
|
|
||||||
detailsSb.append("<th>File</th><th>List</th>");
|
|
||||||
if (! query.isLiteral())
|
|
||||||
detailsSb.append("<th>Regex</th>");
|
|
||||||
detailsSb.append("</tr><tr>");
|
|
||||||
|
|
||||||
//hit
|
//hit
|
||||||
|
detailsSb.append("<tr>");
|
||||||
|
detailsSb.append("<th>Keyword hit</th>");
|
||||||
detailsSb.append("<td>").append(StringEscapeUtils.escapeHtml(attr.getValueString())).append("</td>");
|
detailsSb.append("<td>").append(StringEscapeUtils.escapeHtml(attr.getValueString())).append("</td>");
|
||||||
|
detailsSb.append("</tr>");
|
||||||
|
|
||||||
//preview
|
//preview
|
||||||
attr = res.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID());
|
attr = res.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID());
|
||||||
if (attr != null) {
|
if (attr != null) {
|
||||||
|
detailsSb.append("<tr>");
|
||||||
|
detailsSb.append("<th>Preview</th>");
|
||||||
detailsSb.append("<td>").append(StringEscapeUtils.escapeHtml(attr.getValueString())).append("</td>");
|
detailsSb.append("<td>").append(StringEscapeUtils.escapeHtml(attr.getValueString())).append("</td>");
|
||||||
|
detailsSb.append("</tr>");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//file
|
//file
|
||||||
|
detailsSb.append("<tr>");
|
||||||
|
detailsSb.append("<th>File</th>");
|
||||||
detailsSb.append("<td>").append(hitFile.getParentPath()).append(hitFile.getName()).append("</td>");
|
detailsSb.append("<td>").append(hitFile.getParentPath()).append(hitFile.getName()).append("</td>");
|
||||||
|
detailsSb.append("</tr>");
|
||||||
|
|
||||||
|
|
||||||
//list
|
//list
|
||||||
attr = res.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_SET.getTypeID());
|
attr = res.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_SET.getTypeID());
|
||||||
|
detailsSb.append("<tr>");
|
||||||
|
detailsSb.append("<th>List</th>");
|
||||||
detailsSb.append("<td>").append(attr.getValueString()).append("</td>");
|
detailsSb.append("<td>").append(attr.getValueString()).append("</td>");
|
||||||
|
detailsSb.append("</tr>");
|
||||||
|
|
||||||
//regex
|
//regex
|
||||||
if (!query.isLiteral()) {
|
if (!query.isLiteral()) {
|
||||||
attr = res.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP.getTypeID());
|
attr = res.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP.getTypeID());
|
||||||
if (attr != null) {
|
if (attr != null) {
|
||||||
|
detailsSb.append("<tr>");
|
||||||
|
detailsSb.append("<th>List</th>");
|
||||||
detailsSb.append("<td>").append(attr.getValueString()).append("</td>");
|
detailsSb.append("<td>").append(attr.getValueString()).append("</td>");
|
||||||
|
detailsSb.append("</tr>");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
detailsSb.append("</tr></table>");
|
detailsSb.append("</table>");
|
||||||
|
|
||||||
managerProxy.postMessage(IngestMessage.createDataMessage(++messageID, instance, subjectSb.toString(), detailsSb.toString(), uniqueKey, res.getArtifact()));
|
managerProxy.postMessage(IngestMessage.createDataMessage(++messageID, instance, subjectSb.toString(), detailsSb.toString(), uniqueKey, res.getArtifact()));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user