public class HWPFOldDocument extends 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 and Description |
---|
HWPFOldDocument(DirectoryNode directory) |
HWPFOldDocument(POIFSFileSystem fs) |
Modifier and Type | Method and Description |
---|---|
FontTable |
getFontTable()
Use
getOldFontTable() instead!!!
This always throws an UnsupportedOperationException . |
java.nio.charset.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.
|
static int |
getMaxRecordLength() |
OldFontTable |
getOldFontTable() |
Range |
getOverallRange()
Returns the range that covers all text in the file, including main text,
footnotes, headers and comments
|
Range |
getRange()
Returns the range which covers the whole of the document, but excludes
any headers and footers.
|
java.lang.StringBuilder |
getText()
Internal method to access document text
|
TextPieceTable |
getTextTable() |
static void |
setMaxRecordLength(int length) |
void |
write()
Writes the document out to the currently open
File , via the
writeable POIFSFileSystem it was opened from. |
void |
write(java.io.File out)
Writes the document out to the specified new
File . |
void |
write(java.io.OutputStream out)
Writes the document out to the specified output stream.
|
getCharacterTable, getDocumentEntryBytes, getDocumentText, getEncryptionInfo, getFileInformationBlock, getListTables, getMainStream, getObjectsPool, getParagraphTable, getSectionTable, getStyleSheet, updateEncryptionInfo, verifyAndBuildPOIFS
clearDirectory, close, createInformationProperties, getDirectory, getDocumentSummaryInformation, getEncryptedPropertyStreamName, getPropertySet, getPropertySet, getSummaryInformation, initDirectory, readProperties, replaceDirectory, validateInPlaceWritePossible, writeProperties, writeProperties, writeProperties
public HWPFOldDocument(POIFSFileSystem fs) throws java.io.IOException
java.io.IOException
public HWPFOldDocument(DirectoryNode directory) throws java.io.IOException
java.io.IOException
public static void setMaxRecordLength(int length)
length
- the max record length allowed for HWPFOldDocumentpublic static int getMaxRecordLength()
public Range getOverallRange()
HWPFDocumentCore
getOverallRange
in class HWPFDocumentCore
@NotImplemented public FontTable getFontTable()
getOldFontTable()
instead!!!
This always throws an UnsupportedOperationException
.getFontTable
in class HWPFDocumentCore
java.lang.UnsupportedOperationException
- Always.public OldFontTable getOldFontTable()
public Range getRange()
HWPFDocumentCore
getRange
in class HWPFDocumentCore
public TextPieceTable getTextTable()
getTextTable
in class HWPFDocumentCore
public java.lang.StringBuilder getText()
HWPFDocumentCore
getText
in class HWPFDocumentCore
public void write() throws java.io.IOException
POIDocument
File
, via the
writeable POIFSFileSystem
it was opened from.
This will fail (with an IllegalStateException
if the
document was opened read-only, opened from an InputStream
instead of a File, or if this is not the root document. For those cases,
you must use POIDocument.write(OutputStream)
or POIDocument.write(File)
to
write to a brand new document.
write
in class POIDocument
java.io.IOException
- thrown on errors writing to the filepublic void write(java.io.File out) throws java.io.IOException
POIDocument
File
. If the file
exists, it will be replaced, otherwise a new one will be createdwrite
in class POIDocument
out
- The new File to write to.java.io.IOException
- thrown on errors writing to the filepublic void write(java.io.OutputStream out) throws java.io.IOException
POIDocument
File
rather
than an InputStream
, you must write out using
POIDocument.write()
or to a different File. Overwriting the currently
open file via an OutputStream isn't possible.
If stream
is a FileOutputStream
on a networked drive
or has a high cost/latency associated with each written byte,
consider wrapping the OutputStream in a BufferedOutputStream
to improve write performance, or use POIDocument.write()
/ POIDocument.write(File)
if possible.write
in class POIDocument
out
- The stream to write to.java.io.IOException
- thrown on errors writing to the streampublic java.nio.charset.Charset getGuessedCharset()
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.