| org.apache.commons.vfs.FileName
All known Subclasses: org.apache.commons.vfs.provider.AbstractFileName,
FileName | public interface FileName extends Comparable(Code) | | Represents a file name. File names are immutable, and work correctly as
keys in hash tables.
author: Adam Murdoch version: $Revision: 480428 $ $Date: 2006-11-28 22:15:24 -0800 (Tue, 28 Nov 2006) $ See Also: FileObject |
Field Summary | |
final public String | ROOT_PATH The absolute path of the root of a file system. | final public String | SEPARATOR The separator used in file paths. | final public char | SEPARATOR_CHAR The separator character used in file paths. |
ROOT_PATH | final public String ROOT_PATH(Code) | | The absolute path of the root of a file system.
|
SEPARATOR | final public String SEPARATOR(Code) | | The separator used in file paths.
|
SEPARATOR_CHAR | final public char SEPARATOR_CHAR(Code) | | The separator character used in file paths.
|
getBaseName | public String getBaseName()(Code) | | Returns the base name of this file. The base name is the last element
of the file name. For example the base name of
/somefolder/somefile is somefile .
The root file of a file system has an empty base name.
The base name. Never returns null. |
getDepth | public int getDepth()(Code) | | Returns the depth of this file name, within its file system. The depth
of the root of a file system is 0. The depth of any other file is
1 + the depth of its parent.
|
getExtension | public String getExtension()(Code) | | Returns the extension of this file name.
The extension. Returns an empty string if the name has noextension. |
getFriendlyURI | public String getFriendlyURI()(Code) | | returns a "friendly path", this is a path without a password.
This path can not be used to resolve the path again
|
getParent | public FileName getParent()(Code) | | Returns the file name of the parent of this file. The root of a
file system has no parent.
A FileName object representing the parent name. Returnsnull for the root of a file system. |
getPath | public String getPath()(Code) | | Returns the absolute path of this file, within its file system. This
path is normalised, so that . and .. elements
have been removed. Also, the path only contains / as its
separator character. The path always starts with /
The root of a file system has / as its absolute path.
The path. Never returns null. |
getPathDecoded | public String getPathDecoded() throws FileSystemException(Code) | | Returns the absolute path of this file, within its file system. This
path is normalised, so that . and .. elements
have been removed. Also, the path only contains / as its
separator character. The path always starts with /
The root of a file system has / as its absolute path.
In contrast to
FileName.getPath() the path is decoded i.e. all %nn stuff
replaced by its character.
The path. Never returns null. throws: FileSystemException - if the path is not correctly encoded |
getRoot | public FileName getRoot()(Code) | | find the root of the filesystem
|
getRootURI | public String getRootURI()(Code) | | Returns the root URI of the file system this file belongs to.
|
getScheme | public String getScheme()(Code) | | Returns the URI scheme of this file.
|
getType | public FileType getType()(Code) | | Returns the requested or current type of this name.
The "requested" type is the one determined during resolving the name.
In this case the name is a
FileType.FOLDER if it ends with an "/" else
it will be a
FileType.FILE
Once attached it will be changed to reflect the real type of this resource.
FileType.FOLDER or FileType.FILE |
getURI | public String getURI()(Code) | | Returns the absolute URI of this file.
|
isAncestor | public boolean isAncestor(FileName ancestor)(Code) | | Determines if another file name is an ancestor of this file name.
|
isDescendent | public boolean isDescendent(FileName descendent)(Code) | | Determines if another file name is a descendent of this file name.
|
isDescendent | public boolean isDescendent(FileName descendent, NameScope nameScope)(Code) | | Determines if another file name is a descendent of this file name.
|
|
|