Autopsy  4.21.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
org.sleuthkit.autopsy.texttranslation.translators.BingTranslator Class Reference

Inherits org.sleuthkit.autopsy.texttranslation.TextTranslator.

Public Member Functions

 BingTranslator ()
int getMaxTextChars ()
String getName ()
JPanel getSettingsPanel ()
String postTranslationRequest (String string) throws IOException
void saveSettings () throws TranslationConfigException
String translate (String string) throws TranslationException

Private Member Functions

String parseJSONResponse (String json_text) throws TranslationException

Private Attributes

final OkHttpClient CLIENT = new OkHttpClient()
final BingTranslatorSettings settings = new BingTranslatorSettings()
BingTranslatorSettingsPanel settingsPanel

Static Private Attributes

static final String BASE_URL = ""
static final int MAX_STRING_LENGTH = 5000

Detailed Description

Translates text by making HTTP requests to Bing Translator. This requires a valid subscription key for a Microsoft Azure account.

Definition at line 43 of file

Constructor & Destructor Documentation

org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.BingTranslator ( )

Create a Bing Translator

Definition at line 58 of file

Member Function Documentation

int org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.getMaxTextChars ( )

Gets the maximum number of characters allowed in a translation request.

The maximum character count.

Implements org.sleuthkit.autopsy.texttranslation.TextTranslator.

Definition at line 181 of file

String org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.getName ( )

Get the name of the TextTranslator implementation

the name of the TextTranslator

Implements org.sleuthkit.autopsy.texttranslation.TextTranslator.

Definition at line 132 of file

JPanel org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.getSettingsPanel ( )

Get the JPanel to display on the settings options panel when this TextTranslator is selected

the panel which displays the settings options

Implements org.sleuthkit.autopsy.texttranslation.TextTranslator.

Definition at line 138 of file

String org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.parseJSONResponse ( String  json_text) throws TranslationException

Parse the response to get the translated text

json_textthe json which was received as a response to a translation request
the translated text

Definition at line 162 of file

String org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.postTranslationRequest ( String  string) throws IOException

Converts an input text to the JSON format required by Bing Translator, posts it to Microsoft, and returns the JSON text response.

stringThe input text to be translated.
The translation response as a JSON string
IOExceptionif the request could not be executed due to cancellation, a connectivity problem or timeout.

Definition at line 86 of file

void org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.saveSettings ( ) throws TranslationConfigException

Saves the current state of the settings in the settings panel.


Implements org.sleuthkit.autopsy.texttranslation.TextTranslator.

Definition at line 146 of file

String org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.translate ( String  input) throws TranslationException

Translates a provided string

inputthe String to translate
the translated String

Implements org.sleuthkit.autopsy.texttranslation.TextTranslator.

Definition at line 106 of file

Member Data Documentation

final String org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.BASE_URL = ""

Definition at line 48 of file

final OkHttpClient org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.CLIENT = new OkHttpClient()

Definition at line 53 of file

final int org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.MAX_STRING_LENGTH = 5000

Definition at line 49 of file

final BingTranslatorSettings org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.settings = new BingTranslatorSettings()

Definition at line 51 of file

BingTranslatorSettingsPanel org.sleuthkit.autopsy.texttranslation.translators.BingTranslator.settingsPanel

Definition at line 50 of file

The documentation for this class was generated from the following file:

Copyright © 2012-2022 Basis Technology. Generated on: Tue Feb 6 2024
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.