Package org.apache.poi.poifs.filesystem
Class POIFSDocument
- java.lang.Object
-
- org.apache.poi.poifs.filesystem.POIFSDocument
-
- All Implemented Interfaces:
java.lang.Iterable<java.nio.ByteBuffer>
,POIFSViewable
public final class POIFSDocument extends java.lang.Object implements POIFSViewable, java.lang.Iterable<java.nio.ByteBuffer>
This class manages a document in the NIO POIFS filesystem. This is thePOIFSFileSystem
version.
-
-
Constructor Summary
Constructors Constructor Description POIFSDocument(java.lang.String name, int size, POIFSFileSystem filesystem, POIFSWriterListener writer)
POIFSDocument(java.lang.String name, POIFSFileSystem filesystem, java.io.InputStream stream)
Constructor for a new DocumentPOIFSDocument(DocumentNode document)
Constructor for an existing DocumentPOIFSDocument(DocumentProperty property, POIFSFileSystem filesystem)
Constructor for an existing Document
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getShortDescription()
Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.int
getSize()
java.lang.Object[]
getViewableArray()
Get an array of objects, some of which may implement POIFSViewablejava.util.Iterator<java.lang.Object>
getViewableIterator()
Get an Iterator of objects, some of which may implement POIFSViewablejava.util.Iterator<java.nio.ByteBuffer>
iterator()
boolean
preferArray()
Give viewers a hint as to whether to call getViewableArray or getViewableIteratorvoid
replaceContents(java.io.InputStream stream)
-
-
-
Constructor Detail
-
POIFSDocument
public POIFSDocument(DocumentNode document)
Constructor for an existing Document
-
POIFSDocument
public POIFSDocument(DocumentProperty property, POIFSFileSystem filesystem)
Constructor for an existing Document
-
POIFSDocument
public POIFSDocument(java.lang.String name, POIFSFileSystem filesystem, java.io.InputStream stream) throws java.io.IOException
Constructor for a new Document- Parameters:
name
- the name of the POIFSDocumentstream
- the InputStream we read data from- Throws:
java.io.IOException
-
POIFSDocument
public POIFSDocument(java.lang.String name, int size, POIFSFileSystem filesystem, POIFSWriterListener writer) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
iterator
public java.util.Iterator<java.nio.ByteBuffer> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<java.nio.ByteBuffer>
-
getSize
public int getSize()
- Returns:
- size of the document
-
replaceContents
public void replaceContents(java.io.InputStream stream) throws java.io.IOException
- Throws:
java.io.IOException
-
getViewableArray
public java.lang.Object[] getViewableArray()
Get an array of objects, some of which may implement POIFSViewable- Specified by:
getViewableArray
in interfacePOIFSViewable
- Returns:
- an array of Object; may not be null, but may be empty
-
getViewableIterator
public java.util.Iterator<java.lang.Object> getViewableIterator()
Get an Iterator of objects, some of which may implement POIFSViewable- Specified by:
getViewableIterator
in interfacePOIFSViewable
- Returns:
- an Iterator; may not be null, but may have an empty back end store
-
preferArray
public boolean preferArray()
Give viewers a hint as to whether to call getViewableArray or getViewableIterator- Specified by:
preferArray
in interfacePOIFSViewable
- Returns:
true
if a viewer should call getViewableArray,false
if a viewer should call getViewableIterator
-
getShortDescription
public java.lang.String getShortDescription()
Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.- Specified by:
getShortDescription
in interfacePOIFSViewable
- Returns:
- short description
-
-