com.caucho.vfs
Class HttpPath

java.lang.Object
  |
  +--com.caucho.vfs.Path
        |
        +--com.caucho.vfs.FilesystemPath
              |
              +--com.caucho.vfs.HttpPath

public class HttpPath
extends FilesystemPath

The HTTP scheme. Currently it supports GET and POST.

TODO: support WEBDAV, enabling the full Path API.


Field Summary
protected  java.lang.String host
           
protected static L10N L
           
protected  int port
           
protected  java.lang.String query
           
 
Fields inherited from class com.caucho.vfs.FilesystemPath
bindRoot, pathname, root, separatorChar, userPath
 
Fields inherited from class com.caucho.vfs.Path
schemeMap
 
Method Summary
protected  Path fsWalk(java.lang.String userPath, java.util.Map attributes, java.lang.String uri)
          Scans the path portion of the URI, i.e.
 java.lang.String getHost()
          Returns the host part of the url.
 int getPort()
          Returns the port part of the url.
 java.lang.String getQuery()
          Returns the query string.
 java.lang.String getScheme()
          Returns the scheme, http.
 java.lang.String getURL()
          Returns the URL for this filesystem path.
 java.lang.String getUserPath()
          Returns the user's path.
 int hashCode()
           
 Path lookup(java.lang.String userPath, java.util.Map newAttributes)
          Overrides the default lookup to parse the host and port before parsing the path.
 StreamImpl openReadImpl()
          Returns a read stream for a GET request.
 StreamImpl openReadWriteImpl()
          Returns a read/write pair for a POST request.
protected  Path schemeWalk(java.lang.String userPath, java.util.Map attributes, java.lang.String uri, int offset)
          Walk down the path starting from the portion immediately following the scheme.
 java.lang.String toString()
          Returns the string form of the http path.
 
Methods inherited from class com.caucho.vfs.FilesystemPath
bind, copy, createRoot, equals, getFullPath, getParent, getPath, getTail, normalizePath, normalizePath, setUserPath
 
Methods inherited from class com.caucho.vfs.Path
canRead, canWrite, createNewFile, createRoot, createTempFile, exists, getAttribute, getAttributeNames, getContentType, getLastModified, getLength, getNativePath, getObject, getValue, isDirectory, isFile, isObject, iterator, list, lookup, lookupNative, lookupNative, mkdir, mkdirs, openAppend, openAppendImpl, openRead, openReadWrite, openWrite, openWriteImpl, remove, removeAttribute, renameTo, renameTo, scanScheme, setAttribute, setLastModified, setObject, setValue, unbind, writeToStream
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

L

protected static L10N L

host

protected java.lang.String host

port

protected int port

query

protected java.lang.String query
Method Detail

lookup

public Path lookup(java.lang.String userPath,
                   java.util.Map newAttributes)
Overrides the default lookup to parse the host and port before parsing the path.
Overrides:
lookup in class Path
Parameters:
userPath - the path passed in by the user
newAttributes - attributes passed by the user
Returns:
the final path.

schemeWalk

protected Path schemeWalk(java.lang.String userPath,
                          java.util.Map attributes,
                          java.lang.String uri,
                          int offset)
Walk down the path starting from the portion immediately following the scheme. i.e. schemeWalk is responsible for parsing the host and port from the URL.
Overrides:
schemeWalk in class FilesystemPath
Parameters:
userPath - the user's passed in path
attributes - the attributes for the new path
uri - the normalized full uri
offset - offset into the uri to start processing, i.e. after the scheme.
Returns:
the looked-up path.

fsWalk

protected Path fsWalk(java.lang.String userPath,
                      java.util.Map attributes,
                      java.lang.String uri)
Scans the path portion of the URI, i.e. everything after the host and port.
Overrides:
fsWalk in class FilesystemPath
Parameters:
userPath - the user's supplied path
attributes - the attributes for the new path
uri - the full uri for the new path.
Returns:
the found path.

getScheme

public java.lang.String getScheme()
Returns the scheme, http.
Overrides:
getScheme in class Path

getURL

public java.lang.String getURL()
Description copied from class: FilesystemPath
Returns the URL for this filesystem path.
Overrides:
getURL in class FilesystemPath

getHost

public java.lang.String getHost()
Returns the host part of the url.
Overrides:
getHost in class Path

getPort

public int getPort()
Returns the port part of the url.
Overrides:
getPort in class Path

getUserPath

public java.lang.String getUserPath()
Returns the user's path.
Overrides:
getUserPath in class FilesystemPath

getQuery

public java.lang.String getQuery()
Returns the query string.
Overrides:
getQuery in class Path

openReadImpl

public StreamImpl openReadImpl()
                        throws java.io.IOException
Returns a read stream for a GET request.
Overrides:
openReadImpl in class Path

openReadWriteImpl

public StreamImpl openReadWriteImpl()
                             throws java.io.IOException
Returns a read/write pair for a POST request.
Overrides:
openReadWriteImpl in class Path

toString

public java.lang.String toString()
Returns the string form of the http path.
Overrides:
toString in class FilesystemPath

hashCode

public int hashCode()
Overrides:
hashCode in class FilesystemPath