Package edu.upf.taln.dri.lib.loader
Class PlainTextLoaderImpl
- java.lang.Object
-
- edu.upf.taln.dri.lib.loader.PlainTextLoaderImpl
-
- All Implemented Interfaces:
PlainTextLoader
public class PlainTextLoaderImpl extends Object implements PlainTextLoader
IMPORTANT: Never instantiate directly this class!
Implementation of the plain text importing methods of Dr Inventor.
To get an instance of a PDFimporter by thePlainTextLoader interface
, always use theFactory
methodgetPlainTextLoader()
.
-
-
Field Summary
Fields Modifier and Type Field Description static Boolean
proxyEnabled
static String
proxyHostName
static Integer
proxyPort
static String
proxyScheme
static Integer
socketTimeoutInMs
-
Constructor Summary
Constructors Constructor Description PlainTextLoaderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Document
parsePlainText(File file)
Convert a plain text to aDocument
IMPORTANT: the text should be UTF-8 encodedDocument
parsePlainText(String absoluteFilePath)
Convert a plain text to aDocument
IMPORTANT: the text should be UTF-8 encodedDocument
parsePlainText(URL url)
Convert a plain text to aDocument
IMPORTANT: the text should be UTF-8 encodedDocument
parseString(String textToLoad, String docName)
Convert a plain text to aDocument
IMPORTANT: the text should be UTF-8 encoded
-
-
-
Method Detail
-
parsePlainText
public Document parsePlainText(String absoluteFilePath) throws DRIexception
Description copied from interface:PlainTextLoader
Convert a plain text to aDocument
IMPORTANT: the text should be UTF-8 encoded- Specified by:
parsePlainText
in interfacePlainTextLoader
- Parameters:
absoluteFilePath
- the absolute path of the (plain) text file to convert- Returns:
- Throws:
DRIexception
-
parsePlainText
public Document parsePlainText(File file) throws DRIexception
Description copied from interface:PlainTextLoader
Convert a plain text to aDocument
IMPORTANT: the text should be UTF-8 encoded- Specified by:
parsePlainText
in interfacePlainTextLoader
- Parameters:
file
- the (plain) text file to import- Returns:
- Throws:
DRIexception
-
parsePlainText
public Document parsePlainText(URL url) throws DRIexception
Description copied from interface:PlainTextLoader
Convert a plain text to aDocument
IMPORTANT: the text should be UTF-8 encoded- Specified by:
parsePlainText
in interfacePlainTextLoader
- Parameters:
url
- the URL of the plain text file to convert- Returns:
- Throws:
DRIexception
-
parseString
public Document parseString(String textToLoad, String docName) throws DRIexception
Description copied from interface:PlainTextLoader
Convert a plain text to aDocument
IMPORTANT: the text should be UTF-8 encoded- Specified by:
parseString
in interfacePlainTextLoader
- Parameters:
textToLoad
- the plain text to load into theDocument
docName
- the document name can be retrieved by the methodDocument.getName()
. Left null or empty string if you do not need to specify any name for the document- Returns:
- Throws:
DRIexception
-
-