Package org.apache.poi.poifs.filesystem
Class POIFSDocument
- java.lang.Object
- 
- org.apache.poi.poifs.filesystem.POIFSDocument
 
- 
- All Implemented Interfaces:
- Iterable<ByteBuffer>,- POIFSViewable
 
 public final class POIFSDocument extends Object implements POIFSViewable, Iterable<ByteBuffer> This class manages a document in the NIO POIFS filesystem. This is thePOIFSFileSystemversion.
- 
- 
Constructor SummaryConstructors Constructor Description POIFSDocument(String name, int size, POIFSFileSystem filesystem, POIFSWriterListener writer)POIFSDocument(String name, POIFSFileSystem filesystem, InputStream stream)Constructor for a new DocumentPOIFSDocument(DocumentNode document)Constructor for an existing DocumentPOIFSDocument(DocumentProperty property, POIFSFileSystem filesystem)Constructor for an existing Document
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetShortDescription()Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.intgetSize()Object[]getViewableArray()Get an array of objects, some of which may implement POIFSViewableIterator<Object>getViewableIterator()Get an Iterator of objects, some of which may implement POIFSViewableIterator<ByteBuffer>iterator()booleanpreferArray()Give viewers a hint as to whether to call getViewableArray or getViewableIteratorvoidreplaceContents(InputStream stream)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface java.lang.IterableforEach, spliterator
 
- 
 
- 
- 
- 
Constructor Detail- 
POIFSDocumentpublic POIFSDocument(DocumentNode document) Constructor for an existing Document
 - 
POIFSDocumentpublic POIFSDocument(DocumentProperty property, POIFSFileSystem filesystem) Constructor for an existing Document
 - 
POIFSDocumentpublic POIFSDocument(String name, POIFSFileSystem filesystem, InputStream stream) throws IOException Constructor for a new Document- Parameters:
- name- the name of the POIFSDocument
- stream- the InputStream we read data from
- Throws:
- IOException
 
 - 
POIFSDocumentpublic POIFSDocument(String name, int size, POIFSFileSystem filesystem, POIFSWriterListener writer) throws IOException - Throws:
- IOException
 
 
- 
 - 
Method Detail- 
iteratorpublic Iterator<ByteBuffer> iterator() - Specified by:
- iteratorin interface- Iterable<ByteBuffer>
 
 - 
getSizepublic int getSize() - Returns:
- size of the document
 
 - 
replaceContentspublic void replaceContents(InputStream stream) throws IOException - Throws:
- IOException
 
 - 
getViewableArraypublic Object[] getViewableArray() Get an array of objects, some of which may implement POIFSViewable- Specified by:
- getViewableArrayin interface- POIFSViewable
- Returns:
- an array of Object; may not be null, but may be empty
 
 - 
getViewableIteratorpublic Iterator<Object> getViewableIterator() Get an Iterator of objects, some of which may implement POIFSViewable- Specified by:
- getViewableIteratorin interface- POIFSViewable
- Returns:
- an Iterator; may not be null, but may have an empty back end store
 
 - 
preferArraypublic boolean preferArray() Give viewers a hint as to whether to call getViewableArray or getViewableIterator- Specified by:
- preferArrayin interface- POIFSViewable
- Returns:
- trueif a viewer should call getViewableArray,- falseif a viewer should call getViewableIterator
 
 - 
getShortDescriptionpublic String getShortDescription() Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.- Specified by:
- getShortDescriptionin interface- POIFSViewable
- Returns:
- short description
 
 
- 
 
-