| Modifier and Type | Field and Description |
|---|---|
| private DirectoryNode | directory
The directory that our document lives in |
| private DocumentSummaryInformation | dsInf
Holds further metadata on our document |
| private boolean | |
| private static final Logger | LOG
For our own logging use |
| private SummaryInformation | sInf
Holds metadata on our document |
| Access | Constructor and Description |
|---|---|
| protected | POIDocument(DirectoryNode
The dir)DirectoryNode where information is read from.Constructs a POIDocument with the given directory node. |
| protected | POIDocument(POIFSFileSystem
the filesystem the document is read from fs)Constructs from the default POIFS |
| Modifier and Type | Method and Description |
|---|---|
| protected void | |
| public void | close()
Implements java. Closes the underlying |
| public void | createInformationProperties()
Will create whichever of SummaryInformation and DocumentSummaryInformation (HPSF) properties are not already part of your document. |
| public DirectoryNode | |
| public DocumentSummaryInformation | Returns: The Document Summary Information or null if it could not be read for this document.Fetch the Document Summary Information of the document |
| protected String | Returns: the stream name of the property set collection, if the document is encrypted
|
| public EncryptionInfo | |
| protected PropertySet | Returns: The value of the given property or null if it wasn't found.The property to read setName)For a given named property entry, either return it or null if if it wasn't found |
| protected PropertySet | Returns: The value of the given property or null if it wasn't found.The property to read setName, EncryptionInfo the encryption descriptor in case of cryptoAPI encryption encryptionInfo)For a given named property entry, either return it or null if if it wasn't found |
| public SummaryInformation | Returns: The Summary information for the document or null if it could not be read for this document.Fetch the Summary Information of the document |
| protected boolean | Returns: true if dummy directory was created, false otherwisecheck if we were created by POIFS otherwise create a new dummy POIFS for storing the package data |
| public void | |
| public void | readProperties(boolean
log a warning if any of the property sets come back as null.
The directory is null when creating a new document from scratch warnIfNull)Find, and create objects for, the standard Document Information Properties (HPSF). |
| private <T> T | |
| protected void | replaceDirectory(DirectoryNode
the new directory newDirectory)Replaces the attached directory, e.g. if this document is written to a new POIFSFileSystem |
| protected void | validateInPlaceWritePossible()
Called during a |
| public abstract void | write()
Writes the document out to the currently open |
| public abstract void | |
| public abstract void | write(OutputStream
The stream to write to. 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 POIFSFileSystem |
| public void | writeProperties(POIFSFileSystem
the POIFSFileSystem to write the properties into outFS)Writes out the standard Document Information Properties (HPSF) |
| protected void | writeProperties(POIFSFileSystem
the outFS, List<String> POIFSFileSystem to write the properties intoa list of POIFS entries to add the property names too writtenEntries)Writes out the standard Document Information Properties (HPSF) |
| private void | |
| private void | writePropertySet(String
the (POIFS Level) name of the property to write name, PropertySet the PropertySet to write out set, POIFSFileSystem the outFS)POIFSFileSystem to write the property intoWrites out a given PropertySet |
| directory | back to summary |
|---|---|
| private DirectoryNode directory The directory that our document lives in | |
| dsInf | back to summary |
|---|---|
| private DocumentSummaryInformation dsInf Holds further metadata on our document | |
| initialized | back to summary |
|---|---|
| private boolean initialized | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG For our own logging use | |
| sInf | back to summary |
|---|---|
| private SummaryInformation sInf Holds metadata on our document | |
| POIDocument | back to summary |
|---|---|
| protected POIDocument(DirectoryNode dir) Constructs a POIDocument with the given directory node.
| |
| POIDocument | back to summary |
|---|---|
| protected POIDocument(POIFSFileSystem fs) Constructs from the default POIFS
| |
| clearDirectory | back to summary |
|---|---|
| protected void clearDirectory() Clear/unlink the attached directory entry
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements java. Closes the underlying
Once
| |
| createInformationProperties | back to summary |
|---|---|
| public void createInformationProperties() Will create whichever of SummaryInformation and DocumentSummaryInformation (HPSF) properties are not already part of your document. This is normally useful when creating a new document from scratch. If the information properties are already there, then nothing will happen. | |
| getDirectory | back to summary |
|---|---|
public DirectoryNode getDirectory()
| |
| getDocumentSummaryInformation | back to summary |
|---|---|
| public DocumentSummaryInformation getDocumentSummaryInformation() Fetch the Document Summary Information of the document
| |
| getEncryptedPropertyStreamName | back to summary |
|---|---|
protected String getEncryptedPropertyStreamName()
| |
| getEncryptionInfo | back to summary |
|---|---|
public EncryptionInfo getEncryptionInfo() throws IOException
| |
| getPropertySet | back to summary |
|---|---|
| protected PropertySet getPropertySet(String setName) throws IOException For a given named property entry, either return it or null if if it wasn't found
| |
| getPropertySet | back to summary |
|---|---|
| protected PropertySet getPropertySet(String setName, EncryptionInfo encryptionInfo) throws IOException For a given named property entry, either return it or null if if it wasn't found
| |
| getSummaryInformation | back to summary |
|---|---|
| public SummaryInformation getSummaryInformation() Fetch the Summary Information of the document
| |
| initDirectory | back to summary |
|---|---|
| protected boolean initDirectory() check if we were created by POIFS otherwise create a new dummy POIFS for storing the package data
| |
| readProperties | back to summary |
|---|---|
| public void readProperties() Find, and create objects for, the standard Document Information Properties (HPSF). If a given property set is missing or corrupt, it will remain null;
| |
| readProperties | back to summary |
|---|---|
| public void readProperties(boolean warnIfNull) Find, and create objects for, the standard Document Information Properties (HPSF). If a given property set is missing or corrupt, it will remain null.
| |
| readPropertySet | back to summary |
|---|---|
private <T> T readPropertySet(Class<T> clazz, String name, boolean warnIfNull)
| |
| replaceDirectory | back to summary |
|---|---|
| protected void replaceDirectory(DirectoryNode newDirectory) throws IOException Replaces the attached directory, e.g. if this document is written to a new POIFSFileSystem
| |
| validateInPlaceWritePossible | back to summary |
|---|---|
| protected void validateInPlaceWritePossible() throws IllegalStateException Called during a
| |
| write | back to summary |
|---|---|
| public abstract void write() throws IOException Writes the document out to the currently open This will fail (with an
| |
| write | back to summary |
|---|---|
| public abstract void write(File newFile) throws IOException Writes the document out to the specified new
| |
| write | back to summary |
|---|---|
| public abstract void write(OutputStream out) throws IOException Writes the document out to the specified output stream. The
stream is not closed as part of this operation.
Note - if the Document was opened from a
| |
| writeProperties | back to summary |
|---|---|
| protected void writeProperties() throws IOException Writes out the updated standard Document Information Properties (HPSF) into the currently open POIFSFileSystem
| |
| writeProperties | back to summary |
|---|---|
| public void writeProperties(POIFSFileSystem outFS) throws IOException Writes out the standard Document Information Properties (HPSF)
| |
| writeProperties | back to summary |
|---|---|
| protected void writeProperties(POIFSFileSystem outFS, List<String> writtenEntries) throws IOException Writes out the standard Document Information Properties (HPSF)
| |
| writePropertySet | back to summary |
|---|---|
| private void writePropertySet(String name, PropertySet ps, POIFSFileSystem outFS, List<String> writtenEntries) throws IOException | |
| writePropertySet | back to summary |
|---|---|
| private void writePropertySet(String name, PropertySet set, POIFSFileSystem outFS) throws IOException Writes out a given PropertySet
| |