Merge pull request #5096 from sleuthkit/develop

Merge develop into elastic computing
This commit is contained in:
Richard Cordovano 2019-08-02 13:06:01 -04:00 committed by GitHub
commit b3d0df1a92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 241 additions and 114 deletions

View File

@ -2,7 +2,7 @@ Manifest-Version: 1.0
OpenIDE-Module: org.sleuthkit.autopsy.core/10 OpenIDE-Module: org.sleuthkit.autopsy.core/10
OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/core/Bundle.properties OpenIDE-Module-Localizing-Bundle: org/sleuthkit/autopsy/core/Bundle.properties
OpenIDE-Module-Layer: org/sleuthkit/autopsy/core/layer.xml OpenIDE-Module-Layer: org/sleuthkit/autopsy/core/layer.xml
OpenIDE-Module-Implementation-Version: 27 OpenIDE-Module-Implementation-Version: 28
OpenIDE-Module-Requires: org.openide.windows.WindowManager OpenIDE-Module-Requires: org.openide.windows.WindowManager
AutoUpdate-Show-In-Client: true AutoUpdate-Show-In-Client: true
AutoUpdate-Essential-Module: true AutoUpdate-Essential-Module: true

View File

@ -122,5 +122,5 @@ nbm.homepage=http://www.sleuthkit.org/
nbm.module.author=Brian Carrier nbm.module.author=Brian Carrier
nbm.needs.restart=true nbm.needs.restart=true
source.reference.curator-recipes-2.8.0.jar=release/modules/ext/curator-recipes-2.8.0-sources.jar source.reference.curator-recipes-2.8.0.jar=release/modules/ext/curator-recipes-2.8.0-sources.jar
spec.version.base=10.15 spec.version.base=10.16

View File

