lumis.util.parse
Class BaseFileParser

Package class diagram package BaseFileParser
java.lang.Object
  extended by lumis.util.parse.BaseFileParser
All Implemented Interfaces:
IFileParser
Direct Known Subclasses:
DocParser, HtmlParser, PdfParser, TxtParser

public abstract class BaseFileParser
extends Object
implements IFileParser

Base implementation of IFileParser.

Since:
4.0.10

Constructor Summary
BaseFileParser()
           
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseFileParser

public BaseFileParser()
Method Detail

extract

public abstract String extract(InputStream inputStream,
                               Charset charset)
                        throws ParseException
Specified by:
extract in interface IFileParser
Throws:
ParseException

extract

public String extract(File inputFile,
                      Charset charset)
               throws ParseException,
                      FileNotFoundException
Specified by:
extract in interface IFileParser
Throws:
ParseException
FileNotFoundException

inferCharset

protected boolean inferCharset()

extract

public String extract(File inputFile)
               throws ParseException
Specified by:
extract in interface IFileParser
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 interface IFileParser
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.


Lumisportal  5.5.0.091130 - Copyright © 2001-2007, Lumis. All Rights Reserved.