Package loci.poi.poifs.filesystem
Interface DirectoryEntry
- All Superinterfaces:
Entry
- All Known Implementing Classes:
DirectoryNode
This interface defines methods specific to Directory objects
managed by a Filesystem instance.
- Author:
- Marc Johnson (mjohnson at apache dot org)
-
Method Summary
Modifier and TypeMethodDescriptioncreateDirectory(String name) create a new DirectoryEntrycreateDocument(String name, int size, POIFSWriterListener writer) create a new DocumentEntry; the data will be provided latercreateDocument(String name, loci.common.RandomAccessInputStream stream) create a new DocumentEntryget an iterator of the Entry instances contained directly in this instance (in other words, children only; no grandchildren etc.)get a specified Entry by nameintfind out how many Entry instances are contained directly within this DirectoryEntryGets the storage clsid of the directory entrybooleanisEmpty()is this DirectoryEntry empty?voidsetStorageClsid(ClassID clsidStorage) Sets the storage clsid for the directory entryMethods inherited from interface loci.poi.poifs.filesystem.Entry
delete, getName, getParent, isDirectoryEntry, isDocumentEntry, renameTo
-
Method Details
-
getEntries
Iterator getEntries()get an iterator of the Entry instances contained directly in this instance (in other words, children only; no grandchildren etc.)- Returns:
- iterator; never null, but hasNext() may return false immediately (i.e., this DirectoryEntry is empty). All objects retrieved by next() are guaranteed to be implementations of Entry.
-
isEmpty
boolean isEmpty()is this DirectoryEntry empty?- Returns:
- true if this instance contains no Entry instances
-
getEntryCount
int getEntryCount()find out how many Entry instances are contained directly within this DirectoryEntry- Returns:
- number of immediately (no grandchildren etc.) contained Entry instances
-
getEntry
get a specified Entry by name- Parameters:
name- the name of the Entry to obtain.- Returns:
- the specified Entry, if it is directly contained in this DirectoryEntry
- Throws:
FileNotFoundException- if no Entry with the specified name exists in this DirectoryEntry
-
createDocument
DocumentEntry createDocument(String name, loci.common.RandomAccessInputStream stream) throws IOException create a new DocumentEntry- Parameters:
name- the name of the new DocumentEntrystream- the InputStream from which to create the new DocumentEntry- Returns:
- the new DocumentEntry
- Throws:
IOException
-
createDocument
create a new DocumentEntry; the data will be provided later- Parameters:
name- the name of the new DocumentEntrysize- the size of the new DocumentEntrywriter- the writer of the new DocumentEntry- Returns:
- the new DocumentEntry
- Throws:
IOException
-
createDirectory
create a new DirectoryEntry- Parameters:
name- the name of the new DirectoryEntry- Returns:
- the new DirectoryEntry
- Throws:
IOException
-
getStorageClsid
ClassID getStorageClsid()Gets the storage clsid of the directory entry- Returns:
- storage Class ID
-
setStorageClsid
Sets the storage clsid for the directory entry- Parameters:
clsidStorage- storage Class ID
-