Merge branch 'develop' of https://github.com/sleuthkit/autopsy into 7084-FeedbackWhileLoadingArtifacts

This commit is contained in:
William Schaefer 2020-12-16 13:32:10 -05:00
commit 2b79afa27e
5 changed files with 17 additions and 10 deletions

View File

@ -35,7 +35,7 @@ AutoIngestSettingsPanel.ImageDirectoryUnspecified=Shared images folder must be s
AutoIngestSettingsPanel.InvalidPortNumber=Invalid port number.
AutoIngestSettingsPanel.jRadioButtonCopyFiles.text=File Copy mode
AutoIngestSettingsPanel.KeywordSearchNull=Cannot find Keyword Search service
AutoIngestSettingsPanel.MustRestart=Autopsy must be restarted for new configuration to take effect
AutoIngestSettingsPanel.MustRestart=Application must be restarted for new configuration to take effect
AutoIngestSettingsPanel.nodePanel.TabConstraints.tabTitle=Node Configuration
AutoIngestSettingsPanel.NodeStatusLogging.text=Node Status Logging Settings
AutoIngestSettingsPanel.restartRequiredLabel.text=Application restart required to take effect.

View File

@ -35,7 +35,7 @@ AutoIngestSettingsPanel.ImageDirectoryUnspecified=Shared images folder must be s
AutoIngestSettingsPanel.InvalidPortNumber=Invalid port number.
AutoIngestSettingsPanel.jRadioButtonCopyFiles.text=File Copy mode
AutoIngestSettingsPanel.KeywordSearchNull=Cannot find Keyword Search service
AutoIngestSettingsPanel.MustRestart=Autopsy must be restarted for new configuration to take effect
AutoIngestSettingsPanel.MustRestart=Application must be restarted for new configuration to take effect
AutoIngestSettingsPanel.nodePanel.TabConstraints.tabTitle=Node Configuration
AutoIngestSettingsPanel.NodeStatusLogging.text=Node Status Logging Settings
AutoIngestSettingsPanel.restartRequiredLabel.text=Application restart required to take effect.

View File

@ -184,7 +184,14 @@ class Chunker implements Iterator<Chunk>, Iterable<Chunk> {
return new StringBuilder(UTF_16.decode(UTF_16.encode(s)));
}
private static StringBuilder sanitize(String s) {
/**
* Wrapper method that performs UTF-8 string sanitization.
*
* @param s String to be sanitized.
*
* @return Sanitized string.
*/
static StringBuilder sanitize(String s) {
String normStr = Normalizer.normalize(s, Normalizer.Form.NFKC);
return sanitizeToUTF8(replaceInvalidUTF16(normStr));
}

View File

@ -232,7 +232,7 @@ class Ingester {
//Make a SolrInputDocument out of the field map
SolrInputDocument updateDoc = new SolrInputDocument();
for (String key : fields.keySet()) {
updateDoc.addField(key, fields.get(key));
updateDoc.addField(key, Chunker.sanitize((String)fields.get(key)).toString());
}
try {

View File

@ -49,12 +49,12 @@ class LanguageSpecificContentIndexingHelper {
List<String> values = new ArrayList<>();
values.add(chunk.toString());
if (fields.containsKey(Server.Schema.FILE_NAME.toString())) {
values.add(fields.get(Server.Schema.FILE_NAME.toString()).toString());
values.add(Chunker.sanitize(fields.get(Server.Schema.FILE_NAME.toString()).toString()).toString());
}
// index the chunk to a language specific field
fields.put(Server.Schema.CONTENT_JA.toString(), values);
fields.put(Server.Schema.LANGUAGE.toString(), language.getValue());
fields.put(Server.Schema.LANGUAGE.toString(), Chunker.sanitize(language.getValue()).toString());
}
void indexMiniChunk(Chunker.Chunk chunk, String sourceName, Map<String, Object> fields, String baseChunkID, Language language)
@ -62,15 +62,15 @@ class LanguageSpecificContentIndexingHelper {
//Make a SolrInputDocument out of the field map
SolrInputDocument updateDoc = new SolrInputDocument();
for (String key : fields.keySet()) {
updateDoc.addField(key, fields.get(key));
updateDoc.addField(key, Chunker.sanitize((String)fields.get(key)).toString());
}
try {
updateDoc.setField(Server.Schema.ID.toString(), MiniChunkHelper.getChunkIdString(baseChunkID));
updateDoc.setField(Server.Schema.ID.toString(), Chunker.sanitize(MiniChunkHelper.getChunkIdString(baseChunkID)).toString());
// index the chunk to a language specific field
updateDoc.addField(Server.Schema.CONTENT_JA.toString(), chunk.toString().substring(chunk.getBaseChunkLength()));
updateDoc.addField(Server.Schema.LANGUAGE.toString(), language.getValue());
updateDoc.addField(Server.Schema.CONTENT_JA.toString(), Chunker.sanitize(chunk.toString().substring(chunk.getBaseChunkLength())).toString());
updateDoc.addField(Server.Schema.LANGUAGE.toString(), Chunker.sanitize(language.getValue()).toString());
TimingMetric metric = HealthMonitor.getTimingMetric("Solr: Index chunk");