public class DirectoryNode extends EntryNode implements DirectoryEntry, POIFSViewable
Modifier and Type | Field and Description |
---|---|
private Map |
_entries |
private POIFSFileSystem |
_filesystem |
private POIFSDocumentPath |
_path |
Constructor and Description |
---|
DirectoryNode(DirectoryProperty property,
POIFSFileSystem filesystem,
DirectoryNode parent)
create a DirectoryNode.
|
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
changeName(String oldName,
String newName)
Change a contained Entry's name
|
DirectoryEntry |
createDirectory(String name)
create a new DirectoryEntry
|
(package private) DocumentEntry |
createDocument(POIFSDocument document)
create a new DocumentEntry
|
DocumentEntry |
createDocument(String name,
int size,
POIFSWriterListener writer)
create a new DocumentEntry; the data will be provided later
|
DocumentEntry |
createDocument(String name,
RandomAccessInputStream stream)
create a new DocumentEntry
|
(package private) boolean |
deleteEntry(EntryNode entry)
Delete an entry
|
Iterator |
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
|
int |
getEntryCount()
find out how many Entry instances are contained directly within
this DirectoryEntry
|
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 |
getViewableIterator()
Get an Iterator of objects, some of which may implement
POIFSViewable
|
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?
|
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
|
delete, getName, getParent, getProperty, isDocumentEntry, isRoot, renameTo
private Map _entries
private POIFSFileSystem _filesystem
private POIFSDocumentPath _path
DirectoryNode(DirectoryProperty property, POIFSFileSystem filesystem, DirectoryNode parent)
property
- the DirectoryProperty for this DirectoryEntryfilesystem
- the POIFSFileSystem we belong toparent
- the parent of this entrypublic POIFSDocumentPath getPath()
DocumentEntry createDocument(POIFSDocument document) throws IOException
document
- the new documentIOException
boolean changeName(String oldName, String newName)
oldName
- the original namenewName
- the new nameboolean deleteEntry(EntryNode entry)
entry
- the EntryNode to be deletedpublic Iterator getEntries()
getEntries
in interface DirectoryEntry
public boolean isEmpty()
isEmpty
in interface DirectoryEntry
public int getEntryCount()
getEntryCount
in interface DirectoryEntry
public Entry getEntry(String name) throws FileNotFoundException
getEntry
in interface DirectoryEntry
name
- the name of the Entry to obtain.FileNotFoundException
- if no Entry with the specified
name exists in this DirectoryEntrypublic DocumentEntry createDocument(String name, RandomAccessInputStream stream) throws IOException
createDocument
in interface DirectoryEntry
name
- the name of the new DocumentEntrystream
- the InputStream from which to create the new
DocumentEntryIOException
public DocumentEntry createDocument(String name, int size, POIFSWriterListener writer) throws IOException
createDocument
in interface DirectoryEntry
name
- the name of the new DocumentEntrysize
- the size of the new DocumentEntrywriter
- the writer of the new DocumentEntryIOException
public DirectoryEntry createDirectory(String name) throws IOException
createDirectory
in interface DirectoryEntry
name
- the name of the new DirectoryEntryIOException
public ClassID getStorageClsid()
getStorageClsid
in interface DirectoryEntry
public void setStorageClsid(ClassID clsidStorage)
setStorageClsid
in interface DirectoryEntry
clsidStorage
- storage Class IDpublic boolean isDirectoryEntry()
isDirectoryEntry
in interface Entry
isDirectoryEntry
in class EntryNode
protected boolean isDeleteOK()
isDeleteOK
in class EntryNode
public Object[] getViewableArray()
getViewableArray
in interface POIFSViewable
public Iterator getViewableIterator()
getViewableIterator
in interface POIFSViewable
public boolean preferArray()
preferArray
in interface POIFSViewable
public String getShortDescription()
getShortDescription
in interface POIFSViewable
Copyright © 2016 Open Microscopy Environment