Package ome.services.fulltext
Class PdfParser
- java.lang.Object
-
- ome.services.fulltext.FileParser
-
- ome.services.fulltext.PdfParser
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
public class PdfParser extends FileParser
FileParser
for "application/pdf" files using PDFBox.
-
-
Field Summary
-
Fields inherited from class ome.services.fulltext.FileParser
context, EMPTY, maxFileSize
-
-
Constructor Summary
Constructors Constructor Description PdfParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Iterable<java.io.Reader>
doParse(java.io.File file)
Template method to parse aFile
into manageable chunks.-
Methods inherited from class ome.services.fulltext.FileParser
parse, setApplicationContext, setMaxFileSize, wrap, wrap
-
-
-
-
Method Detail
-
doParse
public java.lang.Iterable<java.io.Reader> doParse(java.io.File file) throws java.lang.Exception
Description copied from class:FileParser
Template method to parse aFile
into manageable chunks. The default implementation reads from the file lazily with chunks overlapping on the final white space. For example a file with:The quick brown fox jumps over the lazy dog
might be parsed to:The quick brown fox jumps
andjumps over the lazy dog
. Receives a non-null,readable
File
instance fromFileParser.parse(File)
and can return a possible nullIterable
or throw anException
. In any of the non-successful cases, theFileParser.EMPTY
Iterable
will be returned to the consumer.- Overrides:
doParse
in classFileParser
- Throws:
java.lang.Exception
-
-