public class POIFSDocumentPath
extends java.lang.Object
Constructor and Description |
---|
POIFSDocumentPath()
simple constructor for the path of a document that is in the root of the POIFSFileSystem.
|
POIFSDocumentPath(POIFSDocumentPath path, java.lang.String[] components)
constructor that adds additional subdirectories to an existing path
|
POIFSDocumentPath(java.lang.String[] components)
constructor for the path of a document that is not in the root of the POIFSFileSystem
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Two POIFSDocumentPath instances are equal if they have the same number of component Strings, and if each component String is equal to its corresponding component String
(如果两个 POIFSDocumentPath 实例具有相同数量的组件字符串,并且每个组件字符串都等于其对应的组件字符串,则它们是相等的)
|
java.lang.String |
getComponent(int n)
get the specified component
(获取指定组件)
|
java.lang.String |
getName()
Returns the last name in the document path's name sequence.
(返回文档路径名称序列中的姓氏。)
|
POIFSDocumentPath |
getParent()
Returns the path's parent or
null if this path is the root path.
(如果此路径是根路径,则返回路径的父路径或 null。)
|
int |
hashCode()
calculate and return the hashcode
(计算并返回哈希码)
|
int |
length() |
java.lang.String |
toString()
Returns a string representation of the path.
(返回路径的字符串表示形式。)
|
public POIFSDocumentPath()
public POIFSDocumentPath(java.lang.String[] components) throws java.lang.IllegalArgumentException
components
- the Strings making up the path to a document. The Strings must be ordered as they appear in the directory hierarchy of the the document. The first string must be the name of a directory in the root of the POIFSFileSystem, and every Nth (for N > 1) string thereafter must be the name of a directory in the directory identified by the (N-1)th string.
If the components parameter is null or has zero length, the POIFSDocumentPath is appropriate for a document that is in the root of a POIFSFileSystem
(components - 构成文档路径的字符串。字符串必须按照它们出现在文档的目录层次结构中的顺序排列。第一个字符串必须是 POIFSFileSystem 根目录的名称,之后的每个第 N 个(对于 N > 1)字符串必须是由第 (N-1) 个字符串标识的目录中的目录名称。如果 components 参数为 null 或长度为零,则 POIFSDocumentPath 适用于 POIFSFileSystem 根目录中的文档)java.lang.IllegalArgumentException
- if any of the elements in the components parameter are null or have zero length
(java.lang.IllegalArgumentException - 如果 components 参数中的任何元素为 null 或长度为零)
public POIFSDocumentPath(POIFSDocumentPath path, java.lang.String[] components) throws java.lang.IllegalArgumentException
path
- the existing path
(path - 现有路径)
components
- the additional subdirectory names to be added
(components - 要添加的附加子目录名称)
java.lang.IllegalArgumentException
- if any of the Strings in components is null or zero length
(java.lang.IllegalArgumentException - 如果组件中的任何字符串为空或零长度)
public boolean equals(java.lang.Object o)
equals
in class
java.lang.Object
o
- the object we're checking equality for
(o - 我们正在检查相等性的对象)
public int hashCode()
hashCode
in class
java.lang.Object
public int length()
public java.lang.String getComponent(int n) throws java.lang.ArrayIndexOutOfBoundsException
n
- which component (0 ... length() - 1)
(n - 哪个组件 (0 ... length() - 1))
java.lang.ArrayIndexOutOfBoundsException
- if n < 0 or n >= length()
(java.lang.ArrayIndexOutOfBoundsException - 如果 n < 0 或 n >= length())
public POIFSDocumentPath getParent()
Returns the path's parent or null
if this path is the root path.
public java.lang.String getName()
Returns the last name in the document path's name sequence. If the document path's name sequence is empty, then the empty string is returned.
(返回文档路径名称序列中的姓氏。如果文档路径的名称序列为空,则返回空字符串。)public java.lang.String toString()
Returns a string representation of the path. Components are separated by the platform-specific file separator File.separatorChar
toString
in class
java.lang.Object
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.