Class LocalFileName
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractFileName
-
- org.apache.commons.vfs2.provider.local.LocalFileName
-
- Direct Known Subclasses:
WindowsFileName
public class LocalFileName extends AbstractFileName
A local file URI.
-
-
Field Summary
-
Fields inherited from interface org.apache.commons.vfs2.FileName
ROOT_PATH, SEPARATOR, SEPARATOR_CHAR
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedLocalFileName(java.lang.String scheme, java.lang.String rootFile, java.lang.String path, FileType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendRootUri(java.lang.StringBuilder buffer, boolean addPassword)Builds the root URI for this file name.FileNamecreateName(java.lang.String path, FileType type)Factory method for creating name instances.java.lang.StringgetFriendlyURI()returns a "friendly path", this is a path without a password.java.lang.StringgetRootFile()Returns the root file for this file.java.lang.StringgetURI()Returns the absolute URI of the file.java.lang.StringtoString()Returns the decoded URI of the file.-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileName
checkName, compareTo, createURI, equals, getBaseName, getDepth, getExtension, getParent, getPath, getPathDecoded, getRelativeName, getRoot, getRootURI, getScheme, getType, getUriTrailer, hashCode, isAncestor, isDescendent, isDescendent, isFile
-
-
-
-
Constructor Detail
-
LocalFileName
protected LocalFileName(java.lang.String scheme, java.lang.String rootFile, java.lang.String path, FileType type)
-
-
Method Detail
-
getRootFile
public java.lang.String getRootFile()
Returns the root file for this file.- Returns:
- The root file name.
-
createName
public FileName createName(java.lang.String path, FileType type)
Factory method for creating name instances.- Specified by:
createNamein classAbstractFileName- Parameters:
path- The file path.type- The file type.- Returns:
- The FileName.
-
getURI
public java.lang.String getURI()
Returns the absolute URI of the file.- Specified by:
getURIin interfaceFileName- Overrides:
getURIin classAbstractFileName- Returns:
- The absolute URI of the file.
-
getFriendlyURI
public java.lang.String getFriendlyURI()
returns a "friendly path", this is a path without a password.- Specified by:
getFriendlyURIin interfaceFileName- Overrides:
getFriendlyURIin classAbstractFileName- Returns:
- The "friendly" URI.
-
toString
public java.lang.String toString()
Returns the decoded URI of the file.- Overrides:
toStringin classAbstractFileName- Returns:
- the FileName as a URI.
-
appendRootUri
protected void appendRootUri(java.lang.StringBuilder buffer, boolean addPassword)
Builds the root URI for this file name.- Specified by:
appendRootUriin classAbstractFileName- Parameters:
buffer- A StringBuilder to use to construct the URI.addPassword- true if the password should be added, false otherwise.
-
-