public class DirectoryNode extends EntryNode implements DirectoryEntry, POIFSViewable, java.lang.Iterable<Entry>
Modifier and Type | Method and Description |
---|---|
DirectoryEntry |
createDirectory(java.lang.String name)
create a new DirectoryEntry
(创建一个新的 DirectoryEntry)
|
DocumentEntry |
createDocument(java.lang.String name, java.io.InputStream stream)
create a new DocumentEntry
(创建一个新的 DocumentEntry)
|
DocumentEntry |
createDocument(java.lang.String name, int size, POIFSWriterListener writer)
create a new DocumentEntry; the data will be provided later
(创建一个新的 DocumentEntry;数据将在稍后提供)
|
DocumentInputStream |
createDocumentInputStream(Entry document)
open a document in the directory's entry's list of entries
(在目录条目的条目列表中打开一个文档)
|
DocumentInputStream |
createDocumentInputStream(java.lang.String documentName)
open a document in the directory's entry's list of entries
(在目录条目的条目列表中打开一个文档)
|
DocumentEntry |
createOrUpdateDocument(java.lang.String name, java.io.InputStream stream)
Set the contents of a document, creating if needed, otherwise updating.
(设置文档的内容,如果需要则创建,否则更新。)
|
java.util.Iterator<Entry> |
getEntries()
get an iterator of the Entry instances contained directly in this instance (in other words, children only; no grandchildren etc.)
(获取直接包含在此实例中的 Entry 实例的迭代器(换句话说,仅限子代;无孙代等))
|
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
(找出这个 DirectoryEntry 中直接包含了多少个 Entry 实例)
|
java.util.Set<java.lang.String> |
getEntryNames()
get the names of all the Entries contained directly in this instance (in other words, names of children only; no grandchildren etc).
(获取此实例中直接包含的所有条目的名称(换句话说,只有孩子的名字;没有孙子等)。)
|
POIFSFileSystem |
getFileSystem() |
POIFSDocumentPath |
getPath() |
java.lang.String |
getShortDescription()
Provides a short description of the object, to be used when a POIFSViewable object has not provided its contents.
(提供对象的简短描述,在 POIFSViewable 对象未提供其内容时使用。)
|
ClassID |
getStorageClsid()
Gets the storage clsid of the directory entry
(获取目录条目的存储 clsid)
|
java.lang.Object[] |
getViewableArray()
Get an array of objects, some of which may implement POIFSViewable
(获取对象数组,其中一些可能实现 POIFSViewable)
|
java.util.Iterator<java.lang.Object> |
getViewableIterator()
Get an Iterator of objects, some of which may implement POIFSViewable
(获取对象的Iterator,其中一些可能实现POIFSViewable)
|
boolean |
hasEntry(java.lang.String name)
Checks if entry with specified name present
(检查是否存在具有指定名称的条目)
|
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?
(这个 DirectoryEntry 是空的吗?)
|
java.util.Iterator<Entry> |
iterator()
Returns an Iterator over all the entries
(返回所有条目的迭代器)
|
boolean |
preferArray()
Give viewers a hint as to whether to call getViewableArray or getViewableIterator
(提示查看者是否调用 getViewableArray 或 getViewableIterator)
|
void |
setStorageClsid(ClassID clsidStorage)
Sets the storage clsid for the directory entry
(设置目录条目的存储 clsid)
|
delete, getName, getParent, getProperty, isDocumentEntry, isRoot, renameTo
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public POIFSDocumentPath getPath()
public POIFSFileSystem getFileSystem()
public DocumentInputStream createDocumentInputStream(java.lang.String documentName) throws java.io.IOException
documentName
- the name of the document to be opened
(documentName - 要打开的文档的名称)
java.io.IOException
- if the document does not exist or the name is that of a DirectoryEntry
(java.io.IOException - 如果文档不存在或名称是 DirectoryEntry 的名称)
public DocumentInputStream createDocumentInputStream(Entry document) throws java.io.IOException
document
- the document to be opened
(document - 要打开的文档)
java.io.IOException
- if the document does not exist or the name is that of a DirectoryEntry
(java.io.IOException - 如果文档不存在或名称是 DirectoryEntry 的名称)
public java.util.Iterator<Entry> getEntries()
getEntries
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 getEntries)
public java.util.Set<java.lang.String> getEntryNames()
getEntryNames
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 getEntryNames)
public boolean isEmpty()
isEmpty
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 isEmpty)
public int getEntryCount()
getEntryCount
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 getEntryCount)
public boolean hasEntry(java.lang.String name)
DirectoryEntry
hasEntry
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 hasEntry)
public Entry getEntry(java.lang.String name) throws java.io.FileNotFoundException
getEntry
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 getEntry)
name
- the name of the Entry to obtain.
(name - 要获取的条目的名称。)
java.io.FileNotFoundException
- if no Entry with the specified name exists in this DirectoryEntry
(java.io.FileNotFoundException - 如果此 DirectoryEntry 中不存在具有指定名称的条目)
public DocumentEntry createDocument(java.lang.String name, java.io.InputStream stream) throws java.io.IOException
createDocument
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 createDocument)
name
- the name of the new DocumentEntry
(name - 新 DocumentEntry 的名称)
stream
- the InputStream from which to create the new DocumentEntry
(stream - 从中创建新 DocumentEntry 的 InputStream)
java.io.IOException
- if the document can't be created
(java.io.IOException - 如果无法创建文档)
public DocumentEntry createDocument(java.lang.String name, int size, POIFSWriterListener writer) throws java.io.IOException
createDocument
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 createDocument)
name
- the name of the new DocumentEntry
(name - 新 DocumentEntry 的名称)
size
- the size of the new DocumentEntry
(size - 新 DocumentEntry 的大小)
writer
- the writer of the new DocumentEntry
(writer - 新 DocumentEntry 的作者)
java.io.IOException
- if the document can't be created
(java.io.IOException - 如果无法创建文档)
public DirectoryEntry createDirectory(java.lang.String name) throws java.io.IOException
createDirectory
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 createDirectory)
name
- the name of the new DirectoryEntry
(name - 新 DirectoryEntry 的名称)
java.io.IOException
- if the directory can't be created
(java.io.IOException - 如果无法创建目录)
public DocumentEntry createOrUpdateDocument(java.lang.String name, java.io.InputStream stream) throws java.io.IOException
name
- the name of the new or existing DocumentEntry
(name - 新的或现有 DocumentEntry 的名称)
stream
- the InputStream from which to populate the DocumentEntry
(stream - 要从中填充 DocumentEntry 的 InputStream)
java.io.IOException
- if the document can't be created or its content be replaced
(java.io.IOException - 如果无法创建文档或其内容被替换)
public ClassID getStorageClsid()
getStorageClsid
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 getStorageClsid)
public void setStorageClsid(ClassID clsidStorage)
setStorageClsid
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 setStorageClsid)
clsidStorage
- storage Class ID
(clsidStorage - 存储类 ID)
public boolean isDirectoryEntry()
isDirectoryEntry
in interface
Entry
(接口Entry中的isDirectoryEntry)
isDirectoryEntry
in class
EntryNode
protected boolean isDeleteOK()
isDeleteOK
in class
EntryNode
(类 EntryNode 中的 isDeleteOK)
public java.lang.Object[] getViewableArray()
getViewableArray
in interface
POIFSViewable
(接口 POIFSViewable 中的 getViewableArray)
public java.util.Iterator<java.lang.Object> getViewableIterator()
getViewableIterator
in interface
POIFSViewable
(接口 POIFSViewable 中的 getViewableIterator)
public boolean preferArray()
preferArray
in interface
POIFSViewable
(接口 POIFSViewable 中的 preferArray)
public java.lang.String getShortDescription()
getShortDescription
in interface
POIFSViewable
(接口 POIFSViewable 中的 getShortDescription)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.