public class FilteringDirectoryNode extends java.lang.Object implements DirectoryEntry
Constructor and Description |
---|
FilteringDirectoryNode(DirectoryEntry directory, java.util.Collection<java.lang.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(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;数据将在稍后提供)
|
boolean |
delete()
Delete this Entry.
(删除此条目。)
|
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).
(获取此实例中直接包含的所有条目的名称(换句话说,只有孩子的名字;没有孙子等)。)
|
java.lang.String |
getName()
get the name of the Entry
(获取条目的名称)
|
DirectoryEntry |
getParent()
get this Entry's parent (the DirectoryEntry that owns this Entry).
(获取此条目的父项(拥有此条目的 DirectoryEntry)。)
|
ClassID |
getStorageClsid()
Gets the storage clsid of the directory entry
(获取目录条目的存储 clsid)
|
boolean |
hasEntry(java.lang.String name)
Checks if entry with specified name present
(检查是否存在具有指定名称的条目)
|
boolean |
isDirectoryEntry()
is this a DirectoryEntry?
(这是一个目录条目吗?)
|
boolean |
isDocumentEntry()
is this a DocumentEntry?
(这是一个 DocumentEntry 吗?)
|
boolean |
isEmpty()
is this DirectoryEntry empty?
(这个 DirectoryEntry 是空的吗?)
|
java.util.Iterator<Entry> |
iterator() |
boolean |
renameTo(java.lang.String newName)
Rename this Entry.
(重命名此条目。)
|
void |
setStorageClsid(ClassID clsidStorage)
Sets the storage clsid for the directory entry
(设置目录条目的存储 clsid)
|
public FilteringDirectoryNode(DirectoryEntry directory, java.util.Collection<java.lang.String> excludes)
directory
- The Directory to filter
(directory - 要过滤的目录)
excludes
- The Entries to exclude
(excludes - 要排除的条目)
java.lang.IllegalArgumentException
- if directory is null
(java.lang.IllegalArgumentException - 如果目录为空)
public DirectoryEntry createDirectory(java.lang.String name) throws java.io.IOException
DirectoryEntry
createDirectory
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 createDirectory)
name
- the name of the new DirectoryEntry
(name - 新 DirectoryEntry 的名称)
java.io.IOException
(java.io.IOException)
public DocumentEntry createDocument(java.lang.String name, java.io.InputStream stream) throws java.io.IOException
DirectoryEntry
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
(java.io.IOException)
public DocumentEntry createDocument(java.lang.String name, int size, POIFSWriterListener writer) throws java.io.IOException
DirectoryEntry
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
(java.io.IOException)
public java.util.Iterator<Entry> getEntries()
DirectoryEntry
getEntries
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 getEntries)
public java.util.Iterator<Entry> iterator()
iterator
in interface
java.lang.Iterable<Entry>
(接口 java.lang.Iterable 中的迭代器
public int getEntryCount()
DirectoryEntry
getEntryCount
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 getEntryCount)
public java.util.Set<java.lang.String> getEntryNames()
DirectoryEntry
getEntryNames
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 getEntryNames)
public boolean isEmpty()
DirectoryEntry
isEmpty
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 isEmpty)
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
DirectoryEntry
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 ClassID getStorageClsid()
DirectoryEntry
getStorageClsid
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 getStorageClsid)
public void setStorageClsid(ClassID clsidStorage)
DirectoryEntry
setStorageClsid
in interface
DirectoryEntry
(接口 DirectoryEntry 中的 setStorageClsid)
clsidStorage
- storage Class ID
(clsidStorage - 存储类 ID)
public boolean delete()
Entry
public boolean renameTo(java.lang.String newName)
Entry
public java.lang.String getName()
Entry
public DirectoryEntry getParent()
Entry
public boolean isDirectoryEntry()
Entry
isDirectoryEntry
in interface
Entry
(接口Entry中的isDirectoryEntry)
public boolean isDocumentEntry()
Entry
isDocumentEntry
in interface
Entry
(接口Entry中的isDocumentEntry)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.