Top Description Fields Constructors Methods
org.apache.poi.hssf.extractor

public Class OldExcelExtractor

extends Object
implements POITextExtractor
Class Inheritance
All Implemented Interfaces
org.apache.poi.extractor.POITextExtractor, java.io.Closeable, java.lang.AutoCloseable
Static Imports
org.apache.poi.hssf.model.InternalWorkbook.OLD_WORKBOOK_DIR_ENTRY_NAME, .InternalWorkbook.WORKBOOK, .InternalWorkbook.WORKBOOK_DIR_ENTRY_NAMES

A text extractor for old Excel files, which are too old for HSSFWorkbook to handle. This includes Excel 95, and very old (pre-OLE2) Excel files, such as Excel 4 files.

Returns much (but not all) of the textual content of the file, suitable for indexing by something like Apache Lucene, or used by Apache Tika, but not really intended for display to the user.

Field Summary

Modifier and TypeField and Description
private int
private static final int
private int
private RecordInputStream
private Closeable

Constructor Summary

AccessConstructor and Description
public
public
public
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the Biff version
getBiffVersion
()

The Biff version, largely corresponding to the Excel version

public Object
public Closeable
public int
public POITextExtractor
getMetadataTextExtractor()

Implements org.apache.poi.extractor.POITextExtractor.getMetadataTextExtractor.

Returns another text extractor, which is able to output the textual content of the document metadata / properties, such as author and title.

public String

Returns:

the text contents of the file
getText
()

Implements org.apache.poi.extractor.POITextExtractor.getText.

Retrieves the text contents of the file, as best we can for these old file formats

protected void
handleNumericCell(StringBuilder text, double value)

public boolean
public static void
main(String[] args)

private void
open(InputStream biffStream)

private void
private void
open(DirectoryNode directory)

private void
public void
setCloseFilesystem(boolean
true (default), if underlying resources/filesystem should be closed on close()
doCloseFilesystem
)

Implements org.apache.poi.extractor.POITextExtractor.setCloseFilesystem.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

biffVersionback to summary
private int biffVersion
FILE_PASS_RECORD_SIDback to summary
private static final int FILE_PASS_RECORD_SID
fileTypeback to summary
private int fileType
risback to summary
private RecordInputStream ris
toCloseback to summary
private Closeable toClose

Constructor Detail

OldExcelExtractorback to summary
public OldExcelExtractor(InputStream input) throws IOException
OldExcelExtractorback to summary
public OldExcelExtractor(File f) throws IOException
Annotations
@SuppressWarnings:java:S2093
OldExcelExtractorback to summary
public OldExcelExtractor(POIFSFileSystem fs) throws IOException
OldExcelExtractorback to summary
public OldExcelExtractor(DirectoryNode directory) throws IOException

Method Detail

getBiffVersionback to summary
public int getBiffVersion()

The Biff version, largely corresponding to the Excel version

Returns:int

the Biff version

getDocumentback to summary
public Object getDocument()

Implements org.apache.poi.extractor.POITextExtractor.getDocument.

Returns:Object

Doc from org.apache.poi.extractor.POITextExtractor.getDocument.

the processed document

Annotations
@Override
getFilesystemback to summary
public Closeable getFilesystem()

Implements org.apache.poi.extractor.POITextExtractor.getFilesystem.

Returns:Closeable

Doc from org.apache.poi.extractor.POITextExtractor.getFilesystem.

The underlying resources/filesystem

Annotations
@Override
getFileTypeback to summary
public int getFileType()

The kind of the file, one of BOFRecord#TYPE_WORKSHEET, BOFRecord#TYPE_CHART, BOFRecord#TYPE_EXCEL_4_MACRO or BOFRecord#TYPE_WORKSPACE_FILE

Returns:int

the file type

getMetadataTextExtractorback to summary
public POITextExtractor getMetadataTextExtractor()

Implements org.apache.poi.extractor.POITextExtractor.getMetadataTextExtractor.

Doc from org.apache.poi.extractor.POITextExtractor.getMetadataTextExtractor.

Returns another text extractor, which is able to output the textual content of the document metadata / properties, such as author and title.

Returns:POITextExtractor

the metadata and text extractor

Annotations
@Override
getTextback to summary
public String getText()

Implements org.apache.poi.extractor.POITextExtractor.getText.

Retrieves the text contents of the file, as best we can for these old file formats

Returns:String

the text contents of the file

Annotations
@Override
handleNumericCellback to summary
protected void handleNumericCell(StringBuilder text, double value)
isCloseFilesystemback to summary
public boolean isCloseFilesystem()

Implements org.apache.poi.extractor.POITextExtractor.isCloseFilesystem.

Returns:boolean

Doc from org.apache.poi.extractor.POITextExtractor.isCloseFilesystem.

true, if resources/filesystem should be closed on close()

Annotations
@Override
mainback to summary
public static void main(String[] args) throws IOException
openback to summary
private void open(InputStream biffStream) throws IOException
Annotations
@SuppressWarnings:java:S2093
openback to summary
private void open(POIFSFileSystem fs) throws IOException
openback to summary
private void open(DirectoryNode directory) throws IOException
prepareback to summary
private void prepare()
setCloseFilesystemback to summary
public void setCloseFilesystem(boolean doCloseFilesystem)

Implements org.apache.poi.extractor.POITextExtractor.setCloseFilesystem.

Parameters
doCloseFilesystem:boolean

Doc from org.apache.poi.extractor.POITextExtractor.setCloseFilesystem.

true (default), if underlying resources/filesystem should be closed on close()

Annotations
@Override