@ -299,6 +299,10 @@ public class Installer extends ModuleInstall {
* initialized later. * initialized later.
*/ */
private static void addGstreamerPathsToEnv() { private static void addGstreamerPathsToEnv() {
if (System.getProperty("jna.nosys") == null) {
System.setProperty("jna.nosys", "true");
}
Path gstreamerPath = InstalledFileLocator.getDefault().locate("gstreamer", Installer.class.getPackage().getName(), false).toPath(); Path gstreamerPath = InstalledFileLocator.getDefault().locate("gstreamer", Installer.class.getPackage().getName(), false).toPath();
if (gstreamerPath == null) { if (gstreamerPath == null) {

View File

@ -434,7 +434,7 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
} }
setColumnWidths(); setColumnWidths();
/* /*
* Load column sorting information from preferences file and apply it to * Load column sorting information from preferences file and apply it to
* columns. * columns.
@ -516,12 +516,22 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
protected void setColumnWidths() { protected void setColumnWidths() {
if (rootNode.getChildren().getNodesCount() != 0) { if (rootNode.getChildren().getNodesCount() != 0) {
final Graphics graphics = outlineView.getGraphics(); final Graphics graphics = outlineView.getGraphics();
if (graphics != null) { if (graphics != null) {
// Current width of the outlineView
double outlineViewWidth = outlineView.getSize().getWidth();
// List of the column widths
List<Integer> columnWidths = new ArrayList<>();
final FontMetrics metrics = graphics.getFontMetrics(); final FontMetrics metrics = graphics.getFontMetrics();
int margin = 4; int margin = 4;
int padding = 8; int padding = 8;
int totalColumnWidth = 0;
int cntMaxSizeColumns =0;
// Calulate the width for each column keeping track of the number
// of columns that were set to columnwidthLimit.
for (int column = 0; column < outline.getModel().getColumnCount(); column++) { for (int column = 0; column < outline.getModel().getColumnCount(); column++) {
int firstColumnPadding = (column == 0) ? 32 : 0; int firstColumnPadding = (column == 0) ? 32 : 0;
int columnWidthLimit = (column == 0) ? 350 : 300; int columnWidthLimit = (column == 0) ? 350 : 300;
@ -539,8 +549,43 @@ public class DataResultViewerTable extends AbstractDataResultViewer {
int columnWidth = Math.max(valuesWidth, headerWidth); int columnWidth = Math.max(valuesWidth, headerWidth);
columnWidth += 2 * margin + padding; // add margin and regular padding columnWidth += 2 * margin + padding; // add margin and regular padding
columnWidth = Math.min(columnWidth, columnWidthLimit);
columnWidth = Math.min(columnWidth, columnWidthLimit);
columnWidths.add(columnWidth);
totalColumnWidth += columnWidth;
if( columnWidth == columnWidthLimit) {
cntMaxSizeColumns++;
}
}
// Figure out how much extra, if any can be given to the columns
// so that the table is as wide as outlineViewWidth. If cntMaxSizeColumns
// is greater than 0 divide the extra space between the columns
// that could use more space. Otherwise divide evenly amoung
// all columns.
int extraWidth = 0;
if (totalColumnWidth < outlineViewWidth) {
if (cntMaxSizeColumns > 0) {
extraWidth = (int) ((outlineViewWidth - totalColumnWidth)/cntMaxSizeColumns);
} else {
extraWidth = (int) ((outlineViewWidth - totalColumnWidth)/columnWidths.size());
}
}
for(int column = 0; column < columnWidths.size(); column++) {
int columnWidth = columnWidths.get(column);
if(cntMaxSizeColumns > 0) {
if(columnWidth >= ((column == 0) ? 350 : 300)) {
columnWidth += extraWidth;
}
} else {
columnWidth += extraWidth;
}
outline.getColumnModel().getColumn(column).setPreferredWidth(columnWidth); outline.getColumnModel().getColumn(column).setPreferredWidth(columnWidth);
} }
} }

View File

@ -0,0 +1,8 @@
OptionsCategory_Name_Machine_Translation=Machine Translation
OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings
TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationContentPanel.showLabel.text=Show:
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.

View File

@ -0,0 +1,12 @@
OptionsCategory_Name_Machine_Translation=Machine Translation
OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings
TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanel.noTextTranslators.text=No text translators exist, translation is disabled.
TranslationOptionsPanel.noTextTranslatorSelected.text=No text translator selected, translation is disabled.
TranslationOptionsPanel.textTranslatorsUnavailable.text=Unable to get selected text translator, translation is disabled.
TranslationOptionsPanel.translationDisabled.text=Translation disabled
TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationContentPanel.showLabel.text=Show:
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.

View File

@ -23,6 +23,7 @@ import java.util.Collections;
import java.util.Optional; import java.util.Optional;
import org.openide.util.Lookup; import org.openide.util.Lookup;
import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.core.UserPreferences;
import javax.annotation.concurrent.GuardedBy;
/** /**
* Performs a lookup for a TextTranslator service provider and if present, will * Performs a lookup for a TextTranslator service provider and if present, will
@ -33,6 +34,7 @@ public final class TextTranslationService {
private final static TextTranslationService tts = new TextTranslationService(); private final static TextTranslationService tts = new TextTranslationService();
private final Collection<? extends TextTranslator> translators; private final Collection<? extends TextTranslator> translators;
@GuardedBy("this")
private Optional<TextTranslator> selectedTranslator; private Optional<TextTranslator> selectedTranslator;
private TextTranslationService() { private TextTranslationService() {
@ -50,7 +52,7 @@ public final class TextTranslationService {
* Update the translator currently in use to match the one saved to the user * Update the translator currently in use to match the one saved to the user
* preferences * preferences
*/ */
public void updateSelectedTranslator() { synchronized void updateSelectedTranslator() {
String translatorName = UserPreferences.getTextTranslatorName(); String translatorName = UserPreferences.getTextTranslatorName();
for (TextTranslator translator : translators) { for (TextTranslator translator : translators) {
if (translator.getName().equals(translatorName)) { if (translator.getName().equals(translatorName)) {
@ -75,7 +77,7 @@ public final class TextTranslationService {
* when specific translation * when specific translation
* implementations fail * implementations fail
*/ */
public String translate(String input) throws NoServiceProviderException, TranslationException { public synchronized String translate(String input) throws NoServiceProviderException, TranslationException {
if (hasProvider()) { if (hasProvider()) {
return selectedTranslator.get().translate(input); return selectedTranslator.get().translate(input);
} }
@ -92,7 +94,7 @@ public final class TextTranslationService {
* *
* @throws NoServiceProviderException * @throws NoServiceProviderException
*/ */
public TextTranslator getTranslatorByName(String translatorName) throws NoServiceProviderException { TextTranslator getTranslatorByName(String translatorName) throws NoServiceProviderException {
for (TextTranslator translator : translators) { for (TextTranslator translator : translators) {
if (translator.getName().equals(translatorName)) { if (translator.getName().equals(translatorName)) {
return translator; return translator;
@ -107,7 +109,7 @@ public final class TextTranslationService {
* *
* @return an unmodifiable collection of TextTranslators * @return an unmodifiable collection of TextTranslators
*/ */
public Collection<? extends TextTranslator> getTranslators() { Collection<? extends TextTranslator> getTranslators() {
return Collections.unmodifiableCollection(translators); return Collections.unmodifiableCollection(translators);
} }
@ -117,16 +119,16 @@ public final class TextTranslationService {
* *
* @return * @return
*/ */
public boolean hasProvider() { public synchronized boolean hasProvider() {
return selectedTranslator.isPresent(); return selectedTranslator.isPresent();
} }
/** /**
* Returns the hard limit for translation request sizes. * Gets the maximum number of characters allowed in a translation request.
* *
* @return * @return The maximum character count.
*/ */
public int getMaxPayloadSize() { public synchronized int getMaxTextChars() {
return selectedTranslator.get().getMaxPayloadSize(); return selectedTranslator.get().getMaxTextChars();
} }
} }

View File

@ -18,7 +18,7 @@
*/ */
package org.sleuthkit.autopsy.texttranslation; package org.sleuthkit.autopsy.texttranslation;
import java.awt.Component; import javax.swing.JPanel;
/** /**
* Interface for creating text translators. Implementing classes will be picked * Interface for creating text translators. Implementing classes will be picked
@ -45,22 +45,24 @@ public interface TextTranslator {
String getName(); String getName();
/** /**
* Get the component to display on the settings options panel when this * Get the JPanel to display on the settings options panel when this
* TextTranslator is selected * TextTranslator is selected
* *
* @return the component which displays the settings options * @return the panel which displays the settings options
*/ */
Component getComponent(); JPanel getSettingsPanel();
/** /**
* Save the settings as they have been modified in the component. * Saves the current state of the settings in the settings panel.
*/
void saveSettings();
/**
* Returns the hard limit for translation request sizes.
* *
* @return * @throws TranslationConfigException
*/ */
int getMaxPayloadSize(); void saveSettings() throws TranslationConfigException;
/**
* Gets the maximum number of characters allowed in a translation request.
*
* @return The maximum character count.
*/
int getMaxTextChars();
} }

View File

@ -0,0 +1,48 @@
/*
* Autopsy Forensic Browser
*
* Copyright 2019 Basis Technology Corp.
* Contact: carrier <at> sleuthkit <dot> org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.sleuthkit.autopsy.texttranslation;
/**
* Instances of this exception class are thrown when there is an error
* configuring text translation.
*/
public class TranslationConfigException extends Exception {
private static final long serialVersionUID = 1L;
/**
* Constructs a new exception with the specified message.
*
* @param message The message.
*/
public TranslationConfigException(String message) {
super(message);
}
/**
* Constructs a new exception with the specified message and cause.
*
* @param message The message.
* @param cause The cause.
*/
public TranslationConfigException(String message, Throwable cause) {
super(message, cause);
}
}

View File

@ -22,13 +22,8 @@ package org.sleuthkit.autopsy.texttranslation;
* Provides a system exception for Text Translation errors * Provides a system exception for Text Translation errors
*/ */
public class TranslationException extends Exception { public class TranslationException extends Exception {
/** private static final long serialVersionUID = 1L;
* Constructs a new exception with null as its message.
*/
public TranslationException() {
super();
}
/** /**
* Constructs a new exception with the specified message. * Constructs a new exception with the specified message.

View File

@ -61,7 +61,7 @@
<Component class="javax.swing.JLabel" name="translationServiceLabel"> <Component class="javax.swing.JLabel" name="translationServiceLabel">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/texttranslation/ui/Bundle.properties" key="TranslationOptionsPanel.translationServiceLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/texttranslation/Bundle.properties" key="TranslationOptionsPanel.translationServiceLabel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>
@ -72,7 +72,7 @@
<Component class="javax.swing.JLabel" name="translationOptionsDescription"> <Component class="javax.swing.JLabel" name="translationOptionsDescription">
<Properties> <Properties>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor"> <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/sleuthkit/autopsy/texttranslation/ui/Bundle.properties" key="TranslationOptionsPanel.translationOptionsDescription.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="org/sleuthkit/autopsy/texttranslation/Bundle.properties" key="TranslationOptionsPanel.translationOptionsDescription.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
</Component> </Component>

View File

@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.sleuthkit.autopsy.texttranslation.ui; package org.sleuthkit.autopsy.texttranslation;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
@ -27,14 +27,12 @@ import java.util.logging.Level;
import javax.swing.JLabel; import javax.swing.JLabel;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.core.UserPreferences;
import org.sleuthkit.autopsy.texttranslation.NoServiceProviderException;
import org.sleuthkit.autopsy.texttranslation.TextTranslationService;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
/** /**
* Options panel to display translation options * Options panel to display translation options
*/ */
public class TranslationOptionsPanel extends javax.swing.JPanel { final class TranslationOptionsPanel extends javax.swing.JPanel {
private final static Logger logger = Logger.getLogger(TranslationOptionsPanel.class.getName()); private final static Logger logger = Logger.getLogger(TranslationOptionsPanel.class.getName());
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -45,7 +43,7 @@ public class TranslationOptionsPanel extends javax.swing.JPanel {
* Creates new form TranslationOptionsPanel * Creates new form TranslationOptionsPanel
*/ */
@Messages({"TranslationOptionsPanel.translationDisabled.text=Translation disabled"}) @Messages({"TranslationOptionsPanel.translationDisabled.text=Translation disabled"})
public TranslationOptionsPanel(TranslationOptionsPanelController theController) { TranslationOptionsPanel(TranslationOptionsPanelController theController) {
initComponents(); initComponents();
controller = theController; controller = theController;
translatorComboBox.addItem(Bundle.TranslationOptionsPanel_translationDisabled_text()); translatorComboBox.addItem(Bundle.TranslationOptionsPanel_translationDisabled_text());
@ -78,7 +76,7 @@ public class TranslationOptionsPanel extends javax.swing.JPanel {
translationServicePanel.removeAll(); translationServicePanel.removeAll();
if (translatorComboBox.getSelectedItem() != null && !translatorComboBox.getSelectedItem().toString().equals(Bundle.TranslationOptionsPanel_translationDisabled_text())) { if (translatorComboBox.getSelectedItem() != null && !translatorComboBox.getSelectedItem().toString().equals(Bundle.TranslationOptionsPanel_translationDisabled_text())) {
try { try {
Component panel = TextTranslationService.getInstance().getTranslatorByName(translatorComboBox.getSelectedItem().toString()).getComponent(); Component panel = TextTranslationService.getInstance().getTranslatorByName(translatorComboBox.getSelectedItem().toString()).getSettingsPanel();
panel.addPropertyChangeListener(new PropertyChangeListener() { panel.addPropertyChangeListener(new PropertyChangeListener() {
@Override @Override
public void propertyChange(PropertyChangeEvent evt) { public void propertyChange(PropertyChangeEvent evt) {
@ -126,7 +124,7 @@ public class TranslationOptionsPanel extends javax.swing.JPanel {
if (currentSelection != null && !currentSelection.equals(Bundle.TranslationOptionsPanel_translationDisabled_text())) { if (currentSelection != null && !currentSelection.equals(Bundle.TranslationOptionsPanel_translationDisabled_text())) {
try { try {
TextTranslationService.getInstance().getTranslatorByName(currentSelection).saveSettings(); TextTranslationService.getInstance().getTranslatorByName(currentSelection).saveSettings();
} catch (NoServiceProviderException ex) { } catch (NoServiceProviderException | TranslationConfigException ex) {
logger.log(Level.WARNING, "Unable to save settings for TextTranslator named: " + currentSelection, ex); logger.log(Level.WARNING, "Unable to save settings for TextTranslator named: " + currentSelection, ex);
} }
} }
@ -172,7 +170,7 @@ public class TranslationOptionsPanel extends javax.swing.JPanel {
.addGap(10, 10, 10) .addGap(10, 10, 10)
.addComponent(translatorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(translatorComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)) .addGap(0, 0, Short.MAX_VALUE))
.addComponent(translationOptionsDescription, javax.swing.GroupLayout.DEFAULT_SIZE, 462, Short.MAX_VALUE)) .addComponent(translationOptionsDescription, javax.swing.GroupLayout.PREFERRED_SIZE, 462, Short.MAX_VALUE))
.addContainerGap()) .addContainerGap())
); );
layout.setVerticalGroup( layout.setVerticalGroup(

View File

@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.sleuthkit.autopsy.texttranslation.ui; package org.sleuthkit.autopsy.texttranslation;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport; import java.beans.PropertyChangeSupport;

View File

@ -26,11 +26,12 @@ import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request; import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody; import com.squareup.okhttp.RequestBody;
import com.squareup.okhttp.Response; import com.squareup.okhttp.Response;
import java.awt.Component;
import java.io.IOException; import java.io.IOException;
import javax.swing.JPanel;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.texttranslation.TextTranslator; import org.sleuthkit.autopsy.texttranslation.TextTranslator;
import org.sleuthkit.autopsy.texttranslation.TranslationConfigException;
import org.sleuthkit.autopsy.texttranslation.TranslationException; import org.sleuthkit.autopsy.texttranslation.TranslationException;
/** /**
@ -132,12 +133,12 @@ public class BingTranslator implements TextTranslator {
} }
@Override @Override
public Component getComponent() { public JPanel getSettingsPanel() {
return settingsPanel; return settingsPanel;
} }
@Override @Override
public void saveSettings() { public void saveSettings() throws TranslationConfigException {
settings.setAuthenticationKey(settingsPanel.getAuthenticationKey()); settings.setAuthenticationKey(settingsPanel.getAuthenticationKey());
settings.setTargetLanguageCode(settingsPanel.getTargetLanguageCode()); settings.setTargetLanguageCode(settingsPanel.getTargetLanguageCode());
settings.saveSettings(); settings.saveSettings();
@ -173,7 +174,7 @@ public class BingTranslator implements TextTranslator {
} }
@Override @Override
public int getMaxPayloadSize() { public int getMaxTextChars() {
return MAX_STRING_LENGTH; return MAX_STRING_LENGTH;
} }
} }

View File

@ -23,7 +23,6 @@ import com.google.auth.oauth2.ServiceAccountCredentials;
import com.google.cloud.translate.Translate; import com.google.cloud.translate.Translate;
import com.google.cloud.translate.TranslateOptions; import com.google.cloud.translate.TranslateOptions;
import com.google.cloud.translate.Translation; import com.google.cloud.translate.Translation;
import java.awt.Component;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
@ -31,12 +30,14 @@ import java.io.InputStream;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.JPanel;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.openide.util.NbBundle.Messages; import org.openide.util.NbBundle.Messages;
import org.openide.util.lookup.ServiceProvider; import org.openide.util.lookup.ServiceProvider;
import org.sleuthkit.autopsy.coreutils.EscapeUtil; import org.sleuthkit.autopsy.coreutils.EscapeUtil;
import org.sleuthkit.autopsy.texttranslation.TextTranslator; import org.sleuthkit.autopsy.texttranslation.TextTranslator;
import org.sleuthkit.autopsy.texttranslation.TranslationConfigException;
import org.sleuthkit.autopsy.texttranslation.TranslationException; import org.sleuthkit.autopsy.texttranslation.TranslationException;
/** /**
@ -133,7 +134,7 @@ public final class GoogleTranslator implements TextTranslator {
} }
@Override @Override
public Component getComponent() { public JPanel getSettingsPanel() {
return settingsPanel; return settingsPanel;
} }
@ -172,7 +173,7 @@ public final class GoogleTranslator implements TextTranslator {
} }
@Override @Override
public void saveSettings() { public void saveSettings() throws TranslationConfigException {
settings.setTargetLanguageCode(settingsPanel.getTargetLanguageCode()); settings.setTargetLanguageCode(settingsPanel.getTargetLanguageCode());
settings.setCredentialPath(settingsPanel.getCredentialsPath()); settings.setCredentialPath(settingsPanel.getCredentialsPath());
settings.saveSettings(); settings.saveSettings();
@ -180,7 +181,7 @@ public final class GoogleTranslator implements TextTranslator {
} }
@Override @Override
public int getMaxPayloadSize() { public int getMaxTextChars() {
return MAX_PAYLOAD_SIZE; return MAX_PAYLOAD_SIZE;
} }
} }

View File

@ -1,8 +1,6 @@
OptionsCategory_Name_Machine_Translation=Machine Translation OptionsCategory_Name_Machine_Translation=Machine Translation
OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings OptionsCategory_Keywords_Machine_Translation_Settings=Machine Translation Settings
TranslationContentPanel.ocrLabel.text=OCR: TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanelController.moduleErr=Module Error TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete. TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.
TranslationContentPanel.showLabel.text=Show: TranslationContentPanel.showLabel.text=Show:

View File

@ -17,12 +17,6 @@ TranslatedTextViewer.title=Translation
TranslatedTextViewer.toolTip=Displays translated file text. TranslatedTextViewer.toolTip=Displays translated file text.
TranslationContentPanel.autoDetectOCR=Autodetect language TranslationContentPanel.autoDetectOCR=Autodetect language
TranslationContentPanel.ocrLabel.text=OCR: TranslationContentPanel.ocrLabel.text=OCR:
TranslationOptionsPanel.noTextTranslators.text=No text translators exist, translation is disabled.
TranslationOptionsPanel.noTextTranslatorSelected.text=No text translator selected, translation is disabled.
TranslationOptionsPanel.textTranslatorsUnavailable.text=Unable to get selected text translator, translation is disabled.
TranslationOptionsPanel.translationDisabled.text=Translation disabled
TranslationOptionsPanel.translationServiceLabel.text=Text translator:
TranslationOptionsPanelController.moduleErr=Module Error TranslationOptionsPanelController.moduleErr=Module Error
TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete. TranslationOptionsPanelController.moduleErr.msg=A module caused an error listening to TranslationSettingsPanelController updates. See log to determine which module. Some data could be incomplete.
TranslationOptionsPanel.translationOptionsDescription.text=Configure a 3rd party text translation service to enable text and file name translation.
TranslationContentPanel.showLabel.text=Show: TranslationContentPanel.showLabel.text=Show:

View File

@ -96,7 +96,7 @@ public final class TranslatedTextViewer implements TextViewer {
} }
} }
int payloadMaxInKB = TextTranslationService.getInstance().getMaxPayloadSize() / 1000; int payloadMaxInKB = TextTranslationService.getInstance().getMaxTextChars() / 1000;
panel.setWarningLabelMsg(String.format(Bundle.TranslatedTextViewer_maxPayloadSize(), payloadMaxInKB)); panel.setWarningLabelMsg(String.format(Bundle.TranslatedTextViewer_maxPayloadSize(), payloadMaxInKB));
//Force a background task. //Force a background task.

View File

@ -135,7 +135,7 @@
<compile-dependency/> <compile-dependency/>
<run-dependency> <run-dependency>
<release-version>10</release-version> <release-version>10</release-version>
<specification-version>10.15</specification-version> <specification-version>10.16</specification-version>
</run-dependency> </run-dependency>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -127,7 +127,7 @@
<compile-dependency/> <compile-dependency/>
<run-dependency> <run-dependency>
<release-version>10</release-version> <release-version>10</release-version>
<specification-version>10.15</specification-version> <specification-version>10.16</specification-version>
</run-dependency> </run-dependency>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -119,7 +119,7 @@
<compile-dependency/> <compile-dependency/>
<run-dependency> <run-dependency>
<release-version>10</release-version> <release-version>10</release-version>
<specification-version>10.15</specification-version> <specification-version>10.16</specification-version>
</run-dependency> </run-dependency>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -64,11 +64,13 @@ import org.apache.solr.common.util.NamedList;
import org.openide.modules.InstalledFileLocator; import org.openide.modules.InstalledFileLocator;
import org.openide.modules.Places; import org.openide.modules.Places;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;
import org.sleuthkit.autopsy.casemodule.Case; import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.casemodule.Case.CaseType; import org.sleuthkit.autopsy.casemodule.Case.CaseType;
import org.sleuthkit.autopsy.casemodule.CaseMetadata; import org.sleuthkit.autopsy.casemodule.CaseMetadata;
import org.sleuthkit.autopsy.core.UserPreferences; import org.sleuthkit.autopsy.core.UserPreferences;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.sleuthkit.autopsy.coreutils.MessageNotifyUtil;
import org.sleuthkit.autopsy.coreutils.ModuleSettings; import org.sleuthkit.autopsy.coreutils.ModuleSettings;
import org.sleuthkit.autopsy.coreutils.PlatformUtil; import org.sleuthkit.autopsy.coreutils.PlatformUtil;
import org.sleuthkit.autopsy.healthmonitor.HealthMonitor; import org.sleuthkit.autopsy.healthmonitor.HealthMonitor;
@ -492,7 +494,14 @@ public class Server {
// If we get here the Solr server has not responded to connection // If we get here the Solr server has not responded to connection
// attempts in a timely fashion. // attempts in a timely fashion.
logger.log(Level.WARNING, "Local Solr server failed to respond to status requests."); logger.log(Level.WARNING, "Local Solr server failed to respond to status requests.");
throw new KeywordSearchModuleException(Bundle.Server_status_failed_msg()); WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
@Override
public void run() {
MessageNotifyUtil.Notify.error(
NbBundle.getMessage(this.getClass(), "Installer.errorInitKsmMsg"),
Bundle.Server_status_failed_msg());
}
});
} catch (SecurityException ex) { } catch (SecurityException ex) {
logger.log(Level.SEVERE, "Could not start Solr process!", ex); //NON-NLS logger.log(Level.SEVERE, "Could not start Solr process!", ex); //NON-NLS
throw new KeywordSearchModuleException( throw new KeywordSearchModuleException(

View File

@ -60,7 +60,7 @@
<compile-dependency/> <compile-dependency/>
<run-dependency> <run-dependency>
<release-version>10</release-version> <release-version>10</release-version>
<specification-version>10.15</specification-version> <specification-version>10.16</specification-version>
</run-dependency> </run-dependency>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -1,13 +1,11 @@
/*! \page logs_and_output_page Logs, Output, and Progress /*! \page logs_and_output_page Viewing Case Logs and Output
There are several shortcuts for getting to the output folder, log folder, and progress shapshot shown below.
<br><br> There are several shortcuts for getting to the case and log folders.
To open the Case output folder, use "Tools", "Open Output Folder" as shown below:
- To open the Case output folder, use "Tools", "Open Output Folder" as shown below:
\image html open_output_folder.PNG \image html open_output_folder.PNG
<br><br>
To open the Case log folder, use "Help", "Open Log Folder" as shown below: - To open the Case log folder, use "Help", "Open Log Folder" as shown below:
\image html open_log_folder.PNG \image html open_log_folder.PNG
<br><br>
While Ingest is running, one can use the "Ingest Progress Snapshot" tool to see what activity is going on at the moment. Click on "Help", "Get Ingest Progress Snapshot" to view the dialog shown in the screenshot below.
\image html ingest_progress_snapshot.PNG
To refresh the view, use the "Refresh" button.
*/ */

View File

@ -10,13 +10,23 @@ Help Topics
------- -------
The following topics are available here: The following topics are available here:
- \subpage installation_page - Installation
- \subpage installation_page
- \subpage performance_page
- Multi-user Cluster
- \subpage install_multiuser_page
- \subpage multiuser_sec_page
- \subpage multiuser_page
- \subpage quick_start_guide "Quick Start Guide" - \subpage quick_start_guide "Quick Start Guide"
- \subpage workflow_page
- Cases and Adding Data Sources - Cases and Adding Data Sources
- \subpage workflow_page
- \subpage cases_page - \subpage cases_page
- \subpage ds_page - \subpage ds_page
- \subpage uilayout_page - \subpage logs_and_output_page
- Ingest Modules - Ingest Modules
- \subpage ingest_page "Ingest Modules" - \subpage ingest_page "Ingest Modules"
- \subpage recent_activity_page - \subpage recent_activity_page
@ -34,43 +44,55 @@ The following topics are available here:
- \subpage cr_ingest_module - \subpage cr_ingest_module
- \subpage encryption_page - \subpage encryption_page
- \subpage vm_extractor_page - \subpage vm_extractor_page
- Reviewing the Results - Reviewing the Results
- \subpage uilayout_page
- \subpage tree_viewer_page - \subpage tree_viewer_page
- \subpage result_viewer_page - \subpage result_viewer_page
- \subpage content_viewer_page - \subpage content_viewer_page
- \subpage machine_translation_page
- Searching
- \subpage ui_quick_search - \subpage ui_quick_search
- \subpage image_gallery_page
- \subpage file_search_page - \subpage file_search_page
- \subpage ad_hoc_keyword_search_page - \subpage ad_hoc_keyword_search_page
- \subpage timeline_page
- \subpage stix_page - \subpage stix_page
- \subpage central_repo_page
- \subpage communications_page
- \subpage common_properties_page - \subpage common_properties_page
- \subpage search_all_cases_page - \subpage search_all_cases_page
- \subpage logs_and_output_page
- \subpage machine_translation_page - Specialized Viewers
- \subpage image_gallery_page
- \subpage timeline_page
- \subpage communications_page
- Reporting - Reporting
- \subpage tagging_page - \subpage tagging_page
- \subpage reporting_page - \subpage reporting_page
- \subpage module_install_page - \subpage module_install_page
- \subpage performance_page - \subpage central_repo_page
- Multi-user Cluster
- \subpage install_multiuser_page - Other Workflows
- \subpage multiuser_sec_page - Triage
- \subpage multiuser_page - \subpage triage_page
- Triage - \subpage live_triage_page
- \subpage triage_page - \subpage logical_imager_page
- \subpage live_triage_page - \subpage command_line_ingest_page
- Experimental Module - Experimental Module
- \subpage experimental_page - \subpage experimental_page
- \ref auto_ingest_page - \ref auto_ingest_page
- \ref object_detection_page - \ref object_detection_page
- \ref volatility_dsp_page - \ref volatility_dsp_page
- \subpage command_line_ingest_page
- \subpage logical_imager_page
- \subpage translations_page
If the topic you need is not listed, refer to the <a href="http://wiki.sleuthkit.org/index.php?title=Autopsy_User%27s_Guide">Autopsy Wiki</a> or join the <a href="https://lists.sourceforge.net/lists/listinfo/sleuthkit-users">SleuthKit User List</a> at SourceForge. - \subpage translations_page
If the topic you need is not listed, then you can:
- Refer to the <a href="http://wiki.sleuthkit.org/index.php?title=Autopsy_User%27s_Guide">Autopsy Wiki</a>
- Ask a question on the <a href="http://forum.sleuthkit.org">Forum</a>
- Ask a question on the <a href="https://lists.sourceforge.net/lists/listinfo/sleuthkit-users">Email List</a>.
*/ */

View File

@ -36,7 +36,7 @@
<compile-dependency/> <compile-dependency/>
<run-dependency> <run-dependency>
<release-version>10</release-version> <release-version>10</release-version>
<specification-version>10.15</specification-version> <specification-version>10.16</specification-version>
</run-dependency> </run-dependency>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -58,6 +58,7 @@ import org.apache.tika.parser.txt.CharsetDetector;
import org.apache.tika.parser.txt.CharsetMatch; import org.apache.tika.parser.txt.CharsetMatch;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.coreutils.FileUtil;
import org.sleuthkit.datamodel.TskData; import org.sleuthkit.datamodel.TskData;
import org.sleuthkit.datamodel.EncodedFileOutputStream; import org.sleuthkit.datamodel.EncodedFileOutputStream;
@ -358,19 +359,7 @@ class MboxParser implements Iterator<EmailMessage> {
logger.log(Level.SEVERE, Bundle.MboxParser_handleAttch_noOpenCase_errMsg(), ex); //NON-NLS logger.log(Level.SEVERE, Bundle.MboxParser_handleAttch_noOpenCase_errMsg(), ex); //NON-NLS
return; return;
} }
String filename = e.getFilename(); String filename = FileUtil.escapeFileName(e.getFilename());
// sanitize name. Had an attachment with a Japanese encoded path that
// invalid characters and attachment could not be saved.
filename = filename.replaceAll("\\?", "_");
filename = filename.replaceAll("<", "_");
filename = filename.replaceAll(">", "_");
filename = filename.replaceAll(":", "_");
filename = filename.replaceAll("\"", "_");
filename = filename.replaceAll("/", "_");
filename = filename.replaceAll("\\\\", "_");
filename = filename.replaceAll("|", "_");
filename = filename.replaceAll("\\*", "_");
// also had some crazy long names, so make random one if we get those. // also had some crazy long names, so make random one if we get those.
// also from Japanese image that had encoded name // also from Japanese image that had encoded name

View File

@ -37,6 +37,7 @@ import java.util.logging.Level;
import org.sleuthkit.autopsy.coreutils.Logger; import org.sleuthkit.autopsy.coreutils.Logger;
import org.openide.util.NbBundle; import org.openide.util.NbBundle;
import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException; import org.sleuthkit.autopsy.casemodule.NoCurrentCaseException;
import org.sleuthkit.autopsy.coreutils.FileUtil;
import org.sleuthkit.autopsy.ingest.IngestMonitor; import org.sleuthkit.autopsy.ingest.IngestMonitor;
import org.sleuthkit.autopsy.ingest.IngestServices; import org.sleuthkit.autopsy.ingest.IngestServices;
import static org.sleuthkit.autopsy.thunderbirdparser.ThunderbirdMboxFileIngestModule.getRelModuleOutputPath; import static org.sleuthkit.autopsy.thunderbirdparser.ThunderbirdMboxFileIngestModule.getRelModuleOutputPath;
@ -367,7 +368,7 @@ class PstParser {
if (filename.isEmpty()) { if (filename.isEmpty()) {
filename = attach.getFilename(); filename = attach.getFilename();
} }
String uniqueFilename = fileID + "-" + msg.getDescriptorNodeId() + "-" + attach.getContentId() + "-" + filename; String uniqueFilename = fileID + "-" + msg.getDescriptorNodeId() + "-" + attach.getContentId() + "-" + FileUtil.escapeFileName(filename);
String outPath = outputDirPath + uniqueFilename; String outPath = outputDirPath + uniqueFilename;
saveAttachmentToDisk(attach, outPath); saveAttachmentToDisk(attach, outPath);