public class POIFSDocumentPath extends Object
| Constructor and Description |
|---|
POIFSDocumentPath()
simple constructor for the path of a document that is in the root of the POIFSFileSystem.
|
POIFSDocumentPath(POIFSDocumentPath path,
String[] components)
constructor that adds additional subdirectories to an existing path
|
POIFSDocumentPath(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(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
|
String |
getComponent(int n)
get the specified component
|
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. |
int |
hashCode()
calculate and return the hashcode
|
int |
length() |
String |
toString()
Returns a string representation of the path.
|
public POIFSDocumentPath()
public POIFSDocumentPath(String[] components) throws 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 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
IllegalArgumentException - if any of the elements in the components parameter are null or have zero lengthpublic POIFSDocumentPath(POIFSDocumentPath path, String[] components) throws IllegalArgumentException
path - the existing pathcomponents - the additional subdirectory names to be addedIllegalArgumentException - if any of the Strings in components is null or zero lengthpublic boolean equals(Object o)
public int hashCode()
public int length()
public String getComponent(int n) throws ArrayIndexOutOfBoundsException
n - which component (0 ... length() - 1)ArrayIndexOutOfBoundsException - if n < 0 or n >= length()public POIFSDocumentPath getParent()
Returns the path's parent or null if this path
is the root path.
public 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 String toString()
Returns a string representation of the path. Components are
separated by the platform-specific file separator File.separatorChar