public abstract class POIDocument
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected DirectoryNode |
directory
The directory that our document lives in
|
Modifier | Constructor and Description |
---|---|
protected |
POIDocument(DirectoryNode dir)
Constructs a POIDocument with the given directory node.
|
protected |
POIDocument(NPOIFSFileSystem fs)
Constructs from an old-style OPOIFS
|
protected |
POIDocument(OPOIFSFileSystem fs)
Constructs from an old-style OPOIFS
|
protected |
POIDocument(POIFSFileSystem fs)
Constructs from the default POIFS
|
Modifier and Type | Method and Description |
---|---|
void |
createInformationProperties()
Will create whichever of SummaryInformation
and DocumentSummaryInformation (HPSF) properties
are not already part of your document.
|
DirectoryNode |
getDirectory() |
DocumentSummaryInformation |
getDocumentSummaryInformation()
Fetch the Document Summary Information of the document
|
protected PropertySet |
getPropertySet(java.lang.String setName)
For a given named property entry, either return it or null if
if it wasn't found
|
protected PropertySet |
getPropertySet(java.lang.String setName,
EncryptionInfo encryptionInfo)
For a given named property entry, either return it or null if
if it wasn't found
|
SummaryInformation |
getSummaryInformation()
Fetch the Summary Information of the document
|
protected void |
readProperties()
Find, and create objects for, the standard
Document Information Properties (HPSF).
|
abstract void |
write(java.io.OutputStream out)
Writes the document out to the specified output stream.
|
protected void |
writeProperties()
Writes out the updated standard Document Information Properties (HPSF)
into the currently open NPOIFSFileSystem
TODO Implement in-place update
|
protected void |
writeProperties(NPOIFSFileSystem outFS)
Writes out the standard Document Information Properties (HPSF)
|
protected void |
writeProperties(NPOIFSFileSystem outFS,
java.util.List<java.lang.String> writtenEntries)
Writes out the standard Document Information Properties (HPSF)
|
protected void |
writePropertySet(java.lang.String name,
PropertySet set,
NPOIFSFileSystem outFS)
Writes out a given ProperySet
|
protected DirectoryNode directory
protected POIDocument(DirectoryNode dir)
dir
- The DirectoryNode
where information is read from.protected POIDocument(OPOIFSFileSystem fs)
protected POIDocument(NPOIFSFileSystem fs)
protected POIDocument(POIFSFileSystem fs)
public DocumentSummaryInformation getDocumentSummaryInformation()
public SummaryInformation getSummaryInformation()
public void createInformationProperties()
protected void readProperties()
protected PropertySet getPropertySet(java.lang.String setName)
setName
- The property to readprotected PropertySet getPropertySet(java.lang.String setName, EncryptionInfo encryptionInfo)
setName
- The property to readencryptionInfo
- the encryption descriptor in case of cryptoAPI encryptionprotected void writeProperties() throws java.io.IOException
java.io.IOException
- if an error when writing to the open
NPOIFSFileSystem
occurs
TODO throws exception if open from stream not fileprotected void writeProperties(NPOIFSFileSystem outFS) throws java.io.IOException
outFS
- the POIFSFileSystem to write the properties intojava.io.IOException
- if an error when writing to the
NPOIFSFileSystem
occursprotected void writeProperties(NPOIFSFileSystem outFS, java.util.List<java.lang.String> writtenEntries) throws java.io.IOException
outFS
- the NPOIFSFileSystem to write the properties intowrittenEntries
- a list of POIFS entries to add the property names toojava.io.IOException
- if an error when writing to the
NPOIFSFileSystem
occursprotected void writePropertySet(java.lang.String name, PropertySet set, NPOIFSFileSystem outFS) throws java.io.IOException
name
- the (POIFS Level) name of the property to writeset
- the PropertySet to write outoutFS
- the NPOIFSFileSystem to write the property intojava.io.IOException
- if an error when writing to the
NPOIFSFileSystem
occurspublic abstract void write(java.io.OutputStream out) throws java.io.IOException
File
rather
than an InputStream
, you must write out to
a different file, overwriting via an OutputStream isn't possible.out
- The stream to write to.java.io.IOException
- thrown on errors writing to the stream@Internal public DirectoryNode getDirectory()
Copyright 2017 The Apache Software Foundation or its licensors, as applicable.