org.apache.commons.vfs.provider
Class URLFileName

java.lang.Object
  extended by org.apache.commons.vfs.provider.AbstractFileName
      extended by org.apache.commons.vfs.provider.GenericFileName
          extended by org.apache.commons.vfs.provider.URLFileName
All Implemented Interfaces:
java.lang.Comparable, FileName
Direct Known Subclasses:
UrlFileName

public class URLFileName
extends GenericFileName

Author:
Commons VFS team

Field Summary
 
Fields inherited from interface org.apache.commons.vfs.FileName
ROOT_PATH, SEPARATOR, SEPARATOR_CHAR
 
Constructor Summary
URLFileName(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)
           
 
Method Summary
 FileName createName(java.lang.String absPath, FileType type)
          Create a FileName.
protected  java.lang.String createURI()
          Append query string to the uri.
 java.lang.String getPathQuery()
          Get the path and query string e.g.
 java.lang.String getPathQueryEncoded(java.lang.String charset)
          Get the path encoded suitable for url like filesystem e.g.
 java.lang.String getQueryString()
          Get the query string.
 java.lang.String getURIEncoded(java.lang.String charset)
          Encode a URI.
 
Methods inherited from class org.apache.commons.vfs.provider.GenericFileName
appendCredentials, appendRootUri, getDefaultPort, getHostName, getPassword, getPort, getUserName
 
Methods inherited from class org.apache.commons.vfs.provider.AbstractFileName
checkName, compareTo, equals, getBaseName, getDepth, getExtension, getFriendlyURI, getParent, getPath, getPathDecoded, getRelativeName, getRoot, getRootURI, getScheme, getType, getURI, getUriTrailer, hashCode, isAncestor, isDescendent, isDescendent, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

URLFileName

public URLFileName(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)
Method Detail

getQueryString

public java.lang.String getQueryString()
Get the query string.

Returns:
the query string part of the filename

getPathQuery

public java.lang.String getPathQuery()
Get 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 org.apache.commons.httpclient.URIException,
                                            FileSystemException
Get the path encoded suitable for url like filesystem e.g. (http, webdav).

Parameters:
charset - the charset used for the path encoding
Returns:
The encoded path.
Throws:
org.apache.commons.httpclient.URIException - If an error occurs encoding the URI.
FileSystemException - If some other error occurs.

createName

public FileName createName(java.lang.String absPath,
                           FileType type)
Create a FileName.

Overrides:
createName in class GenericFileName
Parameters:
absPath - The absolute path.
type - The FileType.
Returns:
The FileName

createURI

protected java.lang.String createURI()
Append query string to the uri.

Overrides:
createURI in class AbstractFileName
Returns:
the uri

getURIEncoded

public java.lang.String getURIEncoded(java.lang.String charset)
                               throws FileSystemException,
                                      org.apache.commons.httpclient.URIException
Encode a URI.

Parameters:
charset - The character set.
Returns:
The encoded URI
Throws:
FileSystemException - if some other exception occurs.
org.apache.commons.httpclient.URIException - if an exception occurs encoding the URI.


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.