Package org.apache.commons.vfs2.provider
Class GenericURLFileName
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractFileName
-
- org.apache.commons.vfs2.provider.GenericFileName
-
- org.apache.commons.vfs2.provider.GenericURLFileName
-
public class GenericURLFileName extends GenericFileName
Generic file name that represents a URL.
-
-
Field Summary
-
Fields inherited from interface org.apache.commons.vfs2.FileName
EMPTY_ARRAY, ROOT_PATH, SEPARATOR, SEPARATOR_CHAR
-
-
Constructor Summary
Constructors Constructor Description GenericURLFileName(java.lang.String scheme, java.lang.String hostName, int port, int defaultPort, java.lang.String userName, java.lang.String password, java.lang.String path, FileType type, java.lang.String queryString)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileNamecreateName(java.lang.String absPath, FileType type)Creates a FileName.protected java.lang.StringcreateURI()Appends query string to the uri.java.lang.StringgetPathQuery()Gets the path and query string e.g.java.lang.StringgetPathQueryEncoded(java.lang.String charset)Gets the path encoded suitable for url like file system e.g.java.lang.StringgetQueryString()Gets the query string.java.lang.StringgetURIEncoded(java.lang.String charset)Encodes a URI.-
Methods inherited from class org.apache.commons.vfs2.provider.GenericFileName
appendCredentials, appendRootUri, getDefaultPort, getHostName, getPassword, getPort, getUserName
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractFileName
checkName, compareTo, equals, getBaseName, getDepth, getExtension, getFriendlyURI, getParent, getPath, getPathDecoded, getRelativeName, getRoot, getRootURI, getScheme, getType, getURI, getUriTrailer, hashCode, isAncestor, isDescendent, isDescendent, isFile, toString
-
-
-
-
Constructor Detail
-
GenericURLFileName
public GenericURLFileName(java.lang.String scheme, java.lang.String hostName, int port, int defaultPort, java.lang.String userName, java.lang.String password, java.lang.String path, FileType type, java.lang.String queryString)
Constructs a new instance.- Parameters:
scheme- Host scheme.hostName- Host name or IP address.port- Host port.defaultPort- Default host port.userName- user name.password- user password.path- Path on the host.type- File type on the host.queryString- Query string for the path.
-
-
Method Detail
-
createName
public FileName createName(java.lang.String absPath, FileType type)
Creates a FileName.- Overrides:
createNamein classGenericFileName- Parameters:
absPath- The absolute path.type- The FileType.- Returns:
- The FileName
-
createURI
protected java.lang.String createURI()
Appends query string to the uri.- Overrides:
createURIin classAbstractFileName- Returns:
- the uri
-
getPathQuery
public java.lang.String getPathQuery()
Gets the path and query string e.g. /path/servlet?param1=true.- Returns:
- the path and its query string
-
getPathQueryEncoded
public java.lang.String getPathQueryEncoded(java.lang.String charset) throws FileSystemException
Gets the path encoded suitable for url like file system e.g. (http, webdav).- Parameters:
charset- the charset used for the path encoding- Returns:
- The encoded path.
- Throws:
FileSystemException- If some other error occurs.
-
getQueryString
public java.lang.String getQueryString()
Gets the query string.- Returns:
- the query string part of the file name
-
getURIEncoded
public java.lang.String getURIEncoded(java.lang.String charset) throws FileSystemException
Encodes a URI.- Parameters:
charset- The character set.- Returns:
- The encoded URI
- Throws:
FileSystemException- if some other exception occurs.
-
-