public class DirectoryNode extends EntryNode implements DirectoryEntry, POIFSViewable, Iterable<Entry>
| Modifier and Type | Method and Description |
|---|---|
DirectoryEntry |
createDirectory(String name)
create a new DirectoryEntry
|
DocumentEntry |
createDocument(String name,
InputStream stream)
create a new DocumentEntry
|
DocumentEntry |
createDocument(String name,
int size,
POIFSWriterListener writer)
create a new DocumentEntry; the data will be provided later
|
DocumentInputStream |
createDocumentInputStream(Entry document)
open a document in the directory's entry's list of entries
|
DocumentInputStream |
createDocumentInputStream(String documentName)
open a document in the directory's entry's list of entries
|
DocumentEntry |
createOrUpdateDocument(String name,
InputStream stream)
Set the contents of a document, creating if needed,
otherwise updating.
|
Iterator<Entry> |
getEntries()
get an iterator of the Entry instances contained directly in
this instance (in other words, children only; no grandchildren
etc.)
|
Entry |
getEntry(String name)
get a specified Entry by name, case sensitive
|
Entry |
getEntryCaseInsensitive(String name)
get a specified Entry by name, case-insensitive
|
int |
getEntryCount()
find out how many Entry instances are contained directly within
this DirectoryEntry
|
Set<String> |
getEntryNames()
get the literal, case-sensitive names of all the Entries contained
directly in this instance (in other words, names of children only;
no grandchildren etc).
|
POIFSFileSystem |
getFileSystem() |
POIFSDocumentPath |
getPath() |
String |
getShortDescription()
Provides a short description of the object, to be used when a
POIFSViewable object has not provided its contents.
|
ClassID |
getStorageClsid()
Gets the storage clsid of the directory entry
|
Object[] |
getViewableArray()
Get an array of objects, some of which may implement
POIFSViewable
|
Iterator<Object> |
getViewableIterator()
Get an Iterator of objects, some of which may implement
POIFSViewable
|
boolean |
hasEntry(String name)
Checks for a specific entry in a case-sensitive way.
|
boolean |
hasEntryCaseInsensitive(String name)
Checks for a specific entry in a case-insensitive way.
|
protected boolean |
isDeleteOK()
extensions use this method to verify internal rules regarding
deletion of the underlying store.
|
boolean |
isDirectoryEntry()
is this a DirectoryEntry?
|
boolean |
isEmpty()
is this DirectoryEntry empty?
|
Iterator<Entry> |
iterator()
Returns an Iterator over all the entries
|
boolean |
preferArray()
Give viewers a hint as to whether to call getViewableArray or
getViewableIterator
|
void |
setStorageClsid(ClassID clsidStorage)
Sets the storage clsid for the directory entry
|
Spliterator<Entry> |
spliterator()
Returns a Spliterator over all the entries
|
delete, getName, getParent, getProperty, isDocumentEntry, isRoot, renameToclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic POIFSDocumentPath getPath()
public POIFSFileSystem getFileSystem()
public DocumentInputStream createDocumentInputStream(String documentName) throws IOException
documentName - the name of the document to be openedIOException - if the document does not exist or the
name is that of a DirectoryEntrypublic DocumentInputStream createDocumentInputStream(Entry document) throws IOException
document - the document to be openedIOException - if the document does not exist or the
name is that of a DirectoryEntrypublic Iterator<Entry> getEntries()
getEntries in interface DirectoryEntrypublic Set<String> getEntryNames()
getEntryNames in interface DirectoryEntrypublic boolean isEmpty()
isEmpty in interface DirectoryEntrypublic int getEntryCount()
getEntryCount in interface DirectoryEntrypublic boolean hasEntry(String name)
hasEntry in interface DirectoryEntryname - the name of the Entry to checkpublic boolean hasEntryCaseInsensitive(String name)
hasEntryCaseInsensitive in interface DirectoryEntryname - the name of the Entry to checkpublic Entry getEntry(String name) throws FileNotFoundException
getEntry in interface DirectoryEntryname - the name of the Entry to obtain.FileNotFoundException - if no Entry with the specified
name exists in this DirectoryEntrypublic Entry getEntryCaseInsensitive(String name) throws FileNotFoundException
getEntryCaseInsensitive in interface DirectoryEntryname - the name of the Entry to obtain.FileNotFoundException - if no Entry with the specified
name exists in this DirectoryEntrypublic DocumentEntry createDocument(String name, InputStream stream) throws IOException
createDocument in interface DirectoryEntryname - the name of the new DocumentEntrystream - the InputStream from which to create the new
DocumentEntryIOException - if the document can't be createdpublic DocumentEntry createDocument(String name, int size, POIFSWriterListener writer) throws IOException
createDocument in interface DirectoryEntryname - the name of the new DocumentEntrysize - the size of the new DocumentEntrywriter - the writer of the new DocumentEntryIOException - if the document can't be createdpublic DirectoryEntry createDirectory(String name) throws IOException
createDirectory in interface DirectoryEntryname - the name of the new DirectoryEntryIOException - if the directory can't be createdpublic DocumentEntry createOrUpdateDocument(String name, InputStream stream) throws IOException
name - the name of the new or existing DocumentEntrystream - the InputStream from which to populate the DocumentEntryIOException - if the document can't be created or its content be replacedpublic ClassID getStorageClsid()
getStorageClsid in interface DirectoryEntrypublic void setStorageClsid(ClassID clsidStorage)
setStorageClsid in interface DirectoryEntryclsidStorage - storage Class IDpublic boolean isDirectoryEntry()
isDirectoryEntry in interface EntryisDirectoryEntry in class EntryNodeprotected boolean isDeleteOK()
isDeleteOK in class EntryNodepublic Object[] getViewableArray()
getViewableArray in interface POIFSViewablepublic Iterator<Object> getViewableIterator()
getViewableIterator in interface POIFSViewablepublic boolean preferArray()
preferArray in interface POIFSViewablepublic String getShortDescription()
getShortDescription in interface POIFSViewablepublic Spliterator<Entry> spliterator()
spliterator in interface Iterable<Entry>