org.apache.poi.poifs.filesystem
Interface DirectoryEntry

All Superinterfaces:
Entry
All Known Implementing Classes:
DirectoryNode

public interface DirectoryEntry
extends Entry

This interface defines methods specific to Directory objects managed by a Filesystem instance.

Author:
Marc Johnson (mjohnson at apache dot org)

Method Summary
 DirectoryEntry createDirectory(java.lang.String name)
          create a new DirectoryEntry
 DocumentEntry createDocument(java.lang.String name, java.io.InputStream stream)
          create a new DocumentEntry
 DocumentEntry createDocument(java.lang.String name, int size, POIFSWriterListener writer)
          create a new DocumentEntry; the data will be provided later
 java.util.Iterator getEntries()
          get an iterator of the Entry instances contained directly in this instance (in other words, children only; no grandchildren etc.)
 Entry getEntry(java.lang.String name)
          get a specified Entry by name
 int getEntryCount()
          find out how many Entry instances are contained directly within this DirectoryEntry
 boolean isEmpty()
          is this DirectoryEntry empty?
 
Methods inherited from interface org.apache.poi.poifs.filesystem.Entry
delete, getName, getParent, isDirectoryEntry, isDocumentEntry, renameTo
 

Method Detail

getEntries

public java.util.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

public boolean isEmpty()
is this DirectoryEntry empty?
Returns:
true if this instance contains no Entry instances

getEntryCount

public 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

public Entry getEntry(java.lang.String name)
               throws java.io.FileNotFoundException
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:
java.io.FileNotFoundException - if no Entry with the specified name exists in this DirectoryEntry

createDocument

public DocumentEntry createDocument(java.lang.String name,
                                    java.io.InputStream stream)
                             throws java.io.IOException
create a new DocumentEntry
Parameters:
name - the name of the new DocumentEntry
stream - the InputStream from which to create the new DocumentEntry
Returns:
the new DocumentEntry
Throws:
java.io.IOException -  

createDocument

public DocumentEntry createDocument(java.lang.String name,
                                    int size,
                                    POIFSWriterListener writer)
                             throws java.io.IOException
create a new DocumentEntry; the data will be provided later
Parameters:
name - the name of the new DocumentEntry
size - the size of the new DocumentEntry
writer - the writer of the new DocumentEntry
Returns:
the new DocumentEntry
Throws:
java.io.IOException -  

createDirectory

public DirectoryEntry createDirectory(java.lang.String name)
                               throws java.io.IOException
create a new DirectoryEntry
Parameters:
name - the name of the new DirectoryEntry
Returns:
the new DirectoryEntry
Throws:
java.io.IOException -  


Copyright © 2002 Apache jakarta-poi project. All Rights Reserved.