|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.vfs.provider.AbstractFileName
public abstract class AbstractFileName
A default file name implementation.
Field Summary |
---|
Fields inherited from interface org.apache.commons.vfs.FileName |
---|
ROOT_PATH, SEPARATOR, SEPARATOR_CHAR |
Constructor Summary | |
---|---|
AbstractFileName(String scheme,
String absPath,
FileType type)
|
Method Summary | |
---|---|
protected abstract void |
appendRootUri(StringBuffer buffer,
boolean addPassword)
Builds the root URI for this file name. |
static boolean |
checkName(String basePath,
String path,
NameScope scope)
Checks whether a path fits in a particular scope of another path. |
int |
compareTo(Object obj)
Implement Comparable. |
abstract FileName |
createName(String absPath,
FileType type)
Factory method for creating name instances. |
protected String |
createURI()
|
boolean |
equals(Object obj)
Determines if this object is equal to another. |
String |
getBaseName()
Returns the base name of the 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 name of the parent of the file. |
String |
getPath()
Returns the absolute path of the file, relative to the root of the file system that the file belongs to. |
String |
getPathDecoded()
Returns the decoded path. |
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 the file. |
protected String |
getUriTrailer()
|
int |
hashCode()
Returns the hashcode for this name. |
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 scope)
Determines if another file name is a descendent of this file name. |
String |
toString()
Returns the URI of the file. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractFileName(String scheme, String absPath, FileType type)
Method Detail |
---|
public int hashCode()
hashCode
in class Object
public boolean equals(Object obj)
equals
in class Object
obj
- The object to compare.
public int compareTo(Object obj)
compareTo
in interface Comparable
obj
- another abstractfilename
public String toString()
toString
in class Object
public abstract FileName createName(String absPath, FileType type)
absPath
- The absolute path.type
- The FileType.
protected abstract void appendRootUri(StringBuffer buffer, boolean addPassword)
buffer
- A StringBuffer to use to construct the URI.addPassword
- true if the password should be added, false otherwise.public String getBaseName()
getBaseName
in interface FileName
public String getPath()
getPath
in interface FileName
protected String getUriTrailer()
public String getPathDecoded() throws FileSystemException
getPathDecoded
in interface FileName
FileSystemException
- If an error occurs.public FileName getParent()
getParent
in interface FileName
public FileName getRoot()
getRoot
in interface FileName
public String getScheme()
getScheme
in interface FileName
public String getURI()
getURI
in interface FileName
protected String createURI()
public String getRelativeName(FileName name) throws FileSystemException
getRelativeName
in interface FileName
name
- The FileName.
FileSystemException
- if an error occurs.public String getRootURI()
getRootURI
in interface FileName
public int getDepth()
getDepth
in interface FileName
public String getExtension()
getExtension
in interface FileName
public boolean isAncestor(FileName ancestor)
isAncestor
in interface FileName
ancestor
- The FileName to check.
public boolean isDescendent(FileName descendent)
isDescendent
in interface FileName
descendent
- The FileName to check.
public boolean isDescendent(FileName descendent, NameScope scope)
isDescendent
in interface FileName
descendent
- The FileName to check.scope
- The NameScope.
public FileType getType()
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.
getType
in interface FileName
FileType.FOLDER
or FileType.FILE
public static boolean checkName(String basePath, String path, NameScope scope)
basePath
- An absolute, normalised path.path
- An absolute, normalised path.scope
- The NameScope.
public String getFriendlyURI()
getFriendlyURI
in interface FileName
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |