mirror of
https://github.com/overcuriousity/autopsy-flatpak.git
synced 2025-07-12 16:06:15 +00:00
Merge pull request #673 from mrtizmo/keywordsearch
KeywordSearch - Added NON-NLS tags to hardcoded strings not needing Nati...
This commit is contained in:
commit
463d34c160
@ -44,37 +44,37 @@ interface AbstractFileExtract {
|
||||
static final List<String> ARCHIVE_MIME_TYPES =
|
||||
Arrays.asList(
|
||||
//ignore unstructured binary and compressed data, for which string extraction or unzipper works better
|
||||
"application/x-7z-compressed",
|
||||
"application/x-ace-compressed",
|
||||
"application/x-alz-compressed",
|
||||
"application/x-arj",
|
||||
"application/vnd.ms-cab-compressed",
|
||||
"application/x-cfs-compressed",
|
||||
"application/x-dgc-compressed",
|
||||
"application/x-apple-diskimage",
|
||||
"application/x-gca-compressed",
|
||||
"application/x-dar",
|
||||
"application/x-lzx",
|
||||
"application/x-lzh",
|
||||
"application/x-rar-compressed",
|
||||
"application/x-stuffit",
|
||||
"application/x-stuffitx",
|
||||
"application/x-gtar",
|
||||
"application/x-archive",
|
||||
"application/x-executable",
|
||||
"application/x-gzip",
|
||||
"application/zip",
|
||||
"application/x-zoo",
|
||||
"application/x-cpio",
|
||||
"application/x-shar",
|
||||
"application/x-tar",
|
||||
"application/x-bzip",
|
||||
"application/x-bzip2",
|
||||
"application/x-lzip",
|
||||
"application/x-lzma",
|
||||
"application/x-lzop",
|
||||
"application/x-z",
|
||||
"application/x-compress");
|
||||
"application/x-7z-compressed", //NON-NLS
|
||||
"application/x-ace-compressed", //NON-NLS
|
||||
"application/x-alz-compressed", //NON-NLS
|
||||
"application/x-arj", //NON-NLS
|
||||
"application/vnd.ms-cab-compressed", //NON-NLS
|
||||
"application/x-cfs-compressed", //NON-NLS
|
||||
"application/x-dgc-compressed", //NON-NLS
|
||||
"application/x-apple-diskimage", //NON-NLS
|
||||
"application/x-gca-compressed", //NON-NLS
|
||||
"application/x-dar", //NON-NLS
|
||||
"application/x-lzx", //NON-NLS
|
||||
"application/x-lzh", //NON-NLS
|
||||
"application/x-rar-compressed", //NON-NLS
|
||||
"application/x-stuffit", //NON-NLS
|
||||
"application/x-stuffitx", //NON-NLS
|
||||
"application/x-gtar", //NON-NLS
|
||||
"application/x-archive", //NON-NLS
|
||||
"application/x-executable", //NON-NLS
|
||||
"application/x-gzip", //NON-NLS
|
||||
"application/zip", //NON-NLS
|
||||
"application/x-zoo", //NON-NLS
|
||||
"application/x-cpio", //NON-NLS
|
||||
"application/x-shar", //NON-NLS
|
||||
"application/x-tar", //NON-NLS
|
||||
"application/x-bzip", //NON-NLS
|
||||
"application/x-bzip2", //NON-NLS
|
||||
"application/x-lzip", //NON-NLS
|
||||
"application/x-lzma", //NON-NLS
|
||||
"application/x-lzop", //NON-NLS
|
||||
"application/x-z", //NON-NLS
|
||||
"application/x-compress"); //NON-NLS
|
||||
|
||||
/**
|
||||
* Get number of chunks resulted from extracting this AbstractFile
|
||||
|
@ -53,12 +53,13 @@ import org.sleuthkit.datamodel.ReadContentInputStream;
|
||||
private int numChunks = 0;
|
||||
|
||||
static final List<String> WEB_MIME_TYPES = Arrays.asList(
|
||||
"application/javascript",
|
||||
"application/xhtml+xml",
|
||||
"application/json",
|
||||
"text/css",
|
||||
"text/html",
|
||||
"text/javascript" //"application/xml",
|
||||
"application/javascript", //NON-NLS
|
||||
"application/xhtml+xml", //NON-NLS
|
||||
"application/json", //NON-NLS
|
||||
"text/css", //NON-NLS
|
||||
"text/html", //NON-NLS NON-NLS
|
||||
"text/javascript" //NON-NLS
|
||||
//"application/xml",
|
||||
//"application/xml-dtd",
|
||||
);
|
||||
|
||||
@ -114,7 +115,7 @@ import org.sleuthkit.datamodel.ReadContentInputStream;
|
||||
|
||||
// In case there is an exception or parse() isn't called
|
||||
if (reader == null) {
|
||||
logger.log(Level.WARNING, "No reader available from HTML parser");
|
||||
logger.log(Level.WARNING, "No reader available from HTML parser"); //NON-NLS
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -174,29 +175,29 @@ import org.sleuthkit.datamodel.ReadContentInputStream;
|
||||
++this.numChunks;
|
||||
} catch (Ingester.IngesterException ingEx) {
|
||||
success = false;
|
||||
logger.log(Level.WARNING, "Ingester had a problem with extracted HTML from file '"
|
||||
+ sourceFile.getName() + "' (id: " + sourceFile.getId() + ").", ingEx);
|
||||
logger.log(Level.WARNING, "Ingester had a problem with extracted HTML from file '" //NON-NLS
|
||||
+ sourceFile.getName() + "' (id: " + sourceFile.getId() + ").", ingEx); //NON-NLS
|
||||
throw ingEx; //need to rethrow/return to signal error and move on
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Unable to read content stream from " + sourceFile.getId() + ": " + sourceFile.getName(), ex);
|
||||
logger.log(Level.WARNING, "Unable to read content stream from " + sourceFile.getId() + ": " + sourceFile.getName(), ex); //NON-NLS
|
||||
success = false;
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.WARNING, "Unexpected error, can't read content stream from " + sourceFile.getId() + ": " + sourceFile.getName(), ex);
|
||||
logger.log(Level.WARNING, "Unexpected error, can't read content stream from " + sourceFile.getId() + ": " + sourceFile.getName(), ex); //NON-NLS
|
||||
success = false;
|
||||
} finally {
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Unable to close content stream from " + sourceFile.getId(), ex);
|
||||
logger.log(Level.WARNING, "Unable to close content stream from " + sourceFile.getId(), ex); //NON-NLS
|
||||
}
|
||||
try {
|
||||
if (reader != null) {
|
||||
reader.close();
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Unable to close content reader from " + sourceFile.getId(), ex);
|
||||
logger.log(Level.WARNING, "Unable to close content reader from " + sourceFile.getId(), ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ import org.sleuthkit.datamodel.AbstractFile;
|
||||
|
||||
@Override
|
||||
public String getContentType() {
|
||||
return "text/plain;charset=" + charset.name();
|
||||
return "text/plain;charset=" + charset.name(); //NON-NLS
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -141,7 +141,7 @@ class AbstractFileStringExtract implements AbstractFileExtract {
|
||||
++this.numChunks;
|
||||
} catch (IngesterException ingEx) {
|
||||
success = false;
|
||||
logger.log(Level.WARNING, "Ingester had a problem with extracted strings from file '" + sourceFile.getName() + "' (id: " + sourceFile.getId() + ").", ingEx);
|
||||
logger.log(Level.WARNING, "Ingester had a problem with extracted strings from file '" + sourceFile.getName() + "' (id: " + sourceFile.getId() + ").", ingEx); //NON-NLS
|
||||
throw ingEx; //need to rethrow/return to signal error and move on
|
||||
}
|
||||
|
||||
@ -153,13 +153,13 @@ class AbstractFileStringExtract implements AbstractFileExtract {
|
||||
ingester.ingest(this);
|
||||
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Unable to read input stream to divide and send to Solr, file: " + sourceFile.getName(), ex);
|
||||
logger.log(Level.WARNING, "Unable to read input stream to divide and send to Solr, file: " + sourceFile.getName(), ex); //NON-NLS
|
||||
success = false;
|
||||
} finally {
|
||||
try {
|
||||
stringStream.close();
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Error closing input stream stream, file: " + sourceFile.getName(), ex);
|
||||
logger.log(Level.WARNING, "Error closing input stream stream, file: " + sourceFile.getName(), ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ class AbstractFileTikaTextExtract implements AbstractFileExtract {
|
||||
for (MediaType mt : mediaTypes) {
|
||||
TIKA_SUPPORTED_TYPES.add(mt.getType() + "/" + mt.getSubtype());
|
||||
}
|
||||
logger.log(Level.INFO, "Tika supported media types: {0}", TIKA_SUPPORTED_TYPES);
|
||||
logger.log(Level.INFO, "Tika supported media types: {0}", TIKA_SUPPORTED_TYPES); //NON-NLS
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -149,7 +149,7 @@ class AbstractFileTikaTextExtract implements AbstractFileExtract {
|
||||
reader = parseTask.getReader();
|
||||
if (reader == null) {
|
||||
//likely due to exception in parse()
|
||||
logger.log(Level.WARNING, "No reader available from Tika parse");
|
||||
logger.log(Level.WARNING, "No reader available from Tika parse"); //NON-NLS
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -206,7 +206,7 @@ class AbstractFileTikaTextExtract implements AbstractFileExtract {
|
||||
//sort meta data keys
|
||||
List<String> sortedKeyList = Arrays.asList(meta.names());
|
||||
Collections.sort(sortedKeyList);
|
||||
sb.append("\n\n------------------------------METADATA------------------------------\n\n");
|
||||
sb.append("\n\n------------------------------METADATA------------------------------\n\n"); //NON-NLS
|
||||
for (String key : sortedKeyList) {
|
||||
String value = meta.get(key);
|
||||
sb.append(key).append(": ").append(value).append("\n");
|
||||
@ -224,18 +224,18 @@ class AbstractFileTikaTextExtract implements AbstractFileExtract {
|
||||
++this.numChunks;
|
||||
} catch (Ingester.IngesterException ingEx) {
|
||||
success = false;
|
||||
logger.log(Level.WARNING, "Ingester had a problem with extracted strings from file '"
|
||||
+ sourceFile.getName() + "' (id: " + sourceFile.getId() + ").", ingEx);
|
||||
logger.log(Level.WARNING, "Ingester had a problem with extracted strings from file '" //NON-NLS
|
||||
+ sourceFile.getName() + "' (id: " + sourceFile.getId() + ").", ingEx); //NON-NLS
|
||||
throw ingEx; //need to rethrow/return to signal error and move on
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
final String msg = "Exception: Unable to read Tika content stream from " + sourceFile.getId() + ": " + sourceFile.getName();
|
||||
final String msg = "Exception: Unable to read Tika content stream from " + sourceFile.getId() + ": " + sourceFile.getName(); //NON-NLS
|
||||
KeywordSearch.getTikaLogger().log(Level.WARNING, msg, ex);
|
||||
logger.log(Level.WARNING, msg);
|
||||
success = false;
|
||||
} catch (Exception ex) {
|
||||
final String msg = "Exception: Unexpected error, can't read Tika content stream from " + sourceFile.getId() + ": " + sourceFile.getName();
|
||||
final String msg = "Exception: Unexpected error, can't read Tika content stream from " + sourceFile.getId() + ": " + sourceFile.getName(); //NON-NLS
|
||||
KeywordSearch.getTikaLogger().log(Level.WARNING, msg, ex);
|
||||
logger.log(Level.WARNING, msg);
|
||||
success = false;
|
||||
@ -243,14 +243,14 @@ class AbstractFileTikaTextExtract implements AbstractFileExtract {
|
||||
try {
|
||||
stream.close();
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Unable to close Tika content stream from " + sourceFile.getId(), ex);
|
||||
logger.log(Level.WARNING, "Unable to close Tika content stream from " + sourceFile.getId(), ex); //NON-NLS
|
||||
}
|
||||
try {
|
||||
if (reader != null) {
|
||||
reader.close();
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Unable to close content reader from " + sourceFile.getId(), ex);
|
||||
logger.log(Level.WARNING, "Unable to close content reader from " + sourceFile.getId(), ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -269,17 +269,17 @@ class AbstractFileTikaTextExtract implements AbstractFileExtract {
|
||||
public boolean isSupported(AbstractFile file, String detectedFormat) {
|
||||
if (detectedFormat == null) {
|
||||
return false;
|
||||
} else if (detectedFormat.equals("application/octet-stream")
|
||||
|| detectedFormat.equals("application/x-msdownload")) {
|
||||
} else if (detectedFormat.equals("application/octet-stream") //NON-NLS
|
||||
|| detectedFormat.equals("application/x-msdownload")) { //NON-NLS
|
||||
//any binary unstructured blobs (string extraction will be used)
|
||||
return false;
|
||||
} else if (AbstractFileExtract.ARCHIVE_MIME_TYPES.contains(detectedFormat)) {
|
||||
return false;
|
||||
} //skip video other than flv (tika supports flv only)
|
||||
else if (detectedFormat.contains("video/")
|
||||
&& !detectedFormat.equals("video/x-flv")) {
|
||||
else if (detectedFormat.contains("video/") //NON-NLS
|
||||
&& !detectedFormat.equals("video/x-flv")) { //NON-NLS
|
||||
return false;
|
||||
} else if (detectedFormat.contains("application/x-font-ttf")) {
|
||||
} else if (detectedFormat.contains("application/x-font-ttf")) { //NON-NLS
|
||||
// Tika currently has a bug in the ttf parser in fontbox.
|
||||
// It will throw an out of memory exception
|
||||
return false;
|
||||
@ -319,11 +319,11 @@ class AbstractFileTikaTextExtract implements AbstractFileExtract {
|
||||
try {
|
||||
reader = tika.parse(stream, meta);
|
||||
} catch (IOException ex) {
|
||||
KeywordSearch.getTikaLogger().log(Level.WARNING, "Exception: Unable to Tika parse the content" + sourceFile.getId() + ": " + sourceFile.getName(), ex);
|
||||
KeywordSearch.getTikaLogger().log(Level.WARNING, "Exception: Unable to Tika parse the content" + sourceFile.getId() + ": " + sourceFile.getName(), ex); //NON-NLS
|
||||
tika = null;
|
||||
reader = null;
|
||||
} catch (Exception ex) {
|
||||
KeywordSearch.getTikaLogger().log(Level.WARNING, "Exception: Unable to Tika parse the content" + sourceFile.getId() + ": " + sourceFile.getName(), ex);
|
||||
KeywordSearch.getTikaLogger().log(Level.WARNING, "Exception: Unable to Tika parse the content" + sourceFile.getId() + ": " + sourceFile.getName(), ex); //NON-NLS
|
||||
tika = null;
|
||||
reader = null;
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ class ByteContentStream implements ContentStream {
|
||||
|
||||
@Override
|
||||
public String getContentType() {
|
||||
return "text/plain;charset=" + charset.name();
|
||||
return "text/plain;charset=" + charset.name(); //NON-NLS
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -161,7 +161,7 @@ public class DropdownSearchPanel extends AbstractKeywordSearchPerformer {
|
||||
org.openide.awt.Mnemonics.setLocalizedText(selectAllMenuItem, org.openide.util.NbBundle.getMessage(DropdownSearchPanel.class, "DropdownSearchPanel.selectAllMenuItem.text")); // NOI18N
|
||||
rightClickMenu.add(selectAllMenuItem);
|
||||
|
||||
keywordTextField.setFont(new java.awt.Font("Monospaced", 0, 14)); // NOI18N
|
||||
keywordTextField.setFont(new java.awt.Font("Monospaced", 0, 14)); // NOI18N NON-NLS
|
||||
keywordTextField.setText(org.openide.util.NbBundle.getMessage(DropdownSearchPanel.class, "DropdownSearchPanel.keywordTextField.text")); // NOI18N
|
||||
keywordTextField.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(192, 192, 192), 1, true));
|
||||
keywordTextField.setMinimumSize(new java.awt.Dimension(2, 25));
|
||||
@ -177,7 +177,7 @@ public class DropdownSearchPanel extends AbstractKeywordSearchPerformer {
|
||||
}
|
||||
});
|
||||
|
||||
searchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/search-icon.png"))); // NOI18N
|
||||
searchButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/search-icon.png"))); // NOI18N NON-NLS
|
||||
org.openide.awt.Mnemonics.setLocalizedText(searchButton, org.openide.util.NbBundle.getMessage(DropdownSearchPanel.class, "DropdownSearchPanel.searchButton.text")); // NOI18N
|
||||
searchButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
@ -239,7 +239,7 @@ public class DropdownSearchPanel extends AbstractKeywordSearchPerformer {
|
||||
try {
|
||||
search();
|
||||
} catch(Exception e) {
|
||||
logger.log(Level.SEVERE, "search() threw exception", e);
|
||||
logger.log(Level.SEVERE, "search() threw exception", e); //NON-NLS
|
||||
}
|
||||
}//GEN-LAST:event_keywordTextFieldActionPerformed
|
||||
|
||||
|
@ -122,7 +122,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
||||
// set font size manually in an effort to get fonts in this panel to look
|
||||
// similar to what is in the 'String View' content viewer.
|
||||
StyleSheet ss = editorKit.getStyleSheet();
|
||||
ss.addRule("body {font-size: 8.5px;}");
|
||||
ss.addRule("body {font-size: 8.5px;}"); //NON-NLS
|
||||
|
||||
extractedTextPane.setEditorKit(editorKit);
|
||||
|
||||
@ -226,43 +226,43 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
||||
|
||||
hitButtonsLabel.setText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.hitButtonsLabel.text")); // NOI18N
|
||||
|
||||
hitPreviousButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_back.png"))); // NOI18N
|
||||
hitPreviousButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_back.png"))); // NOI18N NON-NLS
|
||||
hitPreviousButton.setText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.hitPreviousButton.text")); // NOI18N
|
||||
hitPreviousButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||||
hitPreviousButton.setBorderPainted(false);
|
||||
hitPreviousButton.setContentAreaFilled(false);
|
||||
hitPreviousButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_back_disabled.png"))); // NOI18N
|
||||
hitPreviousButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_back_disabled.png"))); // NOI18N NON-NLS
|
||||
hitPreviousButton.setMargin(new java.awt.Insets(2, 0, 2, 0));
|
||||
hitPreviousButton.setPreferredSize(new java.awt.Dimension(23, 23));
|
||||
hitPreviousButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_back_hover.png"))); // NOI18N
|
||||
hitPreviousButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_back_hover.png"))); // NOI18N NON-NLS
|
||||
|
||||
hitNextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_forward.png"))); // NOI18N
|
||||
hitNextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_forward.png"))); // NOI18N NON-NLS
|
||||
hitNextButton.setText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.hitNextButton.text")); // NOI18N
|
||||
hitNextButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||||
hitNextButton.setBorderPainted(false);
|
||||
hitNextButton.setContentAreaFilled(false);
|
||||
hitNextButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_forward_disabled.png"))); // NOI18N
|
||||
hitNextButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_forward_disabled.png"))); // NOI18N NON-NLS
|
||||
hitNextButton.setMargin(new java.awt.Insets(2, 0, 2, 0));
|
||||
hitNextButton.setPreferredSize(new java.awt.Dimension(23, 23));
|
||||
hitNextButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_forward_hover.png"))); // NOI18N
|
||||
hitNextButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_forward_hover.png"))); // NOI18N NON-NLS
|
||||
|
||||
pageButtonsLabel.setText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.pageButtonsLabel.text")); // NOI18N
|
||||
|
||||
pagePreviousButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_back.png"))); // NOI18N
|
||||
pagePreviousButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_back.png"))); // NOI18N NON-NLS
|
||||
pagePreviousButton.setText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.pagePreviousButton.text")); // NOI18N
|
||||
pagePreviousButton.setActionCommand(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.pagePreviousButton.actionCommand")); // NOI18N
|
||||
pagePreviousButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||||
pagePreviousButton.setBorderPainted(false);
|
||||
pagePreviousButton.setContentAreaFilled(false);
|
||||
pagePreviousButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_back_disabled.png"))); // NOI18N
|
||||
pagePreviousButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_back_disabled.png"))); // NOI18N NON-NLS
|
||||
pagePreviousButton.setMargin(new java.awt.Insets(2, 0, 2, 0));
|
||||
|
||||
pageNextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_forward.png"))); // NOI18N
|
||||
pageNextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_forward.png"))); // NOI18N NON-NLS
|
||||
pageNextButton.setText(org.openide.util.NbBundle.getMessage(ExtractedContentPanel.class, "ExtractedContentPanel.pageNextButton.text")); // NOI18N
|
||||
pageNextButton.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
|
||||
pageNextButton.setBorderPainted(false);
|
||||
pageNextButton.setContentAreaFilled(false);
|
||||
pageNextButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_forward_disabled.png"))); // NOI18N
|
||||
pageNextButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/btn_step_forward_disabled.png"))); // NOI18N NON-NLS
|
||||
pageNextButton.setMargin(new java.awt.Insets(2, 0, 2, 0));
|
||||
pageNextButton.setPreferredSize(new java.awt.Dimension(23, 23));
|
||||
|
||||
@ -416,7 +416,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
||||
//detect text direction using first 1024 chars and set it
|
||||
//get first up to 1024 chars, strip <pre> tag and unescape html to get the string on which to detect
|
||||
final int len = text.length();
|
||||
final int prefixLen = "<pre>".length();
|
||||
final int prefixLen = "<pre>".length(); //NON-NLS
|
||||
if (len > prefixLen) {
|
||||
final int maxOrientChars = Math.min(len, 1024);
|
||||
final String orientDetectText = EscapeUtil.unEscapeHtml(text.substring(prefixLen, maxOrientChars));
|
||||
@ -708,7 +708,7 @@ class ExtractedContentPanel extends javax.swing.JPanel {
|
||||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.SEVERE, "Error getting marked up text" );
|
||||
logger.log(Level.SEVERE, "Error getting marked up text" ); //NON-NLS
|
||||
}
|
||||
// catch and ignore if we were cancelled
|
||||
catch (java.util.concurrent.CancellationException ex ) { }
|
||||
|
@ -62,7 +62,7 @@ public class ExtractedContentViewer implements DataContentViewer {
|
||||
private int curContentChunk;
|
||||
|
||||
public ExtractedContentViewer() {
|
||||
logger.log(Level.INFO, "Created TextView instance: " + this);
|
||||
logger.log(Level.INFO, "Created TextView instance: " + this); //NON-NLS
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -186,7 +186,7 @@ public class ExtractedContentViewer implements DataContentViewer {
|
||||
try {
|
||||
return getSolrContent(selectedNode, currentPage, hasChunks);
|
||||
} catch (SolrServerException ex) {
|
||||
logger.log(Level.WARNING, "Couldn't get extracted content.", ex);
|
||||
logger.log(Level.WARNING, "Couldn't get extracted content.", ex); //NON-NLS
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@ -234,10 +234,10 @@ public class ExtractedContentViewer implements DataContentViewer {
|
||||
}
|
||||
inited = true;
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Could not get number of chunks: ", ex);
|
||||
logger.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS
|
||||
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Could not get number of chunks: ", ex);
|
||||
logger.log(Level.WARNING, "Could not get number of chunks: ", ex); //NON-NLS
|
||||
}
|
||||
return numPages;
|
||||
}
|
||||
@ -395,10 +395,10 @@ public class ExtractedContentViewer implements DataContentViewer {
|
||||
try {
|
||||
return solrServer.queryIsIndexed(contentID);
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Couldn't determine whether content is supported.", ex);
|
||||
logger.log(Level.WARNING, "Couldn't determine whether content is supported.", ex); //NON-NLS
|
||||
return false;
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Couldn't determine whether content is supported.", ex);
|
||||
logger.log(Level.WARNING, "Couldn't determine whether content is supported.", ex); //NON-NLS
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -456,12 +456,12 @@ public class ExtractedContentViewer implements DataContentViewer {
|
||||
try {
|
||||
curContent = EscapeUtil.escapeHtml(solrServer.getSolrContent(contentObj, chunkId)).trim();
|
||||
StringBuilder sb = new StringBuilder(curContent.length() + 20);
|
||||
sb.append("<pre>").append(curContent).append("</pre>");
|
||||
sb.append("<pre>").append(curContent).append("</pre>"); //NON-NLS
|
||||
curContent = sb.toString();
|
||||
curContentId = contentId;
|
||||
curContentChunk = chunkId;
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Couldn't get text content.", ex);
|
||||
logger.log(Level.WARNING, "Couldn't get text content.", ex); //NON-NLS
|
||||
return "";
|
||||
}
|
||||
return curContent;
|
||||
|
@ -44,8 +44,8 @@ import org.sleuthkit.datamodel.Content;
|
||||
class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(HighlightedMatchesSource.class.getName());
|
||||
private static final String HIGHLIGHT_PRE = "<span style='background:yellow'>";
|
||||
private static final String HIGHLIGHT_POST = "</span>";
|
||||
private static final String HIGHLIGHT_PRE = "<span style='background:yellow'>"; //NON-NLS
|
||||
private static final String HIGHLIGHT_POST = "</span>"; //NON-NLS
|
||||
private static final String ANCHOR_PREFIX = HighlightedMatchesSource.class.getName() + "_";
|
||||
|
||||
private Content content;
|
||||
@ -105,10 +105,10 @@ class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
|
||||
try {
|
||||
this.numberPages = solrServer.queryNumFileChunks(content.getId());
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Could not get number pages for content: " + content.getId());
|
||||
logger.log(Level.WARNING, "Could not get number pages for content: " + content.getId()); //NON-NLS
|
||||
return;
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Could not get number pages for content: " + content.getId());
|
||||
logger.log(Level.WARNING, "Could not get number pages for content: " + content.getId()); //NON-NLS
|
||||
return;
|
||||
}
|
||||
|
||||
@ -146,7 +146,7 @@ class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
|
||||
try {
|
||||
hits = chunksQuery.performQuery();
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.INFO, "Could not get chunk info and get highlights", ex);
|
||||
logger.log(Level.INFO, "Could not get chunk info and get highlights", ex); //NON-NLS
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -355,13 +355,13 @@ class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
|
||||
q.setHighlightFragsize(0); // don't fragment the highlight, works with original highlighter, or needs "single" list builder with FVH
|
||||
|
||||
//tune the highlighter
|
||||
q.setParam("hl.useFastVectorHighlighter", "on"); //fast highlighter scales better than standard one
|
||||
q.setParam("hl.tag.pre", HIGHLIGHT_PRE); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.tag.post", HIGHLIGHT_POST); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.fragListBuilder", "single"); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.useFastVectorHighlighter", "on"); //fast highlighter scales better than standard one NON-NLS
|
||||
q.setParam("hl.tag.pre", HIGHLIGHT_PRE); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
q.setParam("hl.tag.post", HIGHLIGHT_POST); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
q.setParam("hl.fragListBuilder", "single"); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
|
||||
//docs says makes sense for the original Highlighter only, but not really
|
||||
q.setParam("hl.maxAnalyzedChars", Server.HL_ANALYZE_CHARS_UNLIMITED);
|
||||
q.setParam("hl.maxAnalyzedChars", Server.HL_ANALYZE_CHARS_UNLIMITED); //NON-NLS
|
||||
|
||||
try {
|
||||
QueryResponse response = solrServer.query(q, METHOD.POST);
|
||||
@ -381,13 +381,13 @@ class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
|
||||
highlightedContent = insertAnchors(highlightedContent);
|
||||
|
||||
|
||||
return "<html><pre>" + highlightedContent + "</pre></html>";
|
||||
return "<html><pre>" + highlightedContent + "</pre></html>"; //NON-NLS
|
||||
}
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Couldn't query markup for page: " + currentPage, ex);
|
||||
logger.log(Level.WARNING, "Couldn't query markup for page: " + currentPage, ex); //NON-NLS
|
||||
return "";
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Could not query markup for page: " + currentPage, ex);
|
||||
logger.log(Level.WARNING, "Could not query markup for page: " + currentPage, ex); //NON-NLS
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@ -423,8 +423,8 @@ class HighlightedMatchesSource implements MarkupSource, HighlightLookup {
|
||||
|
||||
final String searchToken = HIGHLIGHT_PRE;
|
||||
final int indexSearchTokLen = searchToken.length();
|
||||
final String insertPre = "<a name='" + ANCHOR_PREFIX;
|
||||
final String insertPost = "'></a>";
|
||||
final String insertPre = "<a name='" + ANCHOR_PREFIX; //NON-NLS
|
||||
final String insertPost = "'></a>"; //NON-NLS
|
||||
int count = 0;
|
||||
while ((index = buf.indexOf(searchToken, searchOffset)) >= 0) {
|
||||
String insertString = insertPre + Integer.toString(count + 1) + insertPost;
|
||||
|
@ -74,7 +74,7 @@ class Ingester {
|
||||
//for ingesting chunk as SolrInputDocument (non-content-streaming, by-pass tika)
|
||||
//TODO use a streaming way to add content to /update handler
|
||||
private static final int MAX_DOC_CHUNK_SIZE = 1024*1024;
|
||||
private static final String docContentEncoding = "UTF-8";
|
||||
private static final String docContentEncoding = "UTF-8"; //NON-NLS
|
||||
|
||||
|
||||
private Ingester() {
|
||||
@ -94,7 +94,7 @@ class Ingester {
|
||||
|
||||
// Warn if files might have been left uncommited.
|
||||
if (uncommitedIngests) {
|
||||
logger.warning("Ingester was used to add files that it never committed.");
|
||||
logger.warning("Ingester was used to add files that it never committed."); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ class Ingester {
|
||||
dataSourceId = curCase.getFileDataSource(af);
|
||||
params.put(Server.Schema.IMAGE_ID.toString(), Long.toString(dataSourceId));
|
||||
} catch (TskCoreException ex) {
|
||||
logger.log(Level.SEVERE, "Could not get data source id to properly index the file " + af.getId());
|
||||
logger.log(Level.SEVERE, "Could not get data source id to properly index the file " + af.getId()); //NON-NLS
|
||||
params.put(Server.Schema.IMAGE_ID.toString(), Long.toString(-1));
|
||||
}
|
||||
|
||||
@ -309,7 +309,7 @@ class Ingester {
|
||||
try {
|
||||
is.close();
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Could not close input stream after reading content, " + cs.getName(), ex);
|
||||
logger.log(Level.WARNING, "Could not close input stream after reading content, " + cs.getName(), ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -356,34 +356,34 @@ class Ingester {
|
||||
* content, but the Solr server is probably fine.
|
||||
*/
|
||||
private void ingestExtract(ContentStream cs, Map<String, String> fields, final long size) throws IngesterException {
|
||||
final ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update/extract");
|
||||
final ContentStreamUpdateRequest up = new ContentStreamUpdateRequest("/update/extract"); //NON-NLS
|
||||
up.addContentStream(cs);
|
||||
setFields(up, fields);
|
||||
up.setAction(AbstractUpdateRequest.ACTION.COMMIT, true, true);
|
||||
|
||||
final String contentType = cs.getContentType();
|
||||
if (contentType != null && !contentType.trim().equals("")) {
|
||||
up.setParam("stream.contentType", contentType);
|
||||
up.setParam("stream.contentType", contentType); //NON-NLS
|
||||
}
|
||||
|
||||
//logger.log(Level.INFO, "Ingesting " + fields.get("file_name"));
|
||||
up.setParam("commit", "false");
|
||||
up.setParam("commit", "false"); //NON-NLS
|
||||
|
||||
final Future<?> f = upRequestExecutor.submit(new UpRequestTask(up));
|
||||
|
||||
try {
|
||||
f.get(getTimeout(size), TimeUnit.SECONDS);
|
||||
} catch (TimeoutException te) {
|
||||
logger.log(Level.WARNING, "Solr timeout encountered, trying to restart Solr");
|
||||
logger.log(Level.WARNING, "Solr timeout encountered, trying to restart Solr"); //NON-NLS
|
||||
//restart may be needed to recover from some error conditions
|
||||
hardSolrRestart();
|
||||
throw new IngesterException(
|
||||
NbBundle.getMessage(this.getClass(), "Ingester.ingestExtract.exception.solrTimeout.msg",
|
||||
fields.get("id"), fields.get("file_name")));
|
||||
fields.get("id"), fields.get("file_name"))); //NON-NLS
|
||||
} catch (Exception e) {
|
||||
throw new IngesterException(
|
||||
NbBundle.getMessage(this.getClass(), "Ingester.ingestExtract.exception.probPostToSolr.msg",
|
||||
fields.get("id"), fields.get("file_name")), e);
|
||||
fields.get("id"), fields.get("file_name")), e); //NON-NLS
|
||||
}
|
||||
uncommitedIngests = true;
|
||||
}
|
||||
@ -395,7 +395,7 @@ class Ingester {
|
||||
try {
|
||||
solrServer.closeCore();
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Cannot close core", ex);
|
||||
logger.log(Level.WARNING, "Cannot close core", ex); //NON-NLS
|
||||
}
|
||||
|
||||
solrServer.stop();
|
||||
@ -403,15 +403,15 @@ class Ingester {
|
||||
try {
|
||||
solrServer.start();
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Cannot start", ex);
|
||||
logger.log(Level.WARNING, "Cannot start", ex); //NON-NLS
|
||||
} catch (SolrServerNoPortException ex) {
|
||||
logger.log(Level.WARNING, "Cannot start server with this port", ex);
|
||||
logger.log(Level.WARNING, "Cannot start server with this port", ex); //NON-NLS
|
||||
}
|
||||
|
||||
try {
|
||||
solrServer.openCore();
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Cannot open core", ex);
|
||||
logger.log(Level.WARNING, "Cannot open core", ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -491,9 +491,9 @@ class Ingester {
|
||||
solrServer.commit();
|
||||
uncommitedIngests = false;
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Error commiting index", ex);
|
||||
logger.log(Level.WARNING, "Error commiting index", ex); //NON-NLS
|
||||
} catch (SolrServerException ex) {
|
||||
logger.log(Level.WARNING, "Error commiting index", ex);
|
||||
logger.log(Level.WARNING, "Error commiting index", ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -505,7 +505,7 @@ class Ingester {
|
||||
*/
|
||||
private static void setFields(ContentStreamUpdateRequest up, Map<String, String> fields) {
|
||||
for (Entry<String, String> field : fields.entrySet()) {
|
||||
up.setParam("literal." + field.getKey(), field.getValue());
|
||||
up.setParam("literal." + field.getKey(), field.getValue()); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,19 +53,19 @@ class Installer extends ModuleInstall {
|
||||
//TODO revise this logic, handle other server types, move some logic to Server class
|
||||
try {
|
||||
//check if running from previous application instance and try to shut down
|
||||
logger.log(Level.INFO, "Checking if server is running");
|
||||
logger.log(Level.INFO, "Checking if server is running"); //NON-NLS
|
||||
if (server.isRunning()) {
|
||||
//TODO this could hang if other type of server is running
|
||||
logger.log(Level.WARNING, "Already a server running on " + server.getCurrentSolrServerPort()
|
||||
+ " port, maybe leftover from a previous run. Trying to shut it down.");
|
||||
logger.log(Level.WARNING, "Already a server running on " + server.getCurrentSolrServerPort() //NON-NLS
|
||||
+ " port, maybe leftover from a previous run. Trying to shut it down."); //NON-NLS
|
||||
//stop gracefully
|
||||
server.stop();
|
||||
logger.log(Level.INFO, "Re-checking if server is running");
|
||||
logger.log(Level.INFO, "Re-checking if server is running"); //NON-NLS
|
||||
if (server.isRunning()) {
|
||||
int serverPort = server.getCurrentSolrServerPort();
|
||||
int serverStopPort = server.getCurrentSolrStopPort();
|
||||
logger.log(Level.SEVERE, "There's already a server running on "
|
||||
+ serverPort + " port that can't be shutdown.");
|
||||
logger.log(Level.SEVERE, "There's already a server running on " //NON-NLS
|
||||
+ serverPort + " port that can't be shutdown."); //NON-NLS
|
||||
if (!Server.isPortAvailable(serverPort)) {
|
||||
reportPortError(serverPort);
|
||||
} else if (!Server.isPortAvailable(serverStopPort)) {
|
||||
@ -78,13 +78,13 @@ class Installer extends ModuleInstall {
|
||||
//in this case give up
|
||||
|
||||
} else {
|
||||
logger.log(Level.INFO, "Old Solr server shutdown successfully.");
|
||||
logger.log(Level.INFO, "Old Solr server shutdown successfully."); //NON-NLS
|
||||
//make sure there really isn't a hang Solr process, in case isRunning() reported false
|
||||
server.killSolr();
|
||||
}
|
||||
}
|
||||
} catch (KeywordSearchModuleException e) {
|
||||
logger.log(Level.SEVERE, "Starting server failed, will try to kill. ", e);
|
||||
logger.log(Level.SEVERE, "Starting server failed, will try to kill. ", e); //NON-NLS
|
||||
server.killSolr();
|
||||
}
|
||||
|
||||
@ -94,13 +94,13 @@ class Installer extends ModuleInstall {
|
||||
//Try to bind to the port 4 times at 1 second intervals.
|
||||
//TODO move some of this logic to Server class
|
||||
for (int i = 0; i <= 3; i++) {
|
||||
logger.log(Level.INFO, "Checking if port available.");
|
||||
logger.log(Level.INFO, "Checking if port available."); //NON-NLS
|
||||
if (Server.isPortAvailable(server.getCurrentSolrServerPort())) {
|
||||
logger.log(Level.INFO, "Port available, trying to start server.");
|
||||
logger.log(Level.INFO, "Port available, trying to start server."); //NON-NLS
|
||||
server.start();
|
||||
break;
|
||||
} else if (i == 3) {
|
||||
logger.log(Level.INFO, "No port available, done retrying.");
|
||||
logger.log(Level.INFO, "No port available, done retrying."); //NON-NLS
|
||||
reportPortError(server.getCurrentSolrServerPort());
|
||||
retries = 0;
|
||||
break;
|
||||
@ -108,16 +108,16 @@ class Installer extends ModuleInstall {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException iex) {
|
||||
logger.log(Level.WARNING, "Timer interrupted");
|
||||
logger.log(Level.WARNING, "Timer interrupted"); //NON-NLS
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (SolrServerNoPortException npe) {
|
||||
logger.log(Level.SEVERE, "Starting server failed due to no port available. ", npe);
|
||||
logger.log(Level.SEVERE, "Starting server failed due to no port available. ", npe); //NON-NLS
|
||||
//try to kill it
|
||||
|
||||
} catch (KeywordSearchModuleException e) {
|
||||
logger.log(Level.SEVERE, "Starting server failed. ", e);
|
||||
logger.log(Level.SEVERE, "Starting server failed. ", e); //NON-NLS
|
||||
}
|
||||
|
||||
|
||||
@ -127,25 +127,25 @@ class Installer extends ModuleInstall {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException ex) {
|
||||
logger.log(Level.WARNING, "Timer interrupted.");
|
||||
logger.log(Level.WARNING, "Timer interrupted."); //NON-NLS
|
||||
}
|
||||
|
||||
try {
|
||||
logger.log(Level.INFO, "Ensuring the server is running, retries remaining: " + retries);
|
||||
logger.log(Level.INFO, "Ensuring the server is running, retries remaining: " + retries); //NON-NLS
|
||||
if (!server.isRunning()) {
|
||||
logger.log(Level.WARNING, "Server still not running");
|
||||
logger.log(Level.WARNING, "Server still not running"); //NON-NLS
|
||||
try {
|
||||
logger.log(Level.WARNING, "Trying to start the server. ");
|
||||
logger.log(Level.WARNING, "Trying to start the server. "); //NON-NLS
|
||||
server.start();
|
||||
} catch (SolrServerNoPortException npe) {
|
||||
logger.log(Level.SEVERE, "Starting server failed due to no port available. ", npe);
|
||||
logger.log(Level.SEVERE, "Starting server failed due to no port available. ", npe); //NON-NLS
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.INFO, "Server appears now running. ");
|
||||
logger.log(Level.INFO, "Server appears now running. "); //NON-NLS
|
||||
break;
|
||||
}
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.SEVERE, "Starting server failed. ", ex);
|
||||
logger.log(Level.SEVERE, "Starting server failed. ", ex); //NON-NLS
|
||||
//retry if has retries
|
||||
}
|
||||
|
||||
@ -156,12 +156,12 @@ class Installer extends ModuleInstall {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException ex) {
|
||||
logger.log(Level.WARNING, "Timer interrupted.");
|
||||
logger.log(Level.WARNING, "Timer interrupted."); //NON-NLS
|
||||
}
|
||||
try {
|
||||
logger.log(Level.INFO, "Last check if server is running. ");
|
||||
logger.log(Level.INFO, "Last check if server is running. "); //NON-NLS
|
||||
if (!server.isRunning()) {
|
||||
logger.log(Level.SEVERE, "Server is still not running. ");
|
||||
logger.log(Level.SEVERE, "Server is still not running. "); //NON-NLS
|
||||
//check if port is taken or some other reason
|
||||
int serverPort = server.getCurrentSolrServerPort();
|
||||
int serverStopPort = server.getCurrentSolrStopPort();
|
||||
@ -175,7 +175,7 @@ class Installer extends ModuleInstall {
|
||||
}
|
||||
}
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.SEVERE, "Starting server failed. ", ex);
|
||||
logger.log(Level.SEVERE, "Starting server failed. ", ex); //NON-NLS
|
||||
reportInitError();
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ class JerichoParserWrapper {
|
||||
// Get all the tags in the source
|
||||
List<StartTag> tags = source.getAllStartTags();
|
||||
for(StartTag tag : tags) {
|
||||
if(tag.getName().equals("script")) {
|
||||
if(tag.getName().equals("script")) { //NON-NLS
|
||||
// If the <script> tag has attributes
|
||||
scripts.append(numScripts).append(") ");
|
||||
if(tag.getTagContent().length()>0) {
|
||||
@ -92,11 +92,11 @@ class JerichoParserWrapper {
|
||||
// Get whats between the <script> .. </script> tags
|
||||
scripts.append(tag.getElement().getContent()).append("\n");
|
||||
numScripts++;
|
||||
} else if(tag.getName().equals("a")) {
|
||||
} else if(tag.getName().equals("a")) { //NON-NLS
|
||||
links.append(numLinks).append(") ");
|
||||
links.append(tag.getTagContent()).append("\n");
|
||||
numLinks++;
|
||||
} else if(tag.getName().equals("img")) {
|
||||
} else if(tag.getName().equals("img")) { //NON-NLS
|
||||
images.append(numImages).append(") ");
|
||||
images.append(tag.getTagContent()).append("\n");
|
||||
numImages++;
|
||||
@ -118,27 +118,27 @@ class JerichoParserWrapper {
|
||||
|
||||
out.append(text).append("\n\n");
|
||||
|
||||
out.append("----------NONVISIBLE TEXT----------\n\n");
|
||||
out.append("----------NONVISIBLE TEXT----------\n\n"); //NON-NLS
|
||||
if(numScripts>1) {
|
||||
out.append("---Scripts---\n");
|
||||
out.append("---Scripts---\n"); //NON-NLS
|
||||
out.append(scripts.toString()).append("\n");
|
||||
} if(numLinks>1) {
|
||||
out.append("---Links---\n");
|
||||
out.append("---Links---\n"); //NON-NLS
|
||||
out.append(links.toString()).append("\n");
|
||||
} if(numImages>1) {
|
||||
out.append("---Images---\n");
|
||||
out.append("---Images---\n"); //NON-NLS
|
||||
out.append(images.toString()).append("\n");
|
||||
} if(numComments>1) {
|
||||
out.append("---Comments---\n");
|
||||
out.append("---Comments---\n"); //NON-NLS
|
||||
out.append(comments.toString()).append("\n");
|
||||
} if(numOthers>1) {
|
||||
out.append("---Others---\n");
|
||||
out.append("---Others---\n"); //NON-NLS
|
||||
out.append(others.toString()).append("\n");
|
||||
}
|
||||
// All done, now make it a reader
|
||||
reader = new StringReader(out.toString());
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Unable to parse the HTML file", ex);
|
||||
logger.log(Level.WARNING, "Unable to parse the HTML file", ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,12 +42,12 @@ public class KeywordSearch {
|
||||
private static Server server;
|
||||
//we want a custom java.util.logging.Logger here for a reason
|
||||
//a separate logger from framework logs
|
||||
private static final Logger TIKA_LOGGER = Logger.getLogger("Tika");
|
||||
private static final Logger TIKA_LOGGER = Logger.getLogger("Tika"); //NON-NLS
|
||||
private static final Logger logger = Logger.getLogger(Case.class.getName());
|
||||
public enum QueryType {
|
||||
LITERAL, REGEX
|
||||
};
|
||||
public static final String NUM_FILES_CHANGE_EVT = "NUM_FILES_CHANGE_EVT";
|
||||
public static final String NUM_FILES_CHANGE_EVT = "NUM_FILES_CHANGE_EVT"; //NON-NLS
|
||||
private static PropertyChangeSupport changeSupport = new PropertyChangeSupport(KeywordSearch.class);
|
||||
|
||||
/**
|
||||
@ -66,7 +66,7 @@ public class KeywordSearch {
|
||||
static {
|
||||
try {
|
||||
final int MAX_TIKA_LOG_FILES = 3;
|
||||
FileHandler tikaLogHandler = new FileHandler(PlatformUtil.getUserDirectory().getAbsolutePath() + "/var/log/tika.log",
|
||||
FileHandler tikaLogHandler = new FileHandler(PlatformUtil.getUserDirectory().getAbsolutePath() + "/var/log/tika.log", //NON-NLS
|
||||
0, MAX_TIKA_LOG_FILES);
|
||||
tikaLogHandler.setFormatter(new SimpleFormatter());
|
||||
tikaLogHandler.setEncoding(PlatformUtil.getLogFileEncoding());
|
||||
@ -104,7 +104,7 @@ public class KeywordSearch {
|
||||
changeSupport.firePropertyChange(NUM_FILES_CHANGE_EVT, oldNum, newNum);
|
||||
}
|
||||
catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearch listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearch listener threw exception", e); //NON-NLS
|
||||
MessageNotifyUtil.Notify.show(NbBundle.getMessage(KeywordSearch.class, "KeywordSearch.moduleErr"),
|
||||
NbBundle.getMessage(KeywordSearch.class,
|
||||
"KeywordSearch.fireNumIdxFileChg.moduleErr.msg"),
|
||||
@ -133,7 +133,7 @@ public class KeywordSearch {
|
||||
try {
|
||||
server.openCore();
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Could not open core.");
|
||||
logger.log(Level.WARNING, "Could not open core."); //NON-NLS
|
||||
}
|
||||
} else if (oldValue != null) {
|
||||
// a case was closed
|
||||
@ -142,7 +142,7 @@ public class KeywordSearch {
|
||||
Thread.sleep(2000);
|
||||
server.closeCore();
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Could not close core.");
|
||||
logger.log(Level.WARNING, "Could not close core."); //NON-NLS
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -291,13 +291,13 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
|
||||
listOptionsLabel.setText(org.openide.util.NbBundle.getMessage(KeywordSearchEditListPanel.class, "KeywordSearchEditListPanel.listOptionsLabel.text")); // NOI18N
|
||||
|
||||
deleteListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/delete16.png"))); // NOI18N
|
||||
deleteListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/delete16.png"))); // NOI18N NON-NLS
|
||||
deleteListButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchEditListPanel.class, "KeywordSearchEditListPanel.deleteListButton.text")); // NOI18N
|
||||
|
||||
saveListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/save16.png"))); // NOI18N
|
||||
saveListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/save16.png"))); // NOI18N NON-NLS
|
||||
saveListButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchEditListPanel.class, "KeywordSearchEditListPanel.saveListButton.text")); // NOI18N
|
||||
|
||||
exportButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/export16.png"))); // NOI18N
|
||||
exportButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/export16.png"))); // NOI18N NON-NLS
|
||||
exportButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchEditListPanel.class, "KeywordSearchEditListPanel.exportButton.text")); // NOI18N
|
||||
exportButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
@ -442,7 +442,7 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
"KeywordSearchEditListPanel.exportButtonAction.featureName.text");
|
||||
|
||||
JFileChooser chooser = new JFileChooser();
|
||||
final String EXTENSION = "xml";
|
||||
final String EXTENSION = "xml"; //NON-NLS
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchEditListPanel.exportButtonActionPerformed.fileFilterLabel"), EXTENSION);
|
||||
chooser.setFileFilter(filter);
|
||||
@ -608,7 +608,7 @@ class KeywordSearchEditListPanel extends javax.swing.JPanel implements ListSelec
|
||||
ret = (Object) !word.isLiteral();
|
||||
break;
|
||||
default:
|
||||
logger.log(Level.SEVERE, "Invalid table column index: {0}", columnIndex);
|
||||
logger.log(Level.SEVERE, "Invalid table column index: {0}", columnIndex); //NON-NLS
|
||||
break;
|
||||
}
|
||||
return ret;
|
||||
|
@ -267,7 +267,7 @@ class KeywordSearchGlobalSearchSettingsPanel extends javax.swing.JPanel implemen
|
||||
filesIndexedValue.setText(Integer.toString(KeywordSearch.getServer().queryNumIndexedFiles()));
|
||||
chunksValLabel.setText(Integer.toString(KeywordSearch.getServer().queryNumIndexedChunks()));
|
||||
} catch (KeywordSearchModuleException | NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Could not get number of indexed files/chunks");
|
||||
logger.log(Level.WARNING, "Could not get number of indexed files/chunks"); //NON-NLS
|
||||
}
|
||||
|
||||
KeywordSearch.addNumIndexedFilesChangeListener(
|
||||
@ -283,7 +283,7 @@ class KeywordSearchGlobalSearchSettingsPanel extends javax.swing.JPanel implemen
|
||||
try {
|
||||
chunksValLabel.setText(Integer.toString(KeywordSearch.getServer().queryNumIndexedChunks()));
|
||||
} catch (KeywordSearchModuleException | NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Could not get number of indexed chunks");
|
||||
logger.log(Level.WARNING, "Could not get number of indexed chunks"); //NON-NLS
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
*/
|
||||
@Override
|
||||
public void startUp(IngestJobContext context) throws IngestModuleException {
|
||||
logger.log(Level.INFO, "Initializing instance {0}", instanceNum);
|
||||
logger.log(Level.INFO, "Initializing instance {0}", instanceNum); //NON-NLS
|
||||
initialized = false;
|
||||
jobId = context.getJobId();
|
||||
caseHandle = Case.getCurrentCase().getSleuthkitCase();
|
||||
@ -143,7 +143,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
throw new IngestModuleException(msg);
|
||||
}
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Error checking if Solr server is running while initializing ingest", ex);
|
||||
logger.log(Level.WARNING, "Error checking if Solr server is running while initializing ingest", ex); //NON-NLS
|
||||
//this means Solr is not properly initialized
|
||||
String msg = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.badInitMsg");
|
||||
String details = NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.init.tryStopSolrMsg", msg);
|
||||
@ -185,7 +185,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
for (SCRIPT s : KeywordSearchSettings.getStringExtractScripts()) {
|
||||
sbScripts.append(s.name()).append(" ");
|
||||
}
|
||||
logger.log(Level.INFO, "Using string extract scripts: {0}", sbScripts.toString());
|
||||
logger.log(Level.INFO, "Using string extract scripts: {0}", sbScripts.toString()); //NON-NLS
|
||||
|
||||
textExtractors = new ArrayList<>();
|
||||
//order matters, more specific extractors first
|
||||
@ -200,7 +200,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
public ProcessResult process(AbstractFile abstractFile) {
|
||||
if (initialized == false) //error initializing indexing/Solr
|
||||
{
|
||||
logger.log(Level.WARNING, "Skipping processing, module not initialized, file: {0}", abstractFile.getName());
|
||||
logger.log(Level.WARNING, "Skipping processing, module not initialized, file: {0}", abstractFile.getName()); //NON-NLS
|
||||
putIngestStatus(abstractFile.getId(), IngestStatus.SKIPPED_ERROR_INDEXING);
|
||||
return ProcessResult.OK;
|
||||
}
|
||||
@ -209,7 +209,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
dataSourceId = caseHandle.getFileDataSource(abstractFile);
|
||||
|
||||
} catch (TskCoreException ex) {
|
||||
logger.log(Level.SEVERE, "Error getting image id of file processed by keyword search: " + abstractFile.getName(), ex);
|
||||
logger.log(Level.SEVERE, "Error getting image id of file processed by keyword search: " + abstractFile.getName(), ex); //NON-NLS
|
||||
}
|
||||
|
||||
if (abstractFile.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR)) {
|
||||
@ -242,14 +242,14 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
*/
|
||||
@Override
|
||||
public void shutDown(boolean ingestJobCancelled) {
|
||||
logger.log(Level.INFO, "Instance {0}", instanceNum);
|
||||
logger.log(Level.INFO, "Instance {0}", instanceNum); //NON-NLS
|
||||
|
||||
if (initialized == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ingestJobCancelled) {
|
||||
logger.log(Level.INFO, "Ingest job cancelled");
|
||||
logger.log(Level.INFO, "Ingest job cancelled"); //NON-NLS
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
@ -267,10 +267,10 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
try {
|
||||
final int numIndexedFiles = KeywordSearch.getServer().queryNumIndexedFiles();
|
||||
final int numIndexedChunks = KeywordSearch.getServer().queryNumIndexedChunks();
|
||||
logger.log(Level.INFO, "Indexed files count: {0}", numIndexedFiles);
|
||||
logger.log(Level.INFO, "Indexed file chunks count: {0}", numIndexedChunks);
|
||||
logger.log(Level.INFO, "Indexed files count: {0}", numIndexedFiles); //NON-NLS
|
||||
logger.log(Level.INFO, "Indexed file chunks count: {0}", numIndexedChunks); //NON-NLS
|
||||
} catch (NoOpenCoreException | KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Error executing Solr query to check number of indexed files/chunks: ", ex);
|
||||
logger.log(Level.WARNING, "Error executing Solr query to check number of indexed files/chunks: ", ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -278,7 +278,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
* Handle stop event (ingest interrupted) Cleanup resources, threads, timers
|
||||
*/
|
||||
private void stop() {
|
||||
logger.log(Level.INFO, "stop()");
|
||||
logger.log(Level.INFO, "stop()"); //NON-NLS
|
||||
|
||||
SearchRunner.getInstance().stopJob(jobId);
|
||||
|
||||
@ -341,15 +341,15 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
}
|
||||
|
||||
StringBuilder msg = new StringBuilder();
|
||||
msg.append("<table border=0><tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.knowFileHeaderLbl")).append("</td><td>").append(text_ingested).append("</td></tr>");
|
||||
msg.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.fileGenStringsHead")).append("</td><td>").append(strings_ingested).append("</td></tr>");
|
||||
msg.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.mdOnlyLbl")).append("</td><td>").append(metadata_ingested).append("</td></tr>");
|
||||
msg.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.idxErrLbl")).append("</td><td>").append(error_index).append("</td></tr>");
|
||||
msg.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.errTxtLbl")).append("</td><td>").append(error_text).append("</td></tr>");
|
||||
msg.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.errIoLbl")).append("</td><td>").append(error_io).append("</td></tr>");
|
||||
msg.append("</table>");
|
||||
msg.append("<table border=0><tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.knowFileHeaderLbl")).append("</td><td>").append(text_ingested).append("</td></tr>"); //NON-NLS
|
||||
msg.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.fileGenStringsHead")).append("</td><td>").append(strings_ingested).append("</td></tr>"); //NON-NLS
|
||||
msg.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.mdOnlyLbl")).append("</td><td>").append(metadata_ingested).append("</td></tr>"); //NON-NLS
|
||||
msg.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.idxErrLbl")).append("</td><td>").append(error_index).append("</td></tr>"); //NON-NLS
|
||||
msg.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.errTxtLbl")).append("</td><td>").append(error_text).append("</td></tr>"); //NON-NLS
|
||||
msg.append("<tr><td>").append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.errIoLbl")).append("</td><td>").append(error_io).append("</td></tr>"); //NON-NLS
|
||||
msg.append("</table>"); //NON-NLS
|
||||
String indexStats = msg.toString();
|
||||
logger.log(Level.INFO, "Keyword Indexing Completed: {0}", indexStats);
|
||||
logger.log(Level.INFO, "Keyword Indexing Completed: {0}", indexStats); //NON-NLS
|
||||
services.postMessage(IngestMessage.createMessage(MessageType.INFO, KeywordSearchModuleFactory.getModuleName(), NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.kwIdxResultsLbl"), indexStats));
|
||||
if (error_index > 0) {
|
||||
MessageNotifyUtil.Notify.error(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.postIndexSummary.kwIdxErrsTitle"),
|
||||
@ -391,7 +391,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
}
|
||||
|
||||
if (fileExtract == null) {
|
||||
logger.log(Level.INFO, "No text extractor found for file id:{0}, name: {1}, detected format: {2}", new Object[]{aFile.getId(), aFile.getName(), detectedFormat});
|
||||
logger.log(Level.INFO, "No text extractor found for file id:{0}, name: {1}, detected format: {2}", new Object[]{aFile.getId(), aFile.getName(), detectedFormat}); //NON-NLS
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -414,12 +414,12 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
putIngestStatus(aFile.getId(), IngestStatus.STRINGS_INGESTED);
|
||||
return true;
|
||||
} else {
|
||||
logger.log(Level.WARNING, "Failed to extract strings and ingest, file ''{0}'' (id: {1}).", new Object[]{aFile.getName(), aFile.getId()});
|
||||
logger.log(Level.WARNING, "Failed to extract strings and ingest, file ''{0}'' (id: {1}).", new Object[]{aFile.getName(), aFile.getId()}); //NON-NLS
|
||||
putIngestStatus(aFile.getId(), IngestStatus.SKIPPED_ERROR_TEXTEXTRACT);
|
||||
return false;
|
||||
}
|
||||
} catch (IngesterException ex) {
|
||||
logger.log(Level.WARNING, "Failed to extract strings and ingest, file '" + aFile.getName() + "' (id: " + aFile.getId() + ").", ex);
|
||||
logger.log(Level.WARNING, "Failed to extract strings and ingest, file '" + aFile.getName() + "' (id: " + aFile.getId() + ").", ex); //NON-NLS
|
||||
putIngestStatus(aFile.getId(), IngestStatus.SKIPPED_ERROR_INDEXING);
|
||||
return false;
|
||||
}
|
||||
@ -469,7 +469,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
putIngestStatus(aFile.getId(), IngestStatus.METADATA_INGESTED);
|
||||
} catch (IngesterException ex) {
|
||||
putIngestStatus(aFile.getId(), IngestStatus.SKIPPED_ERROR_INDEXING);
|
||||
logger.log(Level.WARNING, "Unable to index meta-data for file: " + aFile.getId(), ex);
|
||||
logger.log(Level.WARNING, "Unable to index meta-data for file: " + aFile.getId(), ex); //NON-NLS
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -481,13 +481,13 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
is = new ReadContentInputStream(aFile);
|
||||
detectedFormat = tikaFormatDetector.detect(is, aFile.getName());
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Could not detect format using tika for file: " + aFile, e);
|
||||
logger.log(Level.WARNING, "Could not detect format using tika for file: " + aFile, e); //NON-NLS
|
||||
} finally {
|
||||
if (is != null) {
|
||||
try {
|
||||
is.close();
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Could not close stream after detecting format using tika for file: "
|
||||
logger.log(Level.WARNING, "Could not close stream after detecting format using tika for file: " //NON-NLS
|
||||
+ aFile, ex);
|
||||
}
|
||||
}
|
||||
@ -505,7 +505,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
putIngestStatus(aFile.getId(), IngestStatus.METADATA_INGESTED);
|
||||
} catch (IngesterException ex) {
|
||||
putIngestStatus(aFile.getId(), IngestStatus.SKIPPED_ERROR_INDEXING);
|
||||
logger.log(Level.WARNING, "Unable to index meta-data for file: " + aFile.getId(), ex);
|
||||
logger.log(Level.WARNING, "Unable to index meta-data for file: " + aFile.getId(), ex); //NON-NLS
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -516,7 +516,7 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
try {
|
||||
//logger.log(Level.INFO, "indexing: " + aFile.getName());
|
||||
if (!extractTextAndIndex(aFile, detectedFormat)) {
|
||||
logger.log(Level.WARNING, "Failed to extract text and ingest, file ''{0}'' (id: {1}).", new Object[]{aFile.getName(), aFile.getId()});
|
||||
logger.log(Level.WARNING, "Failed to extract text and ingest, file ''{0}'' (id: {1}).", new Object[]{aFile.getName(), aFile.getId()}); //NON-NLS
|
||||
putIngestStatus(aFile.getId(), IngestStatus.SKIPPED_ERROR_TEXTEXTRACT);
|
||||
} else {
|
||||
putIngestStatus(aFile.getId(), IngestStatus.TEXT_INGESTED);
|
||||
@ -524,11 +524,11 @@ public final class KeywordSearchIngestModule extends IngestModuleAdapter impleme
|
||||
}
|
||||
|
||||
} catch (IngesterException e) {
|
||||
logger.log(Level.INFO, "Could not extract text with Tika, " + aFile.getId() + ", "
|
||||
logger.log(Level.INFO, "Could not extract text with Tika, " + aFile.getId() + ", " //NON-NLS
|
||||
+ aFile.getName(), e);
|
||||
putIngestStatus(aFile.getId(), IngestStatus.SKIPPED_ERROR_INDEXING);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Error extracting text with Tika, " + aFile.getId() + ", "
|
||||
logger.log(Level.WARNING, "Error extracting text with Tika, " + aFile.getId() + ", " //NON-NLS
|
||||
+ aFile.getName(), e);
|
||||
putIngestStatus(aFile.getId(), IngestStatus.SKIPPED_ERROR_TEXTEXTRACT);
|
||||
}
|
||||
|
@ -86,14 +86,14 @@ public final class KeywordSearchJobSettingsPanel extends IngestModuleIngestJobSe
|
||||
private void displayLanguages() {
|
||||
List<SCRIPT> scripts = KeywordSearchSettings.getStringExtractScripts();
|
||||
StringBuilder langs = new StringBuilder();
|
||||
langs.append("<html>");
|
||||
langs.append("<html>"); //NON-NLS
|
||||
for (int i = 0; i < scripts.size(); i++) {
|
||||
langs.append(scripts.get(i).toString());
|
||||
if (i + 1 < scripts.size()) {
|
||||
langs.append(", ");
|
||||
}
|
||||
}
|
||||
langs.append("</html>");
|
||||
langs.append("</html>"); //NON-NLS
|
||||
String langsS = langs.toString();
|
||||
this.languagesValLabel.setText(langsS);
|
||||
this.languagesValLabel.setToolTipText(langsS);
|
||||
@ -107,7 +107,7 @@ public final class KeywordSearchJobSettingsPanel extends IngestModuleIngestJobSe
|
||||
encodingsList.add("UTF8");
|
||||
}
|
||||
if (utf16 == null || Boolean.parseBoolean(utf16)) {
|
||||
encodingsList.add("UTF16");
|
||||
encodingsList.add("UTF16"); //NON-NLS
|
||||
}
|
||||
String encodings = encodingsList.toString();
|
||||
encodings = encodings.substring(1, encodings.length() - 1);
|
||||
|
@ -69,7 +69,7 @@ abstract class KeywordSearchListsAbstract {
|
||||
try {
|
||||
changeSupport.firePropertyChange(event.toString(), null, null);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -87,40 +87,40 @@ abstract class KeywordSearchListsAbstract {
|
||||
}
|
||||
//phone number
|
||||
List<Keyword> phones = new ArrayList<>();
|
||||
phones.add(new Keyword("[(]{0,1}\\d\\d\\d[)]{0,1}[\\.-]\\d\\d\\d[\\.-]\\d\\d\\d\\d", false, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER));
|
||||
phones.add(new Keyword("[(]{0,1}\\d\\d\\d[)]{0,1}[\\.-]\\d\\d\\d[\\.-]\\d\\d\\d\\d", false, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER)); //NON-NLS
|
||||
//phones.add(new Keyword("\\d{8,10}", false));
|
||||
//IP address
|
||||
List<Keyword> ips = new ArrayList<>();
|
||||
ips.add(new Keyword("(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])", false, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_IP_ADDRESS));
|
||||
//email
|
||||
List<Keyword> emails = new ArrayList<>();
|
||||
emails.add(new Keyword("(?=.{8})[a-z0-9%+_-]+(?:\\.[a-z0-9%+_-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z]{2,4}(?<!\\.txt|\\.exe|\\.dll|\\.jpg|\\.xml)",
|
||||
emails.add(new Keyword("(?=.{8})[a-z0-9%+_-]+(?:\\.[a-z0-9%+_-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z]{2,4}(?<!\\.txt|\\.exe|\\.dll|\\.jpg|\\.xml)", //NON-NLS
|
||||
false, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL));
|
||||
//emails.add(new Keyword("[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}",
|
||||
// false, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL));
|
||||
//URL
|
||||
List<Keyword> urls = new ArrayList<>();
|
||||
//urls.add(new Keyword("http://|https://|^www\\.", false, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL));
|
||||
urls.add(new Keyword("((((ht|f)tp(s?))\\://)|www\\.)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,5})(\\:[0-9]+)*(/($|[a-zA-Z0-9\\.\\,\\;\\?\\'\\\\+&%\\$#\\=~_\\-]+))*", false, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL));
|
||||
urls.add(new Keyword("((((ht|f)tp(s?))\\://)|www\\.)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,5})(\\:[0-9]+)*(/($|[a-zA-Z0-9\\.\\,\\;\\?\\'\\\\+&%\\$#\\=~_\\-]+))*", false, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL)); //NON-NLS
|
||||
|
||||
//urls.add(new Keyword("ssh://", false, BlackboardAttribute.ATTRIBUTE_TYPE.TSK_URL));
|
||||
|
||||
//disable messages for harcoded/locked lists
|
||||
String name;
|
||||
|
||||
name = "Phone Numbers";
|
||||
name = "Phone Numbers"; //NON-NLS
|
||||
lockedLists.add(name);
|
||||
addList(name, phones, false, false, true);
|
||||
|
||||
name = "IP Addresses";
|
||||
name = "IP Addresses"; //NON-NLS
|
||||
lockedLists.add(name);
|
||||
addList(name, ips, false, false, true);
|
||||
|
||||
name = "Email Addresses";
|
||||
name = "Email Addresses"; //NON-NLS
|
||||
lockedLists.add(name);
|
||||
addList(name, emails, true, false, true);
|
||||
|
||||
name = "URLs";
|
||||
name = "URLs"; //NON-NLS
|
||||
lockedLists.add(name);
|
||||
addList(name, urls, false, false, true);
|
||||
}
|
||||
@ -287,7 +287,7 @@ abstract class KeywordSearchListsAbstract {
|
||||
try {
|
||||
changeSupport.firePropertyChange(ListsEvt.LIST_ADDED.toString(), null, name);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e); //NON-NLS
|
||||
MessageNotifyUtil.Notify.show(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.moduleErr"),
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.addList.errMsg1.msg"),
|
||||
@ -300,7 +300,7 @@ abstract class KeywordSearchListsAbstract {
|
||||
try {
|
||||
changeSupport.firePropertyChange(ListsEvt.LIST_UPDATED.toString(), null, name);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e); //NON-NLS
|
||||
MessageNotifyUtil.Notify.show(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.moduleErr"),
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.addList.errMsg2.msg"),
|
||||
@ -349,7 +349,7 @@ abstract class KeywordSearchListsAbstract {
|
||||
try {
|
||||
changeSupport.firePropertyChange(ListsEvt.LIST_ADDED.toString(), null, list.getName());
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e); //NON-NLS
|
||||
MessageNotifyUtil.Notify.show(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.moduleErr"),
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.saveList.errMsg1.msg"),
|
||||
@ -360,7 +360,7 @@ abstract class KeywordSearchListsAbstract {
|
||||
try {
|
||||
changeSupport.firePropertyChange(ListsEvt.LIST_UPDATED.toString(), null, over.getName());
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e); //NON-NLS
|
||||
MessageNotifyUtil.Notify.show(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.moduleErr"),
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.saveList.errMsg2.msg"),
|
||||
@ -395,7 +395,7 @@ abstract class KeywordSearchListsAbstract {
|
||||
try {
|
||||
changeSupport.firePropertyChange(ListsEvt.LIST_ADDED.toString(), null, list.getName());
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e); //NON-NLS
|
||||
MessageNotifyUtil.Notify.show(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.moduleErr"),
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.writeLists.errMsg1.msg"),
|
||||
@ -408,7 +408,7 @@ abstract class KeywordSearchListsAbstract {
|
||||
try {
|
||||
changeSupport.firePropertyChange(ListsEvt.LIST_UPDATED.toString(), null, over.getName());
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e); //NON-NLS
|
||||
MessageNotifyUtil.Notify.show(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.moduleErr"),
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.writeLists.errMsg2.msg"),
|
||||
@ -434,7 +434,7 @@ abstract class KeywordSearchListsAbstract {
|
||||
try {
|
||||
changeSupport.firePropertyChange(ListsEvt.LIST_DELETED.toString(), null, name);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearchListsAbstract listener threw exception", e); //NON-NLS
|
||||
MessageNotifyUtil.Notify.show(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.moduleErr"),
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsAbstract.deleteList.errMsg1.msg"),
|
||||
|
@ -130,7 +130,7 @@ class KeywordSearchListsEncase extends KeywordSearchListsAbstract{
|
||||
@Override
|
||||
public boolean load() {
|
||||
try {
|
||||
BufferedReader readBuffer = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), "utf-16"));
|
||||
BufferedReader readBuffer = new BufferedReader(new InputStreamReader(new FileInputStream(filePath), "utf-16")); //NON-NLS
|
||||
String structLine;
|
||||
String metaLine;
|
||||
entriesUnsorted = new ArrayList<>();
|
||||
@ -161,9 +161,9 @@ class KeywordSearchListsEncase extends KeywordSearchListsAbstract{
|
||||
return true;
|
||||
|
||||
} catch (FileNotFoundException ex) {
|
||||
logger.log(Level.INFO, "File at " + filePath + " does not exist!", ex);
|
||||
logger.log(Level.INFO, "File at " + filePath + " does not exist!", ex); //NON-NLS
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.INFO, "Failed to read file at " + filePath, ex);
|
||||
logger.log(Level.INFO, "Failed to read file at " + filePath, ex); //NON-NLS
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ class KeywordSearchListsManagementPanel extends javax.swing.JPanel implements Op
|
||||
});
|
||||
jScrollPane1.setViewportView(listsTable);
|
||||
|
||||
newListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/new16.png"))); // NOI18N
|
||||
newListButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/new16.png"))); // NOI18N NON-NLS
|
||||
newListButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchListsManagementPanel.class, "KeywordSearchListsManagementPanel.newListButton.text")); // NOI18N
|
||||
newListButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
@ -121,7 +121,7 @@ class KeywordSearchListsManagementPanel extends javax.swing.JPanel implements Op
|
||||
}
|
||||
});
|
||||
|
||||
importButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/import16.png"))); // NOI18N
|
||||
importButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/import16.png"))); // NOI18N NON-NLS
|
||||
importButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchListsManagementPanel.class, "KeywordSearchListsManagementPanel.importButton.text")); // NOI18N
|
||||
importButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
@ -208,7 +208,7 @@ class KeywordSearchListsManagementPanel extends javax.swing.JPanel implements Op
|
||||
private void importButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_importButtonActionPerformed
|
||||
|
||||
JFileChooser chooser = new JFileChooser();
|
||||
final String[] EXTENSION = new String[]{"xml", "txt"};
|
||||
final String[] EXTENSION = new String[]{"xml", "txt"}; //NON-NLS
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchListsManagementPanel.fileExtensionFilterLbl"), EXTENSION);
|
||||
chooser.setFileFilter(filter);
|
||||
|
@ -141,7 +141,7 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (ingestRunning) {
|
||||
SearchRunner.getInstance().addKeywordListsToAllJobs(listsTableModel.getSelectedLists());
|
||||
logger.log(Level.INFO, "Submitted enqueued lists to ingest");
|
||||
logger.log(Level.INFO, "Submitted enqueued lists to ingest"); //NON-NLS
|
||||
} else {
|
||||
searchAction(e);
|
||||
}
|
||||
@ -233,7 +233,7 @@ class KeywordSearchListsViewerPanel extends AbstractKeywordSearchPerformer {
|
||||
|
||||
searchAddButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchListsViewerPanel.class, "KeywordSearchListsViewerPanel.searchAddButton.text")); // NOI18N
|
||||
|
||||
ingestIndexLabel.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
|
||||
ingestIndexLabel.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N NON-NLS
|
||||
ingestIndexLabel.setText(org.openide.util.NbBundle.getMessage(KeywordSearchListsViewerPanel.class, "KeywordSearchListsViewerPanel.ingestIndexLabel.text")); // NOI18N
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
|
@ -44,21 +44,21 @@ import org.w3c.dom.NodeList;
|
||||
final class KeywordSearchListsXML extends KeywordSearchListsAbstract {
|
||||
|
||||
private static final Logger xmlListslogger = Logger.getLogger(KeywordSearchListsXML.class.getName());
|
||||
private static final String CUR_LISTS_FILE_NAME = "keywords.xml";
|
||||
private static final String CUR_LISTS_FILE_NAME = "keywords.xml"; //NON-NLS
|
||||
private static String CUR_LISTS_FILE = PlatformUtil.getUserConfigDirectory() + File.separator + CUR_LISTS_FILE_NAME;
|
||||
private static final String XSDFILE = "KeywordsSchema.xsd";
|
||||
private static final String ROOT_EL = "keyword_lists";
|
||||
private static final String LIST_EL = "keyword_list";
|
||||
private static final String LIST_NAME_ATTR = "name";
|
||||
private static final String LIST_CREATE_ATTR = "created";
|
||||
private static final String LIST_MOD_ATTR = "modified";
|
||||
private static final String LIST_USE_FOR_INGEST = "use_for_ingest";
|
||||
private static final String LIST_INGEST_MSGS = "ingest_messages";
|
||||
private static final String KEYWORD_EL = "keyword";
|
||||
private static final String KEYWORD_LITERAL_ATTR = "literal";
|
||||
private static final String KEYWORD_SELECTOR_ATTR = "selector";
|
||||
private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
private static final String ENCODING = "UTF-8";
|
||||
private static final String XSDFILE = "KeywordsSchema.xsd"; //NON-NLS
|
||||
private static final String ROOT_EL = "keyword_lists"; //NON-NLS
|
||||
private static final String LIST_EL = "keyword_list"; //NON-NLS
|
||||
private static final String LIST_NAME_ATTR = "name"; //NON-NLS
|
||||
private static final String LIST_CREATE_ATTR = "created"; //NON-NLS
|
||||
private static final String LIST_MOD_ATTR = "modified"; //NON-NLS
|
||||
private static final String LIST_USE_FOR_INGEST = "use_for_ingest"; //NON-NLS
|
||||
private static final String LIST_INGEST_MSGS = "ingest_messages"; //NON-NLS
|
||||
private static final String KEYWORD_EL = "keyword"; //NON-NLS
|
||||
private static final String KEYWORD_LITERAL_ATTR = "literal"; //NON-NLS
|
||||
private static final String KEYWORD_SELECTOR_ATTR = "selector"; //NON-NLS
|
||||
private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; //NON-NLS
|
||||
private static final String ENCODING = "UTF-8"; //NON-NLS
|
||||
private static KeywordSearchListsXML currentInstance = null;
|
||||
private DateFormat dateFormatter;
|
||||
|
||||
@ -127,7 +127,7 @@ final class KeywordSearchListsXML extends KeywordSearchListsAbstract {
|
||||
|
||||
for (Keyword keyword : keywords) {
|
||||
Element keywordEl = doc.createElement(KEYWORD_EL);
|
||||
String literal = keyword.isLiteral()?"true":"false";
|
||||
String literal = keyword.isLiteral()?"true":"false"; //NON-NLS
|
||||
keywordEl.setAttribute(KEYWORD_LITERAL_ATTR, literal);
|
||||
BlackboardAttribute.ATTRIBUTE_TYPE selectorType = keyword.getType();
|
||||
if (selectorType != null) {
|
||||
@ -141,7 +141,7 @@ final class KeywordSearchListsXML extends KeywordSearchListsAbstract {
|
||||
|
||||
success = XMLUtil.saveDoc(KeywordSearchListsXML.class, filePath, ENCODING, doc);
|
||||
} catch (ParserConfigurationException e) {
|
||||
xmlListslogger.log(Level.SEVERE, "Error saving keyword list: can't initialize parser.", e);
|
||||
xmlListslogger.log(Level.SEVERE, "Error saving keyword list: can't initialize parser.", e); //NON-NLS
|
||||
}
|
||||
return success;
|
||||
}
|
||||
@ -158,7 +158,7 @@ final class KeywordSearchListsXML extends KeywordSearchListsAbstract {
|
||||
|
||||
Element root = doc.getDocumentElement();
|
||||
if (root == null) {
|
||||
xmlListslogger.log(Level.SEVERE, "Error loading keyword list: invalid file format.");
|
||||
xmlListslogger.log(Level.SEVERE, "Error loading keyword list: invalid file format."); //NON-NLS
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
@ -200,7 +200,7 @@ final class KeywordSearchListsXML extends KeywordSearchListsAbstract {
|
||||
for (int j = 0; j < numKeywords; ++j) {
|
||||
Element wordEl = (Element) wordsNList.item(j);
|
||||
String literal = wordEl.getAttribute(KEYWORD_LITERAL_ATTR);
|
||||
boolean isLiteral = literal.equals("true");
|
||||
boolean isLiteral = literal.equals("true"); //NON-NLS
|
||||
Keyword keyword = new Keyword(wordEl.getTextContent(), isLiteral);
|
||||
String selector = wordEl.getAttribute(KEYWORD_SELECTOR_ATTR);
|
||||
if (! selector.equals("")) {
|
||||
@ -214,7 +214,7 @@ final class KeywordSearchListsXML extends KeywordSearchListsAbstract {
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
//error parsing dates
|
||||
xmlListslogger.log(Level.SEVERE, "Error loading keyword list: can't parse dates.", e);
|
||||
xmlListslogger.log(Level.SEVERE, "Error loading keyword list: can't parse dates.", e); //NON-NLS
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -39,7 +39,7 @@ import org.sleuthkit.autopsy.ingest.IngestModuleGlobalSetttingsPanel;
|
||||
@ServiceProvider(service = IngestModuleFactory.class)
|
||||
public class KeywordSearchModuleFactory extends IngestModuleFactoryAdapter {
|
||||
|
||||
private static final HashSet<String> defaultDisabledKeywordListNames = new HashSet<>(Arrays.asList("Phone Numbers", "IP Addresses", "URLs"));
|
||||
private static final HashSet<String> defaultDisabledKeywordListNames = new HashSet<>(Arrays.asList("Phone Numbers", "IP Addresses", "URLs")); //NON-NLS
|
||||
private KeywordSearchJobSettingsPanel jobSettingsPanel = null;
|
||||
|
||||
@Override
|
||||
|
@ -103,7 +103,7 @@ public final class KeywordSearchOptionsPanelController extends OptionsPanelContr
|
||||
try {
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_CHANGED, false, true);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearchOptionsPanelController listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearchOptionsPanelController listener threw exception", e); //NON-NLS
|
||||
MessageNotifyUtil.Notify.show(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchOptionsPanelController.moduleErr"),
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchOptionsPanelController.moduleErr.msg1"),
|
||||
@ -113,7 +113,7 @@ public final class KeywordSearchOptionsPanelController extends OptionsPanelContr
|
||||
try {
|
||||
pcs.firePropertyChange(OptionsPanelController.PROP_VALID, null, null);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.SEVERE, "KeywordSearchOptionsPanelController listener threw exception", e);
|
||||
logger.log(Level.SEVERE, "KeywordSearchOptionsPanelController listener threw exception", e); //NON-NLS
|
||||
MessageNotifyUtil.Notify.show(
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchOptionsPanelController.moduleErr"),
|
||||
NbBundle.getMessage(this.getClass(), "KeywordSearchOptionsPanelController.moduleErr.msg2"),
|
||||
|
@ -143,13 +143,13 @@ class KeywordSearchPanel extends javax.swing.JPanel {
|
||||
|
||||
setOpaque(false);
|
||||
|
||||
listsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon.png"))); // NOI18N
|
||||
listsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon.png"))); // NOI18N NON-NLS
|
||||
listsButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchPanel.class, "ListBundleName")); // NOI18N
|
||||
listsButton.setBorderPainted(false);
|
||||
listsButton.setContentAreaFilled(false);
|
||||
listsButton.setEnabled(false);
|
||||
listsButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon-rollover.png"))); // NOI18N
|
||||
listsButton.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon-pressed.png"))); // NOI18N
|
||||
listsButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon-rollover.png"))); // NOI18N NON-NLS
|
||||
listsButton.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/watchbutton-icon-pressed.png"))); // NOI18N NON-NLS
|
||||
listsButton.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mousePressed(java.awt.event.MouseEvent evt) {
|
||||
listsButtonMousePressed(evt);
|
||||
@ -161,7 +161,7 @@ class KeywordSearchPanel extends javax.swing.JPanel {
|
||||
}
|
||||
});
|
||||
|
||||
searchDropButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/searchbutton-icon.png"))); // NOI18N
|
||||
searchDropButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/searchbutton-icon.png"))); // NOI18N NON-NLS
|
||||
searchDropButton.setText(org.openide.util.NbBundle.getMessage(KeywordSearchPanel.class, "KeywordSearchPanel.searchDropButton.text")); // NOI18N
|
||||
searchDropButton.setBorderPainted(false);
|
||||
searchDropButton.setContentAreaFilled(false);
|
||||
@ -169,8 +169,8 @@ class KeywordSearchPanel extends javax.swing.JPanel {
|
||||
searchDropButton.setMaximumSize(new java.awt.Dimension(146, 27));
|
||||
searchDropButton.setMinimumSize(new java.awt.Dimension(146, 27));
|
||||
searchDropButton.setPreferredSize(new java.awt.Dimension(146, 27));
|
||||
searchDropButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/searchbutton-icon-rollover.png"))); // NOI18N
|
||||
searchDropButton.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/searchbutton-icon-pressed.png"))); // NOI18N
|
||||
searchDropButton.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/searchbutton-icon-rollover.png"))); // NOI18N NON-NLS
|
||||
searchDropButton.setRolloverSelectedIcon(new javax.swing.ImageIcon(getClass().getResource("/org/sleuthkit/autopsy/keywordsearch/searchbutton-icon-pressed.png"))); // NOI18N NON-NLS
|
||||
searchDropButton.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mousePressed(java.awt.event.MouseEvent evt) {
|
||||
searchDropButtonMousePressed(evt);
|
||||
@ -247,10 +247,10 @@ class KeywordSearchPanel extends javax.swing.JPanel {
|
||||
//setFilesIndexed(numIndexedFiles);
|
||||
}
|
||||
catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.SEVERE, "Error executing Solr query, " + ex);
|
||||
logger.log(Level.SEVERE, "Error executing Solr query, " + ex); //NON-NLS
|
||||
}
|
||||
catch (KeywordSearchModuleException se) {
|
||||
logger.log(Level.SEVERE, "Error executing Solr query, " + se.getMessage());
|
||||
logger.log(Level.SEVERE, "Error executing Solr query, " + se.getMessage()); //NON-NLS
|
||||
}
|
||||
break;
|
||||
case STOPPED:
|
||||
|
@ -192,7 +192,7 @@ class KeywordSearchQueryManager {
|
||||
boolean allValid = true;
|
||||
for (KeywordSearchQuery tcq : queryDelegates) {
|
||||
if (!tcq.validate()) {
|
||||
logger.log(Level.WARNING, "Query has invalid syntax: {0}", tcq.getQueryString());
|
||||
logger.log(Level.WARNING, "Query has invalid syntax: {0}", tcq.getQueryString()); //NON-NLS
|
||||
allValid = false;
|
||||
break;
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQuery> {
|
||||
try {
|
||||
tcqRes = tcq.performQuery();
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Could not perform the query. ", ex);
|
||||
logger.log(Level.WARNING, "Could not perform the query. ", ex); //NON-NLS
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -425,7 +425,7 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQuery> {
|
||||
try {
|
||||
matchesRes = filesQuery.performQuery();
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Could not perform the query. ", ex);
|
||||
logger.log(Level.WARNING, "Could not perform the query. ", ex); //NON-NLS
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -580,11 +580,11 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQuery> {
|
||||
try {
|
||||
snippet = LuceneQuery.querySnippet(snippetQuery, f.getId(), chunkId, !query.isLiteral(), true);
|
||||
} catch (NoOpenCoreException e) {
|
||||
logger.log(Level.WARNING, "Error querying snippet: " + snippetQuery, e);
|
||||
logger.log(Level.WARNING, "Error querying snippet: " + snippetQuery, e); //NON-NLS
|
||||
//no reason to continie
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Error querying snippet: " + snippetQuery, e);
|
||||
logger.log(Level.WARNING, "Error querying snippet: " + snippetQuery, e); //NON-NLS
|
||||
continue;
|
||||
}
|
||||
if (snippet != null) {
|
||||
@ -608,7 +608,7 @@ class KeywordSearchResultFactory extends ChildFactory<KeyValueQuery> {
|
||||
// test if any exceptions were thrown
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.SEVERE, "Error querying ", ex);
|
||||
logger.log(Level.SEVERE, "Error querying ", ex); //NON-NLS
|
||||
}
|
||||
// catch and ignore if we were cancelled
|
||||
catch (java.util.concurrent.CancellationException ex ) { }
|
||||
|
@ -38,7 +38,7 @@ class KeywordSearchSettings {
|
||||
static final String PROPERTIES_OPTIONS = NbBundle.getMessage(KeywordSearchSettings.class, "KeywordSearchSettings.properties_options.text", MODULE_NAME);
|
||||
static final String PROPERTIES_NSRL = NbBundle.getMessage(KeywordSearchSettings.class, "KeywordSearchSettings.propertiesNSRL.text", MODULE_NAME);
|
||||
static final String PROPERTIES_SCRIPTS = NbBundle.getMessage(KeywordSearchSettings.class, "KeywordSearchSettings.propertiesScripts.text", MODULE_NAME);
|
||||
static final String SHOW_SNIPPETS = "showSnippets";
|
||||
static final String SHOW_SNIPPETS = "showSnippets"; //NON-NLS
|
||||
static final boolean DEFAULT_SHOW_SNIPPETS = true;
|
||||
private static boolean skipKnown = true;
|
||||
private static final Logger logger = Logger.getLogger(KeywordSearchSettings.class.getName());
|
||||
@ -52,11 +52,11 @@ class KeywordSearchSettings {
|
||||
* @return KeywordSearchIngestModule's update frequency
|
||||
*/
|
||||
static UpdateFrequency getUpdateFrequency() {
|
||||
if (ModuleSettings.getConfigSetting(PROPERTIES_OPTIONS, "UpdateFrequency") != null) {
|
||||
return UpdateFrequency.valueOf(ModuleSettings.getConfigSetting(PROPERTIES_OPTIONS, "UpdateFrequency"));
|
||||
if (ModuleSettings.getConfigSetting(PROPERTIES_OPTIONS, "UpdateFrequency") != null) { //NON-NLS
|
||||
return UpdateFrequency.valueOf(ModuleSettings.getConfigSetting(PROPERTIES_OPTIONS, "UpdateFrequency")); //NON-NLS
|
||||
}
|
||||
//if it failed, return the default/last known value
|
||||
logger.log(Level.WARNING, "Could not read property for UpdateFrequency, returning backup value.");
|
||||
logger.log(Level.WARNING, "Could not read property for UpdateFrequency, returning backup value."); //NON-NLS
|
||||
return UpdateFrequency.DEFAULT;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ class KeywordSearchSettings {
|
||||
* @param freq Sets KeywordSearchIngestModule to this value.
|
||||
*/
|
||||
static void setUpdateFrequency(UpdateFrequency freq) {
|
||||
ModuleSettings.setConfigSetting(PROPERTIES_OPTIONS, "UpdateFrequency", freq.name());
|
||||
ModuleSettings.setConfigSetting(PROPERTIES_OPTIONS, "UpdateFrequency", freq.name()); //NON-NLS
|
||||
UpdateFreq = freq;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ class KeywordSearchSettings {
|
||||
* @param skip
|
||||
*/
|
||||
static void setSkipKnown(boolean skip) {
|
||||
ModuleSettings.setConfigSetting(PROPERTIES_NSRL, "SkipKnown", Boolean.toString(skip));
|
||||
ModuleSettings.setConfigSetting(PROPERTIES_NSRL, "SkipKnown", Boolean.toString(skip)); //NON-NLS
|
||||
skipKnown = skip;
|
||||
}
|
||||
|
||||
@ -88,11 +88,11 @@ class KeywordSearchSettings {
|
||||
* @return skip setting
|
||||
*/
|
||||
static boolean getSkipKnown() {
|
||||
if (ModuleSettings.getConfigSetting(PROPERTIES_NSRL, "SkipKnown") != null) {
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(PROPERTIES_NSRL, "SkipKnown"));
|
||||
if (ModuleSettings.getConfigSetting(PROPERTIES_NSRL, "SkipKnown") != null) { //NON-NLS
|
||||
return Boolean.parseBoolean(ModuleSettings.getConfigSetting(PROPERTIES_NSRL, "SkipKnown")); //NON-NLS
|
||||
}
|
||||
//if it fails, return the default/last known value
|
||||
logger.log(Level.WARNING, "Could not read property for SkipKnown, returning backup value.");
|
||||
logger.log(Level.WARNING, "Could not read property for SkipKnown, returning backup value."); //NON-NLS
|
||||
return skipKnown;
|
||||
}
|
||||
|
||||
@ -108,12 +108,12 @@ class KeywordSearchSettings {
|
||||
//Disabling scripts that weren't selected
|
||||
for (String s : ModuleSettings.getConfigSettings(PROPERTIES_SCRIPTS).keySet()) {
|
||||
if (!scripts.contains(StringExtract.StringExtractUnicodeTable.SCRIPT.valueOf(s))) {
|
||||
ModuleSettings.setConfigSetting(PROPERTIES_SCRIPTS, s, "false");
|
||||
ModuleSettings.setConfigSetting(PROPERTIES_SCRIPTS, s, "false"); //NON-NLS
|
||||
}
|
||||
}
|
||||
//Writing and enabling selected scripts
|
||||
for (StringExtract.StringExtractUnicodeTable.SCRIPT s : stringExtractScripts) {
|
||||
ModuleSettings.setConfigSetting(PROPERTIES_SCRIPTS, s.name(), "true");
|
||||
ModuleSettings.setConfigSetting(PROPERTIES_SCRIPTS, s.name(), "true"); //NON-NLS
|
||||
}
|
||||
|
||||
}
|
||||
@ -130,12 +130,12 @@ class KeywordSearchSettings {
|
||||
}
|
||||
|
||||
static void setShowSnippets(boolean showSnippets) {
|
||||
ModuleSettings.setConfigSetting(PROPERTIES_OPTIONS, SHOW_SNIPPETS, (showSnippets ? "true" : "false"));
|
||||
ModuleSettings.setConfigSetting(PROPERTIES_OPTIONS, SHOW_SNIPPETS, (showSnippets ? "true" : "false")); //NON-NLS
|
||||
}
|
||||
|
||||
static boolean getShowSnippets() {
|
||||
if (ModuleSettings.settingExists(PROPERTIES_OPTIONS, SHOW_SNIPPETS)) {
|
||||
return ModuleSettings.getConfigSetting(PROPERTIES_OPTIONS, SHOW_SNIPPETS).equals("true");
|
||||
return ModuleSettings.getConfigSetting(PROPERTIES_OPTIONS, SHOW_SNIPPETS).equals("true"); //NON-NLS
|
||||
} else {
|
||||
return DEFAULT_SHOW_SNIPPETS;
|
||||
}
|
||||
@ -150,14 +150,14 @@ class KeywordSearchSettings {
|
||||
if (ModuleSettings.getConfigSettings(PROPERTIES_SCRIPTS) != null && !ModuleSettings.getConfigSettings(PROPERTIES_SCRIPTS).isEmpty()) {
|
||||
List<SCRIPT> scripts = new ArrayList<>();
|
||||
for (Map.Entry<String, String> kvp : ModuleSettings.getConfigSettings(PROPERTIES_SCRIPTS).entrySet()) {
|
||||
if (kvp.getValue().equals("true")) {
|
||||
if (kvp.getValue().equals("true")) { //NON-NLS
|
||||
scripts.add(SCRIPT.valueOf(kvp.getKey()));
|
||||
}
|
||||
}
|
||||
return scripts;
|
||||
}
|
||||
//if it failed, try to return the built-in list maintained by the singleton.
|
||||
logger.log(Level.WARNING, "Could not read properties for extracting scripts, returning backup values.");
|
||||
logger.log(Level.WARNING, "Could not read properties for extracting scripts, returning backup values."); //NON-NLS
|
||||
return new ArrayList<>(stringExtractScripts);
|
||||
}
|
||||
|
||||
@ -171,7 +171,7 @@ class KeywordSearchSettings {
|
||||
if (ModuleSettings.getConfigSetting(PROPERTIES_OPTIONS, key) != null) {
|
||||
return ModuleSettings.getConfigSetting(PROPERTIES_OPTIONS, key);
|
||||
} else {
|
||||
logger.log(Level.WARNING, "Could not read property for key {0}, returning backup value.", key);
|
||||
logger.log(Level.WARNING, "Could not read property for key {0}, returning backup value.", key); //NON-NLS
|
||||
return stringExtractOptions.get(key);
|
||||
}
|
||||
}
|
||||
@ -185,7 +185,7 @@ class KeywordSearchSettings {
|
||||
Map<String, String> settings = ModuleSettings.getConfigSettings(PROPERTIES_OPTIONS);
|
||||
if (settings == null) {
|
||||
Map<String, String> settingsv2 = new HashMap<>();
|
||||
logger.log(Level.WARNING, "Could not read properties for {0}.properties, returning backup values", PROPERTIES_OPTIONS);
|
||||
logger.log(Level.WARNING, "Could not read properties for {0}.properties, returning backup values", PROPERTIES_OPTIONS); //NON-NLS
|
||||
settingsv2.putAll(stringExtractOptions);
|
||||
return settingsv2;
|
||||
} else {
|
||||
@ -198,30 +198,30 @@ class KeywordSearchSettings {
|
||||
* already exist.
|
||||
*/
|
||||
static void setDefaults() {
|
||||
logger.log(Level.INFO, "Detecting default settings.");
|
||||
logger.log(Level.INFO, "Detecting default settings."); //NON-NLS
|
||||
//setting default NSRL
|
||||
if (!ModuleSettings.settingExists(KeywordSearchSettings.PROPERTIES_NSRL, "SkipKnown")) {
|
||||
logger.log(Level.INFO, "No configuration for NSRL found, generating default...");
|
||||
if (!ModuleSettings.settingExists(KeywordSearchSettings.PROPERTIES_NSRL, "SkipKnown")) { //NON-NLS
|
||||
logger.log(Level.INFO, "No configuration for NSRL found, generating default..."); //NON-NLS
|
||||
KeywordSearchSettings.setSkipKnown(true);
|
||||
}
|
||||
//setting default Update Frequency
|
||||
if (!ModuleSettings.settingExists(KeywordSearchSettings.PROPERTIES_OPTIONS, "UpdateFrequency")) {
|
||||
logger.log(Level.INFO, "No configuration for Update Frequency found, generating default...");
|
||||
if (!ModuleSettings.settingExists(KeywordSearchSettings.PROPERTIES_OPTIONS, "UpdateFrequency")) { //NON-NLS
|
||||
logger.log(Level.INFO, "No configuration for Update Frequency found, generating default..."); //NON-NLS
|
||||
KeywordSearchSettings.setUpdateFrequency(UpdateFrequency.DEFAULT);
|
||||
}
|
||||
//setting default Extract UTF8
|
||||
if (!ModuleSettings.settingExists(KeywordSearchSettings.PROPERTIES_OPTIONS, AbstractFileExtract.ExtractOptions.EXTRACT_UTF8.toString())) {
|
||||
logger.log(Level.INFO, "No configuration for UTF8 found, generating default...");
|
||||
logger.log(Level.INFO, "No configuration for UTF8 found, generating default..."); //NON-NLS
|
||||
KeywordSearchSettings.setStringExtractOption(AbstractFileExtract.ExtractOptions.EXTRACT_UTF8.toString(), Boolean.TRUE.toString());
|
||||
}
|
||||
//setting default Extract UTF16
|
||||
if (!ModuleSettings.settingExists(KeywordSearchSettings.PROPERTIES_OPTIONS, AbstractFileExtract.ExtractOptions.EXTRACT_UTF16.toString())) {
|
||||
logger.log(Level.INFO, "No configuration for UTF16 found, generating defaults...");
|
||||
logger.log(Level.INFO, "No configuration for UTF16 found, generating defaults..."); //NON-NLS
|
||||
KeywordSearchSettings.setStringExtractOption(AbstractFileExtract.ExtractOptions.EXTRACT_UTF16.toString(), Boolean.TRUE.toString());
|
||||
}
|
||||
//setting default Latin-1 Script
|
||||
if (!ModuleSettings.settingExists(KeywordSearchSettings.PROPERTIES_SCRIPTS, SCRIPT.LATIN_1.name())) {
|
||||
logger.log(Level.INFO, "No configuration for Scripts found, generating defaults...");
|
||||
logger.log(Level.INFO, "No configuration for Scripts found, generating defaults..."); //NON-NLS
|
||||
ModuleSettings.setConfigSetting(KeywordSearchSettings.PROPERTIES_SCRIPTS, SCRIPT.LATIN_1.name(), Boolean.toString(true));
|
||||
}
|
||||
}
|
||||
|
@ -141,6 +141,6 @@ class KeywordSearchUtil {
|
||||
*/
|
||||
static boolean isXMLList(String absPath) {
|
||||
//TODO: make this more robust, if necessary
|
||||
return new File(absPath).getName().endsWith(".xml");
|
||||
return new File(absPath).getName().endsWith(".xml"); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ class LuceneQuery implements KeywordSearchQuery {
|
||||
bba = newFsHit.newArtifact(ARTIFACT_TYPE.TSK_KEYWORD_HIT);
|
||||
writeResult = new KeywordWriteResult(bba);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Error adding bb artifact for keyword hit", e);
|
||||
logger.log(Level.WARNING, "Error adding bb artifact for keyword hit", e); //NON-NLS
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ class LuceneQuery implements KeywordSearchQuery {
|
||||
writeResult.add(attributes);
|
||||
return writeResult;
|
||||
} catch (TskException e) {
|
||||
logger.log(Level.WARNING, "Error adding bb attributes to artifact", e);
|
||||
logger.log(Level.WARNING, "Error adding bb attributes to artifact", e); //NON-NLS
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -241,10 +241,10 @@ class LuceneQuery implements KeywordSearchQuery {
|
||||
}
|
||||
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Error executing Lucene Solr Query: " + keywordString, ex);
|
||||
logger.log(Level.WARNING, "Error executing Lucene Solr Query: " + keywordString, ex); //NON-NLS
|
||||
throw ex;
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Error executing Lucene Solr Query: " + keywordString, ex);
|
||||
logger.log(Level.WARNING, "Error executing Lucene Solr Query: " + keywordString, ex); //NON-NLS
|
||||
}
|
||||
|
||||
}
|
||||
@ -284,17 +284,17 @@ class LuceneQuery implements KeywordSearchQuery {
|
||||
q.setHighlightFragsize(SNIPPET_LENGTH);
|
||||
|
||||
//tune the highlighter
|
||||
q.setParam("hl.useFastVectorHighlighter", "on"); //fast highlighter scales better than standard one
|
||||
q.setParam("hl.tag.pre", "«"); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.tag.post", "«"); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.fragListBuilder", "simple"); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.useFastVectorHighlighter", "on"); //fast highlighter scales better than standard one NON-NLS
|
||||
q.setParam("hl.tag.pre", "«"); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
q.setParam("hl.tag.post", "«"); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
q.setParam("hl.fragListBuilder", "simple"); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
|
||||
//Solr bug if fragCharSize is smaller than Query string, StringIndexOutOfBoundsException is thrown.
|
||||
q.setParam("hl.fragCharSize", Integer.toString(theQueryStr.length())); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.fragCharSize", Integer.toString(theQueryStr.length())); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
|
||||
//docs says makes sense for the original Highlighter only, but not really
|
||||
//analyze all content SLOW! consider lowering
|
||||
q.setParam("hl.maxAnalyzedChars", Server.HL_ANALYZE_CHARS_UNLIMITED);
|
||||
q.setParam("hl.maxAnalyzedChars", Server.HL_ANALYZE_CHARS_UNLIMITED); //NON-NLS
|
||||
}
|
||||
|
||||
return q;
|
||||
@ -331,7 +331,7 @@ class LuceneQuery implements KeywordSearchQuery {
|
||||
chit.setSnippet(snippet);
|
||||
}
|
||||
} catch (TskException ex) {
|
||||
logger.log(Level.WARNING, "Could not get the AbstractFile for keyword hit, ", ex);
|
||||
logger.log(Level.WARNING, "Could not get the AbstractFile for keyword hit, ", ex); //NON-NLS
|
||||
//something wrong with case/db
|
||||
throw ex;
|
||||
}
|
||||
@ -346,7 +346,7 @@ class LuceneQuery implements KeywordSearchQuery {
|
||||
chit.setSnippet(snippet);
|
||||
}
|
||||
} catch (TskException ex) {
|
||||
logger.log(Level.WARNING, "Could not get the AbstractFile for keyword hit, ", ex);
|
||||
logger.log(Level.WARNING, "Could not get the AbstractFile for keyword hit, ", ex); //NON-NLS
|
||||
//something wrong with case/db
|
||||
throw ex;
|
||||
}
|
||||
@ -429,17 +429,17 @@ class LuceneQuery implements KeywordSearchQuery {
|
||||
|
||||
|
||||
//tune the highlighter
|
||||
q.setParam("hl.useFastVectorHighlighter", "on"); //fast highlighter scales better than standard one
|
||||
q.setParam("hl.tag.pre", "«"); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.tag.post", "«"); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.fragListBuilder", "simple"); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.useFastVectorHighlighter", "on"); //fast highlighter scales better than standard one NON-NLS
|
||||
q.setParam("hl.tag.pre", "«"); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
q.setParam("hl.tag.post", "«"); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
q.setParam("hl.fragListBuilder", "simple"); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
|
||||
//Solr bug if fragCharSize is smaller than Query string, StringIndexOutOfBoundsException is thrown.
|
||||
q.setParam("hl.fragCharSize", Integer.toString(queryStr.length())); //makes sense for FastVectorHighlighter only
|
||||
q.setParam("hl.fragCharSize", Integer.toString(queryStr.length())); //makes sense for FastVectorHighlighter only NON-NLS
|
||||
|
||||
//docs says makes sense for the original Highlighter only, but not really
|
||||
//analyze all content SLOW! consider lowering
|
||||
q.setParam("hl.maxAnalyzedChars", Server.HL_ANALYZE_CHARS_UNLIMITED);
|
||||
q.setParam("hl.maxAnalyzedChars", Server.HL_ANALYZE_CHARS_UNLIMITED); //NON-NLS
|
||||
|
||||
try {
|
||||
QueryResponse response = solrServer.query(q, METHOD.POST);
|
||||
@ -456,10 +456,10 @@ class LuceneQuery implements KeywordSearchQuery {
|
||||
return EscapeUtil.unEscapeHtml(contentHighlights.get(0)).trim();
|
||||
}
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Error executing Lucene Solr Query: " + query, ex);
|
||||
logger.log(Level.WARNING, "Error executing Lucene Solr Query: " + query, ex); //NON-NLS
|
||||
throw ex;
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Error executing Lucene Solr Query: " + query, ex);
|
||||
logger.log(Level.WARNING, "Error executing Lucene Solr Query: " + query, ex); //NON-NLS
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ public final class SearchRunner {
|
||||
*/
|
||||
public synchronized void startJob(long jobId, long dataSourceId, List<String> keywordListNames) {
|
||||
if (!jobs.containsKey(jobId)) {
|
||||
logger.log(Level.INFO, "Adding job {0}", jobId);
|
||||
logger.log(Level.INFO, "Adding job {0}", jobId); //NON-NLS
|
||||
SearchJobInfo jobData = new SearchJobInfo(jobId, dataSourceId, keywordListNames);
|
||||
jobs.put(jobId, jobData);
|
||||
}
|
||||
@ -136,7 +136,7 @@ public final class SearchRunner {
|
||||
* @param jobId
|
||||
*/
|
||||
public void stopJob(long jobId) {
|
||||
logger.log(Level.INFO, "Stopping job {0}", jobId);
|
||||
logger.log(Level.INFO, "Stopping job {0}", jobId); //NON-NLS
|
||||
commit();
|
||||
|
||||
SearchJobInfo job;
|
||||
@ -162,7 +162,7 @@ public final class SearchRunner {
|
||||
*/
|
||||
public synchronized void addKeywordListsToAllJobs(List<String> keywordListNames) {
|
||||
for(String listName : keywordListNames) {
|
||||
logger.log(Level.INFO, "Adding keyword list {0} to all jobs", listName);
|
||||
logger.log(Level.INFO, "Adding keyword list {0} to all jobs", listName); //NON-NLS
|
||||
for(SearchJobInfo j : jobs.values()) {
|
||||
j.addKeywordListName(listName);
|
||||
}
|
||||
@ -180,7 +180,7 @@ public final class SearchRunner {
|
||||
final int numIndexedFiles = KeywordSearch.getServer().queryNumIndexedFiles();
|
||||
KeywordSearch.fireNumIndexedFilesChange(null, new Integer(numIndexedFiles));
|
||||
} catch (NoOpenCoreException | KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Error executing Solr query to check number of indexed files: ", ex);
|
||||
logger.log(Level.WARNING, "Error executing Solr query to check number of indexed files: ", ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ public final class SearchRunner {
|
||||
*/
|
||||
private void doFinalSearch(SearchJobInfo job) {
|
||||
// Run one last search as there are probably some new files committed
|
||||
logger.log(Level.INFO, "Running final search for jobid {0}", job.getJobId());
|
||||
logger.log(Level.INFO, "Running final search for jobid {0}", job.getJobId()); //NON-NLS
|
||||
if (!job.getKeywordListNames().isEmpty()) {
|
||||
try {
|
||||
// In case this job still has a worker running, wait for it to finish
|
||||
@ -205,7 +205,7 @@ public final class SearchRunner {
|
||||
finalSearcher.get();
|
||||
|
||||
} catch (InterruptedException | ExecutionException ex) {
|
||||
logger.log(Level.WARNING, "Job {1} final search thread failed: {2}", new Object[]{job.getJobId(), ex});
|
||||
logger.log(Level.WARNING, "Job {1} final search thread failed: {2}", new Object[]{job.getJobId(), ex}); //NON-NLS
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -381,7 +381,7 @@ public final class SearchRunner {
|
||||
progressGroup = AggregateProgressFactory.createSystemHandle(pgDisplayName, null, new Cancellable() {
|
||||
@Override
|
||||
public boolean cancel() {
|
||||
logger.log(Level.INFO, "Cancelling the searcher by user.");
|
||||
logger.log(Level.INFO, "Cancelling the searcher by user."); //NON-NLS
|
||||
if (progressGroup != null) {
|
||||
progressGroup.setDisplayName(displayName + " (" + NbBundle.getMessage(this.getClass(), "SearchRunner.doInBackGround.cancelMsg") + "...)");
|
||||
}
|
||||
@ -410,7 +410,7 @@ public final class SearchRunner {
|
||||
|
||||
for (Keyword keywordQuery : keywords) {
|
||||
if (this.isCancelled()) {
|
||||
logger.log(Level.INFO, "Cancel detected, bailing before new keyword processed: {0}", keywordQuery.getQuery());
|
||||
logger.log(Level.INFO, "Cancel detected, bailing before new keyword processed: {0}", keywordQuery.getQuery()); //NON-NLS
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -444,16 +444,16 @@ public final class SearchRunner {
|
||||
try {
|
||||
queryResult = del.performQuery();
|
||||
} catch (NoOpenCoreException ex) {
|
||||
logger.log(Level.WARNING, "Error performing query: " + keywordQuery.getQuery(), ex);
|
||||
logger.log(Level.WARNING, "Error performing query: " + keywordQuery.getQuery(), ex); //NON-NLS
|
||||
//no reason to continue with next query if recovery failed
|
||||
//or wait for recovery to kick in and run again later
|
||||
//likely case has closed and threads are being interrupted
|
||||
return null;
|
||||
} catch (CancellationException e) {
|
||||
logger.log(Level.INFO, "Cancel detected, bailing during keyword query: {0}", keywordQuery.getQuery());
|
||||
logger.log(Level.INFO, "Cancel detected, bailing during keyword query: {0}", keywordQuery.getQuery()); //NON-NLS
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Error performing query: " + keywordQuery.getQuery(), e);
|
||||
logger.log(Level.WARNING, "Error performing query: " + keywordQuery.getQuery(), e); //NON-NLS
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -482,7 +482,7 @@ public final class SearchRunner {
|
||||
for (final Keyword hitTerm : newResults.keySet()) {
|
||||
//checking for cancellation between results
|
||||
if (this.isCancelled()) {
|
||||
logger.log(Level.INFO, "Cancel detected, bailing before new hit processed for query: {0}", keywordQuery.getQuery());
|
||||
logger.log(Level.INFO, "Cancel detected, bailing before new hit processed for query: {0}", keywordQuery.getQuery()); //NON-NLS
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -504,18 +504,18 @@ public final class SearchRunner {
|
||||
try {
|
||||
snippet = LuceneQuery.querySnippet(snippetQuery, hitFile.getId(), chunkId, isRegex, true);
|
||||
} catch (NoOpenCoreException e) {
|
||||
logger.log(Level.WARNING, "Error querying snippet: " + snippetQuery, e);
|
||||
logger.log(Level.WARNING, "Error querying snippet: " + snippetQuery, e); //NON-NLS
|
||||
//no reason to continue
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Error querying snippet: " + snippetQuery, e);
|
||||
logger.log(Level.WARNING, "Error querying snippet: " + snippetQuery, e); //NON-NLS
|
||||
continue;
|
||||
}
|
||||
|
||||
// write the blackboard artifact for this keyword in this file
|
||||
KeywordWriteResult written = del.writeToBlackBoard(hitTerm.getQuery(), hitFile, snippet, listName);
|
||||
if (written == null) {
|
||||
logger.log(Level.WARNING, "BB artifact for keyword hit not written, file: {0}, hit: {1}", new Object[]{hitFile, hitTerm.toString()});
|
||||
logger.log(Level.WARNING, "BB artifact for keyword hit not written, file: {0}, hit: {1}", new Object[]{hitFile, hitTerm.toString()}); //NON-NLS
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -540,46 +540,46 @@ public final class SearchRunner {
|
||||
}
|
||||
|
||||
//details
|
||||
detailsSb.append("<table border='0' cellpadding='4' width='280'>");
|
||||
detailsSb.append("<table border='0' cellpadding='4' width='280'>"); //NON-NLS
|
||||
//hit
|
||||
detailsSb.append("<tr>");
|
||||
detailsSb.append("<tr>"); //NON-NLS
|
||||
detailsSb.append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.kwHitThLbl"));
|
||||
detailsSb.append("<td>").append(EscapeUtil.escapeHtml(attr.getValueString())).append("</td>");
|
||||
detailsSb.append("</tr>");
|
||||
detailsSb.append("<td>").append(EscapeUtil.escapeHtml(attr.getValueString())).append("</td>"); //NON-NLS
|
||||
detailsSb.append("</tr>"); //NON-NLS
|
||||
|
||||
//preview
|
||||
attr = written.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_PREVIEW.getTypeID());
|
||||
if (attr != null) {
|
||||
detailsSb.append("<tr>");
|
||||
detailsSb.append("<tr>"); //NON-NLS
|
||||
detailsSb.append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.previewThLbl"));
|
||||
detailsSb.append("<td>").append(EscapeUtil.escapeHtml(attr.getValueString())).append("</td>");
|
||||
detailsSb.append("</tr>");
|
||||
detailsSb.append("<td>").append(EscapeUtil.escapeHtml(attr.getValueString())).append("</td>"); //NON-NLS
|
||||
detailsSb.append("</tr>"); //NON-NLS
|
||||
}
|
||||
|
||||
//file
|
||||
detailsSb.append("<tr>");
|
||||
detailsSb.append("<tr>"); //NON-NLS
|
||||
detailsSb.append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.fileThLbl"));
|
||||
detailsSb.append("<td>").append(hitFile.getParentPath()).append(hitFile.getName()).append("</td>");
|
||||
detailsSb.append("</tr>");
|
||||
detailsSb.append("<td>").append(hitFile.getParentPath()).append(hitFile.getName()).append("</td>"); //NON-NLS
|
||||
detailsSb.append("</tr>"); //NON-NLS
|
||||
|
||||
//list
|
||||
attr = written.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_SET_NAME.getTypeID());
|
||||
detailsSb.append("<tr>");
|
||||
detailsSb.append("<tr>"); //NON-NLS
|
||||
detailsSb.append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.listThLbl"));
|
||||
detailsSb.append("<td>").append(attr.getValueString()).append("</td>");
|
||||
detailsSb.append("</tr>");
|
||||
detailsSb.append("<td>").append(attr.getValueString()).append("</td>"); //NON-NLS
|
||||
detailsSb.append("</tr>"); //NON-NLS
|
||||
|
||||
//regex
|
||||
if (!keywordQuery.isLiteral()) {
|
||||
attr = written.getAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_KEYWORD_REGEXP.getTypeID());
|
||||
if (attr != null) {
|
||||
detailsSb.append("<tr>");
|
||||
detailsSb.append("<tr>"); //NON-NLS
|
||||
detailsSb.append(NbBundle.getMessage(this.getClass(), "KeywordSearchIngestModule.regExThLbl"));
|
||||
detailsSb.append("<td>").append(attr.getValueString()).append("</td>");
|
||||
detailsSb.append("</tr>");
|
||||
detailsSb.append("<td>").append(attr.getValueString()).append("</td>"); //NON-NLS
|
||||
detailsSb.append("</tr>"); //NON-NLS
|
||||
}
|
||||
}
|
||||
detailsSb.append("</table>");
|
||||
detailsSb.append("</table>"); //NON-NLS
|
||||
|
||||
services.postMessage(IngestMessage.createDataMessage(KeywordSearchModuleFactory.getModuleName(), subjectSb.toString(), detailsSb.toString(), uniqueKey, written.getArtifact()));
|
||||
}
|
||||
@ -604,13 +604,13 @@ public final class SearchRunner {
|
||||
|
||||
} //end try block
|
||||
catch (Exception ex) {
|
||||
logger.log(Level.WARNING, "searcher exception occurred", ex);
|
||||
logger.log(Level.WARNING, "searcher exception occurred", ex); //NON-NLS
|
||||
} finally {
|
||||
try {
|
||||
finalizeSearcher();
|
||||
stopWatch.stop();
|
||||
|
||||
logger.log(Level.INFO, "Searcher took to run: {0} secs.", stopWatch.getElapsedTimeSecs());
|
||||
logger.log(Level.INFO, "Searcher took to run: {0} secs.", stopWatch.getElapsedTimeSecs()); //NON-NLS
|
||||
} finally {
|
||||
// In case a thread is waiting on this worker to be done
|
||||
job.searchNotify();
|
||||
@ -626,7 +626,7 @@ public final class SearchRunner {
|
||||
try {
|
||||
get();
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
logger.log(Level.SEVERE, "Error performing keyword search: " + e.getMessage());
|
||||
logger.log(Level.SEVERE, "Error performing keyword search: " + e.getMessage()); //NON-NLS
|
||||
services.postMessage(IngestMessage.createErrorMessage(KeywordSearchModuleFactory.getModuleName(), "Error performing keyword search", e.getMessage()));
|
||||
} // catch and ignore if we were cancelled
|
||||
catch (java.util.concurrent.CancellationException ex) {
|
||||
|
@ -72,65 +72,65 @@ public class Server {
|
||||
ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "id";
|
||||
return "id"; //NON-NLS
|
||||
}
|
||||
},
|
||||
IMAGE_ID {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "image_id";
|
||||
return "image_id"; //NON-NLS
|
||||
}
|
||||
},
|
||||
CONTENT {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "content";
|
||||
return "content"; //NON-NLS
|
||||
}
|
||||
},
|
||||
CONTENT_WS {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "content_ws";
|
||||
return "content_ws"; //NON-NLS
|
||||
}
|
||||
},
|
||||
FILE_NAME {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "file_name";
|
||||
return "file_name"; //NON-NLS
|
||||
}
|
||||
},
|
||||
// note that we no longer index this field
|
||||
CTIME {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ctime";
|
||||
return "ctime"; //NON-NLS
|
||||
}
|
||||
},
|
||||
// note that we no longer index this field
|
||||
ATIME {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "atime";
|
||||
return "atime"; //NON-NLS
|
||||
}
|
||||
},
|
||||
// note that we no longer index this field
|
||||
MTIME {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "mtime";
|
||||
return "mtime"; //NON-NLS
|
||||
}
|
||||
},
|
||||
// note that we no longer index this field
|
||||
CRTIME {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "crtime";
|
||||
return "crtime"; //NON-NLS
|
||||
}
|
||||
},
|
||||
NUM_CHUNKS {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "num_chunks";
|
||||
return "num_chunks"; //NON-NLS
|
||||
}
|
||||
},
|
||||
};
|
||||
@ -138,19 +138,19 @@ public class Server {
|
||||
//max content size we can send to Solr
|
||||
public static final long MAX_CONTENT_SIZE = 1L * 1024 * 1024 * 1024;
|
||||
private static final Logger logger = Logger.getLogger(Server.class.getName());
|
||||
private static final String DEFAULT_CORE_NAME = "coreCase";
|
||||
private static final String DEFAULT_CORE_NAME = "coreCase"; //NON-NLS
|
||||
// TODO: DEFAULT_CORE_NAME needs to be replaced with unique names to support multiple open cases
|
||||
public static final String CORE_EVT = "CORE_EVT";
|
||||
public static final String CORE_EVT = "CORE_EVT"; //NON-NLS
|
||||
public static final char ID_CHUNK_SEP = '_';
|
||||
private String javaPath = "java";
|
||||
private String javaPath = "java"; //NON-NLS
|
||||
public static final Charset DEFAULT_INDEXED_TEXT_CHARSET = Charset.forName("UTF-8"); ///< default Charset to index text as
|
||||
private static final int MAX_SOLR_MEM_MB = 512; //TODO set dynamically based on avail. system resources
|
||||
private Process curSolrProcess = null;
|
||||
private static Ingester ingester = null;
|
||||
static final String PROPERTIES_FILE = KeywordSearchSettings.MODULE_NAME;
|
||||
static final String PROPERTIES_CURRENT_SERVER_PORT = "IndexingServerPort";
|
||||
static final String PROPERTIES_CURRENT_STOP_PORT = "IndexingServerStopPort";
|
||||
private static final String KEY = "jjk#09s";
|
||||
static final String PROPERTIES_CURRENT_SERVER_PORT = "IndexingServerPort"; //NON-NLS
|
||||
static final String PROPERTIES_CURRENT_STOP_PORT = "IndexingServerStopPort"; //NON-NLS
|
||||
private static final String KEY = "jjk#09s"; //NON-NLS
|
||||
static final int DEFAULT_SOLR_SERVER_PORT = 23232;
|
||||
static final int DEFAULT_SOLR_STOP_PORT = 34343;
|
||||
private int currentSolrServerPort = 0;
|
||||
@ -176,14 +176,14 @@ public class Server {
|
||||
Server() {
|
||||
initSettings();
|
||||
|
||||
this.solrUrl = "http://localhost:" + currentSolrServerPort + "/solr";
|
||||
this.solrUrl = "http://localhost:" + currentSolrServerPort + "/solr"; //NON-NLS
|
||||
this.solrServer = new HttpSolrServer(solrUrl);
|
||||
serverAction = new ServerAction();
|
||||
solrFolder = InstalledFileLocator.getDefault().locate("solr", Server.class.getPackage().getName(), false);
|
||||
instanceDir = solrFolder.getAbsolutePath() + File.separator + "solr";
|
||||
solrFolder = InstalledFileLocator.getDefault().locate("solr", Server.class.getPackage().getName(), false); //NON-NLS
|
||||
instanceDir = solrFolder.getAbsolutePath() + File.separator + "solr"; //NON-NLS
|
||||
javaPath = PlatformUtil.getJavaPath();
|
||||
|
||||
logger.log(Level.INFO, "Created Server instance");
|
||||
logger.log(Level.INFO, "Created Server instance"); //NON-NLS
|
||||
}
|
||||
|
||||
private void initSettings() {
|
||||
@ -191,7 +191,7 @@ public class Server {
|
||||
try {
|
||||
currentSolrServerPort = Integer.decode(ModuleSettings.getConfigSetting(PROPERTIES_FILE, PROPERTIES_CURRENT_SERVER_PORT));
|
||||
} catch (NumberFormatException nfe) {
|
||||
logger.log(Level.WARNING, "Could not decode indexing server port, value was not a valid port number, using the default. ", nfe);
|
||||
logger.log(Level.WARNING, "Could not decode indexing server port, value was not a valid port number, using the default. ", nfe); //NON-NLS
|
||||
currentSolrServerPort = DEFAULT_SOLR_SERVER_PORT;
|
||||
}
|
||||
} else {
|
||||
@ -203,7 +203,7 @@ public class Server {
|
||||
try {
|
||||
currentSolrStopPort = Integer.decode(ModuleSettings.getConfigSetting(PROPERTIES_FILE, PROPERTIES_CURRENT_STOP_PORT));
|
||||
} catch (NumberFormatException nfe) {
|
||||
logger.log(Level.WARNING, "Could not decode indexing server stop port, value was not a valid port number, using default", nfe);
|
||||
logger.log(Level.WARNING, "Could not decode indexing server stop port, value was not a valid port number, using default", nfe); //NON-NLS
|
||||
currentSolrStopPort = DEFAULT_SOLR_STOP_PORT;
|
||||
}
|
||||
} else {
|
||||
@ -243,8 +243,8 @@ public class Server {
|
||||
this.stream = stream;
|
||||
try {
|
||||
final String log = Places.getUserDirectory().getAbsolutePath()
|
||||
+ File.separator + "var" + File.separator + "log"
|
||||
+ File.separator + "solr.log." + type;
|
||||
+ File.separator + "var" + File.separator + "log" //NON-NLS
|
||||
+ File.separator + "solr.log." + type; //NON-NLS
|
||||
File outputFile = new File(log.concat(".0"));
|
||||
File first = new File(log.concat(".1"));
|
||||
File second = new File(log.concat(".2"));
|
||||
@ -262,7 +262,7 @@ public class Server {
|
||||
out = new FileOutputStream(outputFile);
|
||||
|
||||
} catch (Exception ex) {
|
||||
logger.log(Level.WARNING, "Failed to create solr log file", ex);
|
||||
logger.log(Level.WARNING, "Failed to create solr log file", ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -290,20 +290,20 @@ public class Server {
|
||||
}
|
||||
bw.flush();
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Error redirecting Solr output stream");
|
||||
logger.log(Level.WARNING, "Error redirecting Solr output stream"); //NON-NLS
|
||||
} finally {
|
||||
if (bw != null) {
|
||||
try {
|
||||
bw.close();
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Error closing Solr output stream writer");
|
||||
logger.log(Level.WARNING, "Error closing Solr output stream writer"); //NON-NLS
|
||||
}
|
||||
}
|
||||
if (br != null) {
|
||||
try {
|
||||
br.close();
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.WARNING, "Error closing Solr output stream reader");
|
||||
logger.log(Level.WARNING, "Error closing Solr output stream reader"); //NON-NLS
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -319,7 +319,7 @@ public class Server {
|
||||
List<Long> pids = new ArrayList<Long>();
|
||||
|
||||
//NOTE: these needs to be in sync with process start string in start()
|
||||
final String pidsQuery = "Args.4.eq=-DSTOP.KEY=" + KEY + ",Args.7.eq=start.jar";
|
||||
final String pidsQuery = "Args.4.eq=-DSTOP.KEY=" + KEY + ",Args.7.eq=start.jar"; //NON-NLS
|
||||
|
||||
long[] pidsArr = PlatformUtil.getJavaPIDs(pidsQuery);
|
||||
if (pidsArr != null) {
|
||||
@ -338,7 +338,7 @@ public class Server {
|
||||
void killSolr() {
|
||||
List<Long> solrPids = getSolrPIDs();
|
||||
for (long pid : solrPids) {
|
||||
logger.log(Level.INFO, "Trying to kill old Solr process, PID: " + pid);
|
||||
logger.log(Level.INFO, "Trying to kill old Solr process, PID: " + pid); //NON-NLS
|
||||
PlatformUtil.killProcess(pid);
|
||||
}
|
||||
}
|
||||
@ -349,19 +349,19 @@ public class Server {
|
||||
* successful.
|
||||
*/
|
||||
void start() throws KeywordSearchModuleException, SolrServerNoPortException {
|
||||
logger.log(Level.INFO, "Starting Solr server from: " + solrFolder.getAbsolutePath());
|
||||
logger.log(Level.INFO, "Starting Solr server from: " + solrFolder.getAbsolutePath()); //NON-NLS
|
||||
if (isPortAvailable(currentSolrServerPort)) {
|
||||
logger.log(Level.INFO, "Port [" + currentSolrServerPort + "] available, starting Solr");
|
||||
logger.log(Level.INFO, "Port [" + currentSolrServerPort + "] available, starting Solr"); //NON-NLS
|
||||
try {
|
||||
final String MAX_SOLR_MEM_MB_PAR = "-Xmx" + Integer.toString(MAX_SOLR_MEM_MB) + "m";
|
||||
final String MAX_SOLR_MEM_MB_PAR = "-Xmx" + Integer.toString(MAX_SOLR_MEM_MB) + "m"; //NON-NLS
|
||||
|
||||
String loggingPropertiesOpt = "-Djava.util.logging.config.file=";
|
||||
String loggingPropertiesFilePath = instanceDir + File.separator + "conf" + File.separator;
|
||||
String loggingPropertiesOpt = "-Djava.util.logging.config.file="; //NON-NLS
|
||||
String loggingPropertiesFilePath = instanceDir + File.separator + "conf" + File.separator; //NON-NLS
|
||||
|
||||
if (DEBUG) {
|
||||
loggingPropertiesFilePath += "logging-development.properties";
|
||||
loggingPropertiesFilePath += "logging-development.properties"; //NON-NLS
|
||||
} else {
|
||||
loggingPropertiesFilePath += "logging-release.properties";
|
||||
loggingPropertiesFilePath += "logging-release.properties"; //NON-NLS
|
||||
}
|
||||
|
||||
final String loggingProperties = loggingPropertiesOpt + loggingPropertiesFilePath;
|
||||
@ -369,47 +369,47 @@ public class Server {
|
||||
final String [] SOLR_START_CMD = {
|
||||
javaPath,
|
||||
MAX_SOLR_MEM_MB_PAR,
|
||||
"-DSTOP.PORT=" + currentSolrStopPort,
|
||||
"-Djetty.port=" + currentSolrServerPort,
|
||||
"-DSTOP.KEY=" + KEY,
|
||||
"-DSTOP.PORT=" + currentSolrStopPort, //NON-NLS
|
||||
"-Djetty.port=" + currentSolrServerPort, //NON-NLS
|
||||
"-DSTOP.KEY=" + KEY, //NON-NLS
|
||||
loggingProperties,
|
||||
"-jar",
|
||||
"start.jar"};
|
||||
"-jar", //NON-NLS
|
||||
"start.jar"}; //NON-NLS
|
||||
|
||||
StringBuilder cmdSb = new StringBuilder();
|
||||
for (int i = 0; i<SOLR_START_CMD.length; ++i ) {
|
||||
cmdSb.append(SOLR_START_CMD[i]).append(" ");
|
||||
}
|
||||
|
||||
logger.log(Level.INFO, "Starting Solr using: " + cmdSb.toString());
|
||||
logger.log(Level.INFO, "Starting Solr using: " + cmdSb.toString()); //NON-NLS
|
||||
curSolrProcess = Runtime.getRuntime().exec(SOLR_START_CMD, null, solrFolder);
|
||||
logger.log(Level.INFO, "Finished starting Solr");
|
||||
logger.log(Level.INFO, "Finished starting Solr"); //NON-NLS
|
||||
|
||||
try {
|
||||
//block for 10 seconds, give time to fully start the process
|
||||
//so if it's restarted solr operations can be resumed seamlessly
|
||||
Thread.sleep(10 * 1000);
|
||||
} catch (InterruptedException ex) {
|
||||
logger.log(Level.WARNING, "Timer interrupted");
|
||||
logger.log(Level.WARNING, "Timer interrupted"); //NON-NLS
|
||||
}
|
||||
// Handle output to prevent process from blocking
|
||||
|
||||
errorRedirectThread = new InputStreamPrinterThread(curSolrProcess.getErrorStream(), "stderr");
|
||||
errorRedirectThread = new InputStreamPrinterThread(curSolrProcess.getErrorStream(), "stderr"); //NON-NLS
|
||||
errorRedirectThread.start();
|
||||
|
||||
final List<Long> pids = this.getSolrPIDs();
|
||||
logger.log(Level.INFO, "New Solr process PID: " + pids);
|
||||
logger.log(Level.INFO, "New Solr process PID: " + pids); //NON-NLS
|
||||
} catch (SecurityException ex) {
|
||||
logger.log(Level.SEVERE, "Could not start Solr process!", ex);
|
||||
logger.log(Level.SEVERE, "Could not start Solr process!", ex); //NON-NLS
|
||||
throw new KeywordSearchModuleException(
|
||||
NbBundle.getMessage(this.getClass(), "Server.start.exception.cantStartSolr.msg"), ex);
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, "Could not start Solr server process!", ex);
|
||||
logger.log(Level.SEVERE, "Could not start Solr server process!", ex); //NON-NLS
|
||||
throw new KeywordSearchModuleException(
|
||||
NbBundle.getMessage(this.getClass(), "Server.start.exception.cantStartSolr.msg2"), ex);
|
||||
}
|
||||
} else {
|
||||
logger.log(Level.SEVERE, "Could not start Solr server process, port [" + currentSolrServerPort + "] not available!");
|
||||
logger.log(Level.SEVERE, "Could not start Solr server process, port [" + currentSolrServerPort + "] not available!"); //NON-NLS
|
||||
throw new SolrServerNoPortException(currentSolrServerPort);
|
||||
}
|
||||
}
|
||||
@ -423,7 +423,7 @@ public class Server {
|
||||
ServerSocket ss = null;
|
||||
try {
|
||||
|
||||
ss = new ServerSocket(port, 0, java.net.Inet4Address.getByName("localhost"));
|
||||
ss = new ServerSocket(port, 0, java.net.Inet4Address.getByName("localhost")); //NON-NLS
|
||||
if (ss.isBound()) {
|
||||
ss.setReuseAddress(true);
|
||||
ss.close();
|
||||
@ -470,18 +470,18 @@ public class Server {
|
||||
*/
|
||||
synchronized void stop() {
|
||||
try {
|
||||
logger.log(Level.INFO, "Stopping Solr server from: " + solrFolder.getAbsolutePath());
|
||||
logger.log(Level.INFO, "Stopping Solr server from: " + solrFolder.getAbsolutePath()); //NON-NLS
|
||||
//try graceful shutdown
|
||||
final String [] SOLR_STOP_CMD = {
|
||||
javaPath,
|
||||
"-DSTOP.PORT=" + currentSolrStopPort,
|
||||
"-DSTOP.KEY=" + KEY,
|
||||
"-jar",
|
||||
"start.jar",
|
||||
"--stop",
|
||||
"-DSTOP.PORT=" + currentSolrStopPort, //NON-NLS
|
||||
"-DSTOP.KEY=" + KEY, //NON-NLS
|
||||
"-jar", //NON-NLS
|
||||
"start.jar", //NON-NLS
|
||||
"--stop", //NON-NLS
|
||||
};
|
||||
Process stop = Runtime.getRuntime().exec(SOLR_STOP_CMD, null, solrFolder);
|
||||
logger.log(Level.INFO, "Waiting for stopping Solr server");
|
||||
logger.log(Level.INFO, "Waiting for stopping Solr server"); //NON-NLS
|
||||
stop.waitFor();
|
||||
|
||||
//if still running, forcefully stop it
|
||||
@ -504,7 +504,7 @@ public class Server {
|
||||
killSolr();
|
||||
}
|
||||
|
||||
logger.log(Level.INFO, "Finished stopping Solr server");
|
||||
logger.log(Level.INFO, "Finished stopping Solr server"); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -525,7 +525,7 @@ public class Server {
|
||||
//TODO handle timeout in cases when some other type of server on that port
|
||||
CoreAdminRequest.getStatus(null, solrServer);
|
||||
|
||||
logger.log(Level.INFO, "Solr server is running");
|
||||
logger.log(Level.INFO, "Solr server is running"); //NON-NLS
|
||||
} catch (SolrServerException ex) {
|
||||
|
||||
Throwable cause = ex.getRootCause();
|
||||
@ -534,7 +534,7 @@ public class Server {
|
||||
// probably caused by starting a connection as the server finishes
|
||||
// shutting down)
|
||||
if (cause instanceof ConnectException || cause instanceof SocketException) { //|| cause instanceof NoHttpResponseException) {
|
||||
logger.log(Level.INFO, "Solr server is not running, cause: {0}", cause.getMessage());
|
||||
logger.log(Level.INFO, "Solr server is not running, cause: {0}", cause.getMessage()); //NON-NLS
|
||||
return false;
|
||||
} else {
|
||||
throw new KeywordSearchModuleException(
|
||||
@ -542,7 +542,7 @@ public class Server {
|
||||
}
|
||||
} catch (SolrException ex) {
|
||||
// Just log 404 errors for now...
|
||||
logger.log(Level.INFO, "Solr server is not running", ex);
|
||||
logger.log(Level.INFO, "Solr server is not running", ex); //NON-NLS
|
||||
return false;
|
||||
} catch (IOException ex) {
|
||||
throw new KeywordSearchModuleException(
|
||||
@ -575,25 +575,25 @@ public class Server {
|
||||
* backwards compatibility with older cases)
|
||||
*/
|
||||
private void validateIndexLocation(Case theCase) {
|
||||
logger.log(Level.INFO, "Validating keyword search index location");
|
||||
logger.log(Level.INFO, "Validating keyword search index location"); //NON-NLS
|
||||
String properIndexPath = getIndexDirPath(theCase);
|
||||
|
||||
String legacyIndexPath = theCase.getCaseDirectory()
|
||||
+ File.separator + "keywordsearch" + File.separator + "data";
|
||||
+ File.separator + "keywordsearch" + File.separator + "data"; //NON-NLS
|
||||
|
||||
|
||||
File properIndexDir = new File(properIndexPath);
|
||||
File legacyIndexDir = new File(legacyIndexPath);
|
||||
if (!properIndexDir.exists()
|
||||
&& legacyIndexDir.exists() && legacyIndexDir.isDirectory()) {
|
||||
logger.log(Level.INFO, "Moving keyword search index location from: "
|
||||
+ legacyIndexPath + " to: " + properIndexPath);
|
||||
logger.log(Level.INFO, "Moving keyword search index location from: " //NON-NLS
|
||||
+ legacyIndexPath + " to: " + properIndexPath); //NON-NLS
|
||||
try {
|
||||
Files.move(Paths.get(legacyIndexDir.getParent()), Paths.get(properIndexDir.getParent()));
|
||||
} catch (IOException | SecurityException ex) {
|
||||
logger.log(Level.WARNING, "Error moving keyword search index folder from: "
|
||||
+ legacyIndexPath + " to: " + properIndexPath
|
||||
+ " will recreate a new index.", ex);
|
||||
logger.log(Level.WARNING, "Error moving keyword search index folder from: " //NON-NLS
|
||||
+ legacyIndexPath + " to: " + properIndexPath //NON-NLS
|
||||
+ " will recreate a new index.", ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -619,7 +619,7 @@ public class Server {
|
||||
*/
|
||||
String getIndexDirPath(Case theCase) {
|
||||
String indexDir = theCase.getModulesOutputDirAbsPath()
|
||||
+ File.separator + "keywordsearch" + File.separator + "data";
|
||||
+ File.separator + "keywordsearch" + File.separator + "data"; //NON-NLS
|
||||
return indexDir;
|
||||
}
|
||||
|
||||
@ -887,7 +887,7 @@ public class Server {
|
||||
|
||||
//handle a possible scenario when server process might not be fully started
|
||||
if (!this.isRunning()) {
|
||||
logger.log(Level.WARNING, "Core open requested, but server not yet running");
|
||||
logger.log(Level.WARNING, "Core open requested, but server not yet running"); //NON-NLS
|
||||
throw new KeywordSearchModuleException(
|
||||
NbBundle.getMessage(this.getClass(), "Server.openCore.exception.msg"));
|
||||
}
|
||||
@ -948,7 +948,7 @@ public class Server {
|
||||
try {
|
||||
return solrCore.request(request);
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.WARNING, "Could not issue Solr request. ", e);
|
||||
logger.log(Level.WARNING, "Could not issue Solr request. ", e); //NON-NLS
|
||||
throw new SolrServerException(
|
||||
NbBundle.getMessage(this.getClass(), "Server.request.exception.exception.msg"), e);
|
||||
}
|
||||
@ -969,7 +969,7 @@ public class Server {
|
||||
//commit and block
|
||||
solrCore.commit(true, true);
|
||||
} catch (IOException e) {
|
||||
logger.log(Level.WARNING, "Could not commit index. ", e);
|
||||
logger.log(Level.WARNING, "Could not commit index. ", e); //NON-NLS
|
||||
throw new SolrServerException(NbBundle.getMessage(this.getClass(), "Server.commit.exception.msg"), e);
|
||||
}
|
||||
}
|
||||
@ -978,13 +978,13 @@ public class Server {
|
||||
try {
|
||||
solrCore.add(doc);
|
||||
} catch (SolrServerException ex) {
|
||||
logger.log(Level.SEVERE, "Could not add document to index via update handler: " + doc.getField("id"), ex);
|
||||
logger.log(Level.SEVERE, "Could not add document to index via update handler: " + doc.getField("id"), ex); //NON-NLS
|
||||
throw new KeywordSearchModuleException(
|
||||
NbBundle.getMessage(this.getClass(), "Server.addDoc.exception.msg", doc.getField("id")), ex);
|
||||
NbBundle.getMessage(this.getClass(), "Server.addDoc.exception.msg", doc.getField("id")), ex); //NON-NLS
|
||||
} catch (IOException ex) {
|
||||
logger.log(Level.SEVERE, "Could not add document to index via update handler: " + doc.getField("id"), ex);
|
||||
logger.log(Level.SEVERE, "Could not add document to index via update handler: " + doc.getField("id"), ex); //NON-NLS
|
||||
throw new KeywordSearchModuleException(
|
||||
NbBundle.getMessage(this.getClass(), "Server.addDoc.exception.msg2", doc.getField("id")), ex);
|
||||
NbBundle.getMessage(this.getClass(), "Server.addDoc.exception.msg2", doc.getField("id")), ex); //NON-NLS
|
||||
}
|
||||
}
|
||||
|
||||
@ -1006,7 +1006,7 @@ public class Server {
|
||||
try {
|
||||
return (String) solrCore.query(q).getResults().get(0).getFieldValue(Schema.CONTENT.toString());
|
||||
} catch (SolrServerException ex) {
|
||||
logger.log(Level.WARNING, "Error getting content from Solr", ex);
|
||||
logger.log(Level.WARNING, "Error getting content from Solr", ex); //NON-NLS
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ class TermComponentQuery implements KeywordSearchQuery {
|
||||
private static final int TERMS_UNLIMITED = -1;
|
||||
//corresponds to field in Solr schema, analyzed with white-space tokenizer only
|
||||
private static final String TERMS_SEARCH_FIELD = Server.Schema.CONTENT_WS.toString();
|
||||
private static final String TERMS_HANDLER = "/terms";
|
||||
private static final String TERMS_HANDLER = "/terms"; //NON-NLS
|
||||
private static final int TERMS_TIMEOUT = 90 * 1000; //in ms
|
||||
private static Logger logger = Logger.getLogger(TermComponentQuery.class.getName());
|
||||
private String termsQuery;
|
||||
@ -126,7 +126,7 @@ class TermComponentQuery implements KeywordSearchQuery {
|
||||
q.setRequestHandler(TERMS_HANDLER);
|
||||
q.setTerms(true);
|
||||
q.setTermsLimit(TERMS_UNLIMITED);
|
||||
q.setTermsRegexFlag("case_insensitive");
|
||||
q.setTermsRegexFlag("case_insensitive"); //NON-NLS
|
||||
//q.setTermsLimit(200);
|
||||
//q.setTermsRegexFlag(regexFlag);
|
||||
//q.setTermsRaw(true);
|
||||
@ -148,7 +148,7 @@ class TermComponentQuery implements KeywordSearchQuery {
|
||||
List<Term> termsCol = tr.getTerms(TERMS_SEARCH_FIELD);
|
||||
return termsCol;
|
||||
} catch (KeywordSearchModuleException ex) {
|
||||
logger.log(Level.WARNING, "Error executing the regex terms query: " + termsQuery, ex);
|
||||
logger.log(Level.WARNING, "Error executing the regex terms query: " + termsQuery, ex); //NON-NLS
|
||||
return null; //no need to create result view, just display error dialog
|
||||
}
|
||||
}
|
||||
@ -180,7 +180,7 @@ class TermComponentQuery implements KeywordSearchQuery {
|
||||
bba = newFsHit.newArtifact(ARTIFACT_TYPE.TSK_KEYWORD_HIT);
|
||||
writeResult = new KeywordWriteResult(bba);
|
||||
} catch (Exception e) {
|
||||
logger.log(Level.WARNING, "Error adding bb artifact for keyword hit", e);
|
||||
logger.log(Level.WARNING, "Error adding bb artifact for keyword hit", e); //NON-NLS
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -204,7 +204,7 @@ class TermComponentQuery implements KeywordSearchQuery {
|
||||
writeResult.add(attributes);
|
||||
return writeResult;
|
||||
} catch (TskException e) {
|
||||
logger.log(Level.WARNING, "Error adding bb attributes for terms search artifact", e);
|
||||
logger.log(Level.WARNING, "Error adding bb attributes for terms search artifact", e); //NON-NLS
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -217,7 +217,7 @@ class TermComponentQuery implements KeywordSearchQuery {
|
||||
final SolrQuery q = createQuery();
|
||||
q.setShowDebugInfo(DEBUG);
|
||||
q.setTermsLimit(MAX_TERMS_RESULTS);
|
||||
logger.log(Level.INFO, "Query: {0}", q.toString());
|
||||
logger.log(Level.INFO, "Query: {0}", q.toString()); //NON-NLS
|
||||
terms = executeQuery(q);
|
||||
|
||||
int resultSize = 0;
|
||||
@ -243,16 +243,16 @@ class TermComponentQuery implements KeywordSearchQuery {
|
||||
}
|
||||
results.put(term.getTerm(), new ArrayList<>(filesResults));
|
||||
} catch (NoOpenCoreException e) {
|
||||
logger.log(Level.WARNING, "Error executing Solr query,", e);
|
||||
logger.log(Level.WARNING, "Error executing Solr query,", e); //NON-NLS
|
||||
throw e;
|
||||
} catch (RuntimeException e) {
|
||||
logger.log(Level.WARNING, "Error executing Solr query,", e);
|
||||
logger.log(Level.WARNING, "Error executing Solr query,", e); //NON-NLS
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//TODO limit how many results we store, not to hit memory limits
|
||||
logger.log(Level.INFO, "Regex # results: {0}", resultSize);
|
||||
logger.log(Level.INFO, "Regex # results: {0}", resultSize); //NON-NLS
|
||||
|
||||
return results;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user