Autopsy  4.12.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
Public Member Functions | Private Member Functions | List of all members
org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.BackgroundTranslationTask Class Reference

Inherits SwingWorker< String, Void >.

Public Member Functions

String doInBackground () throws InterruptedException
 
void done ()
 

Private Member Functions

String extractText (AbstractFile source, boolean ocrEnabled) throws IOException, InterruptedException, TextExtractor.InitReaderException
 
String getFileText (Node node) throws IOException, InterruptedException, TextExtractor.InitReaderException
 
Reader getTextExtractor (AbstractFile file, boolean ocrEnabled) throws IOException, TextExtractor.InitReaderException
 
String translate (String input) throws InterruptedException
 
void updateExtractionLoadingMessage (boolean isImage)
 

Detailed Description

Fetches file text and performs translation.

Definition at line 162 of file TranslatedTextViewer.java.

Member Function Documentation

String org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.BackgroundTranslationTask.doInBackground ( ) throws InterruptedException

Definition at line 172 of file TranslatedTextViewer.java.

void org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.BackgroundTranslationTask.done ( )
String org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.BackgroundTranslationTask.extractText ( AbstractFile  source,
boolean  ocrEnabled 
) throws IOException, InterruptedException, TextExtractor.InitReaderException
private

Fetches text from a file.

Parameters
sourcethe AbstractFile source to get a Reader for
ocrEnabledtrue if OCR is enabled false otherwise
Returns
Extracted Text
Exceptions
IOException
InterruptedException
org.sleuthkit.autopsy.textextractors.TextExtractor.InitReaderException

Definition at line 323 of file TranslatedTextViewer.java.

String org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.BackgroundTranslationTask.getFileText ( Node  node) throws IOException, InterruptedException, TextExtractor.InitReaderException
private

Extracts text from the given node

Parameters
nodeSelected node in UI
Returns
Extracted text
Exceptions
IOException
InterruptedException
org.sleuthkit.autopsy.textextractors.TextExtractor.InitReaderException
NoOpenCoreException
KeywordSearchModuleException

Definition at line 283 of file TranslatedTextViewer.java.

References org.sleuthkit.autopsy.corecomponents.DataContentViewerUtility.getDefaultContent().

Reader org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.BackgroundTranslationTask.getTextExtractor ( AbstractFile  file,
boolean  ocrEnabled 
) throws IOException, TextExtractor.InitReaderException
private

Fetches the appropriate reader for the given file mimetype and configures it to use OCR.

Parameters
fileFile to be read
ocrEnabledDetermines if the extractor should be configured for OCR
Returns
Reader containing Content text
Exceptions
IOException
NoTextReaderFound

Definition at line 368 of file TranslatedTextViewer.java.

References org.sleuthkit.autopsy.textextractors.TextExtractorFactory.getExtractor(), org.sleuthkit.autopsy.textextractors.TextExtractor.getReader(), org.sleuthkit.autopsy.textextractors.TextExtractorFactory.getStringsExtractor(), org.sleuthkit.autopsy.textextractors.configs.ImageConfig.setOCREnabled(), and org.sleuthkit.autopsy.textextractors.configs.ImageConfig.setOCRLanguages().

String org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.BackgroundTranslationTask.translate ( String  input) throws InterruptedException
private

Pass the translation off to the Translation service provider.

Parameters
inputText to be translated
Returns
Translated text or error message

Definition at line 246 of file TranslatedTextViewer.java.

References org.sleuthkit.autopsy.texttranslation.ui.TranslationContentPanel.display(), org.sleuthkit.autopsy.texttranslation.TextTranslationService.getInstance(), and org.sleuthkit.autopsy.texttranslation.TextTranslationService.translate().

void org.sleuthkit.autopsy.texttranslation.ui.TranslatedTextViewer.BackgroundTranslationTask.updateExtractionLoadingMessage ( boolean  isImage)
private

Update the extraction loading message depending on the file type.

Parameters
isImageBoolean indicating if the selecting node is an image

Definition at line 208 of file TranslatedTextViewer.java.

References org.sleuthkit.autopsy.texttranslation.ui.TranslationContentPanel.display().


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

Copyright © 2012-2018 Basis Technology. Generated on: Wed Sep 18 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.