Package lumis.util.parse
Class BaseFileParser
- java.lang.Object
-
- lumis.util.parse.BaseFileParser
-
- All Implemented Interfaces:
IFileParser
- Direct Known Subclasses:
HtmlParser
,PdfParser
,TxtParser
public abstract class BaseFileParser extends Object implements IFileParser
Base implementation ofIFileParser
.- Since:
- 4.0.10
- Version:
- $Revision: 10124 $ $Date: 2009-02-06 18:20:18 -0200 (Fri, 06 Feb 2009) $
-
-
Constructor Summary
Constructors Constructor Description BaseFileParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
extract(File inputFile)
String
extract(File inputFile, Charset charset)
String
extract(InputStream inputStream)
Extract text from an input stream.abstract String
extract(InputStream inputStream, Charset charset)
protected boolean
inferCharset()
-
-
-
Method Detail
-
extract
public abstract String extract(InputStream inputStream, Charset charset) throws ParseException
- Specified by:
extract
in interfaceIFileParser
- Throws:
ParseException
-
extract
public String extract(File inputFile, Charset charset) throws ParseException, FileNotFoundException
- Specified by:
extract
in interfaceIFileParser
- Throws:
ParseException
FileNotFoundException
-
inferCharset
protected boolean inferCharset()
-
extract
public String extract(File inputFile) throws ParseException
- Specified by:
extract
in interfaceIFileParser
- Throws:
ParseException
-
extract
public String extract(InputStream inputStream) throws ParseException, IOException
Description copied from interface:IFileParser
Extract text from an input stream.- Specified by:
extract
in interfaceIFileParser
- Parameters:
inputStream
- the input stream.- Returns:
- the text extracted.
- Throws:
ParseException
- if an error occurred while parsing stream content.IOException
- if an I/O error occurred.
-
-