Package org.apache.poi.hwpf
Class HWPFOldDocument
- java.lang.Object
-
- org.apache.poi.POIDocument
-
- org.apache.poi.hwpf.HWPFDocumentCore
-
- org.apache.poi.hwpf.HWPFOldDocument
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class HWPFOldDocument extends HWPFDocumentCore
Provides very simple support for old (Word 6 / Word 95) files.
-
-
Field Summary
-
Fields inherited from class org.apache.poi.hwpf.HWPFDocumentCore
_cbt, _fib, _ft, _lt, _mainStream, _objectPool, _pbt, _ss, _st, FIB_BASE_LEN, RC4_REKEYING_INTERVAL, STREAM_OBJECT_POOL, STREAM_TABLE_0, STREAM_TABLE_1, STREAM_WORD_DOCUMENT
-
-
Constructor Summary
Constructors Constructor Description HWPFOldDocument(DirectoryNode directory)HWPFOldDocument(POIFSFileSystem fs)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description FontTablegetFontTable()UsegetOldFontTable()instead!!! This always throws anUnsupportedOperationException.CharsetgetGuessedCharset()As a rough heuristic (total hack), read through the HPSF, then read through the font table, and take the first non-default, non-ansi, non-symbol font's charset and return that.static intgetMaxRecordLength()OldFontTablegetOldFontTable()RangegetOverallRange()Returns the range that covers all text in the file, including main text, footnotes, headers and commentsRangegetRange()Returns the range which covers the whole of the document, but excludes any headers and footers.StringBuildergetText()Internal method to access document textTextPieceTablegetTextTable()static voidsetMaxRecordLength(int length)voidwrite()voidwrite(File out)voidwrite(OutputStream out)-
Methods inherited from class org.apache.poi.hwpf.HWPFDocumentCore
getCharacterTable, getDocumentEntryBytes, getDocumentText, getEncryptionInfo, getFileInformationBlock, getListTables, getMainStream, getObjectsPool, getParagraphTable, getSectionTable, getStyleSheet, updateEncryptionInfo, verifyAndBuildPOIFS
-
Methods inherited from class org.apache.poi.POIDocument
clearDirectory, close, createInformationProperties, getDirectory, getDocumentSummaryInformation, getEncryptedPropertyStreamName, getPropertySet, getPropertySet, getSummaryInformation, initDirectory, readProperties, replaceDirectory, validateInPlaceWritePossible, writeProperties, writeProperties, writeProperties
-
-
-
-
Constructor Detail
-
HWPFOldDocument
public HWPFOldDocument(POIFSFileSystem fs) throws IOException
- Throws:
IOException
-
HWPFOldDocument
public HWPFOldDocument(DirectoryNode directory) throws IOException
- Throws:
IOException
-
-
Method Detail
-
setMaxRecordLength
public static void setMaxRecordLength(int length)
- Parameters:
length- the max record length allowed for HWPFOldDocument
-
getMaxRecordLength
public static int getMaxRecordLength()
- Returns:
- the max record length allowed for HWPFOldDocument
-
getOverallRange
public Range getOverallRange()
Description copied from class:HWPFDocumentCoreReturns the range that covers all text in the file, including main text, footnotes, headers and comments- Specified by:
getOverallRangein classHWPFDocumentCore
-
getFontTable
@NotImplemented public FontTable getFontTable()
UsegetOldFontTable()instead!!! This always throws anUnsupportedOperationException.- Overrides:
getFontTablein classHWPFDocumentCore- Returns:
- nothing
- Throws:
UnsupportedOperationException- Always.
-
getOldFontTable
public OldFontTable getOldFontTable()
-
getRange
public Range getRange()
Description copied from class:HWPFDocumentCoreReturns the range which covers the whole of the document, but excludes any headers and footers.- Specified by:
getRangein classHWPFDocumentCore
-
getTextTable
public TextPieceTable getTextTable()
- Specified by:
getTextTablein classHWPFDocumentCore
-
getText
public StringBuilder getText()
Description copied from class:HWPFDocumentCoreInternal method to access document text- Specified by:
getTextin classHWPFDocumentCore
-
write
public void write() throws IOException- Specified by:
writein classPOIDocument- Throws:
IOException
-
write
public void write(File out) throws IOException
- Specified by:
writein classPOIDocument- Throws:
IOException
-
write
public void write(OutputStream out) throws IOException
- Specified by:
writein classPOIDocument- Throws:
IOException
-
getGuessedCharset
public Charset getGuessedCharset()
As a rough heuristic (total hack), read through the HPSF, then read through the font table, and take the first non-default, non-ansi, non-symbol font's charset and return that. Once we figure out how to link a font to a text piece, we should use the font information per text piece.- Returns:
- charset
-
-