public class FilteringDirectoryNode extends Object implements DirectoryEntry
| Constructor and Description |
|---|
FilteringDirectoryNode(DirectoryEntry directory,
Collection<String> excludes)
Creates a filter round the specified directory, which
will exclude entries such as "MyNode" and "MyDir/IgnoreNode".
|
| 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
|
boolean |
delete()
Delete this Entry.
|
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 names of all the Entries contained directly in this
instance (in other words, names of children only; no grandchildren
etc).
|
String |
getName()
get the name of the Entry
|
DirectoryEntry |
getParent()
get this Entry's parent (the DirectoryEntry that owns this
Entry).
|
ClassID |
getStorageClsid()
Gets the storage clsid of the directory entry
|
boolean |
hasEntry(String name)
Checks if entry with specified name present, case sensitive
|
boolean |
hasEntryCaseInsensitive(String name)
Checks if entry with specified name present, case sensitive
|
boolean |
isDirectoryEntry()
is this a DirectoryEntry?
|
boolean |
isDocumentEntry()
is this a DocumentEntry?
|
boolean |
isEmpty()
is this DirectoryEntry empty?
|
Iterator<Entry> |
iterator() |
boolean |
renameTo(String newName)
Rename this Entry.
|
void |
setStorageClsid(ClassID clsidStorage)
Sets the storage clsid for the directory entry
|
Spliterator<Entry> |
spliterator() |
public FilteringDirectoryNode(DirectoryEntry directory, Collection<String> excludes)
directory - The Directory to filterexcludes - The Entries to excludeIllegalArgumentException - if directory is nullpublic DirectoryEntry createDirectory(String name) throws IOException
DirectoryEntrycreateDirectory in interface DirectoryEntryname - the name of the new DirectoryEntryIOExceptionpublic DocumentEntry createDocument(String name, InputStream stream) throws IOException
DirectoryEntrycreateDocument in interface DirectoryEntryname - the name of the new DocumentEntrystream - the InputStream from which to create the new
DocumentEntryIOExceptionpublic DocumentEntry createDocument(String name, int size, POIFSWriterListener writer) throws IOException
DirectoryEntrycreateDocument in interface DirectoryEntryname - the name of the new DocumentEntrysize - the size of the new DocumentEntrywriter - the writer of the new DocumentEntryIOExceptionpublic Iterator<Entry> getEntries()
DirectoryEntrygetEntries in interface DirectoryEntrypublic Spliterator<Entry> spliterator()
spliterator in interface Iterable<Entry>public int getEntryCount()
DirectoryEntrygetEntryCount in interface DirectoryEntrypublic Set<String> getEntryNames()
DirectoryEntrygetEntryNames in interface DirectoryEntrypublic boolean isEmpty()
DirectoryEntryisEmpty in interface DirectoryEntrypublic boolean hasEntry(String name)
DirectoryEntryhasEntry in interface DirectoryEntrypublic boolean hasEntryCaseInsensitive(String name)
DirectoryEntryhasEntryCaseInsensitive in interface DirectoryEntrypublic Entry getEntry(String name) throws FileNotFoundException
DirectoryEntrygetEntry 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
DirectoryEntrygetEntryCaseInsensitive in interface DirectoryEntryname - the name of the Entry to obtain.FileNotFoundException - if no Entry with the specified
name exists in this DirectoryEntrypublic ClassID getStorageClsid()
DirectoryEntrygetStorageClsid in interface DirectoryEntrypublic void setStorageClsid(ClassID clsidStorage)
DirectoryEntrysetStorageClsid in interface DirectoryEntryclsidStorage - storage Class IDpublic boolean delete()
Entrypublic boolean renameTo(String newName)
Entrypublic DirectoryEntry getParent()
Entrypublic boolean isDirectoryEntry()
EntryisDirectoryEntry in interface Entrypublic boolean isDocumentEntry()
EntryisDocumentEntry in interface Entry