|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a file name. File names are immutable, and work correctly as keys in hash tables.
FileObject
Field Summary | |
static String |
ROOT_PATH
The absolute path of the root of a file system. |
static String |
SEPARATOR
The separator used in file paths. |
static char |
SEPARATOR_CHAR
The separator character used in file paths. |
Method Summary | |
String |
getBaseName()
Returns the base name of this file. |
int |
getDepth()
Returns the depth of this file name, within its file system. |
String |
getExtension()
Returns the extension of this file name. |
String |
getFriendlyURI()
returns a "friendly path", this is a path without a password. |
FileName |
getParent()
Returns the file name of the parent of this file. |
String |
getPath()
Returns the absolute path of this file, within its file system. |
String |
getPathDecoded()
Returns the absolute path of this file, within its file system. |
String |
getRelativeName(FileName name)
Converts a file name to a relative name, relative to this file name. |
FileName |
getRoot()
find the root of the filesystem |
String |
getRootURI()
Returns the root URI of the file system this file belongs to. |
String |
getScheme()
Returns the URI scheme of this file. |
FileType |
getType()
Returns the requested or current type of this name. |
String |
getURI()
Returns the absolute URI of this file. |
boolean |
isAncestor(FileName ancestor)
Determines if another file name is an ancestor of this file name. |
boolean |
isDescendent(FileName descendent)
Determines if another file name is a descendent of this file name. |
boolean |
isDescendent(FileName descendent,
NameScope nameScope)
Determines if another file name is a descendent of this file name. |
Methods inherited from interface java.lang.Comparable |
compareTo |
Field Detail |
public static final char SEPARATOR_CHAR
public static final String SEPARATOR
public static final String ROOT_PATH
Method Detail |
public String getBaseName()
/somefolder/somefile
is somefile
.
The root file of a file system has an empty base name.
public String getPath()
.
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.
public String getPathDecoded() throws FileSystemException
.
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.
getPath()
the path is decoded i.e. all %nn stuff
replaced by its character.
FileSystemException
- if the path is not correctly encodedpublic String getExtension()
public int getDepth()
public String getScheme()
public String getURI()
public String getRootURI()
public FileName getRoot()
public FileName getParent()
FileName
object representing the parent name. Returns
null for the root of a file system.public String getRelativeName(FileName name) throws FileSystemException
name
- The name to convert to a relative path.
FileSystemException
- On error.public boolean isAncestor(FileName ancestor)
public boolean isDescendent(FileName descendent)
public boolean isDescendent(FileName descendent, NameScope nameScope)
public FileType getType()
FileType.FOLDER
if it ends with an "/" else
it will be a FileType.FILE
FileType.FOLDER
or FileType.FILE
public String getFriendlyURI()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |