| com.caucho.server.hmux.HmuxPath
HmuxPath | public class HmuxPath extends FilesystemPath (Code) | | The HTTP scheme. Currently it supports GET and POST.
TODO: support WEBDAV, enabling the full Path API.
|
Inner Class :static class CacheEntry | |
Method Summary | |
protected Path | cacheCopy() | public boolean | canRead() Returns true if the file is readable. | protected HmuxPath | create(String host, int port) | protected HmuxPath | create(FilesystemPath root, String userPath, Map<String, Object> newAttributes, String path, String query) | public boolean | equals(Object o) Overrides equals to test for equality with an HTTP path. | public boolean | exists() Returns true if the file exists. | public Path | fsWalk(String userPath, Map<String, Object> attributes, String uri) Scans the path portion of the URI, i.e. | protected CacheEntry | getCache() | public String | getHost() Returns the host part of the url. | public long | getLastModified() Returns the last modified time. | public long | getLength() | public int | getPort() Returns the port part of the url. | public String | getQuery() Returns the query string. | public String | getScheme() Returns the scheme, http. | public String | getURL() Returns a full URL for the path. | public String | getUserPath() Returns the user's path. | public String | getVirtualHost() Returns the virtual host, if any. | public int | hashCode() Returns a hashCode for the path. | public boolean | isDirectory() Returns the last modified time. | public boolean | isFile() Returns true if the file exists. | public String[] | list() | public Path | lookupImpl(String userPath, Map<String, Object> newAttributes) Overrides the default lookup to parse the host and port
before parsing the path. | public StreamImpl | openReadImpl() Returns a read stream for a GET request. | public StreamImpl | openReadWriteImpl() Returns a read/write pair for a POST request. | protected Path | schemeWalk(String userPath, Map<String, Object> attributes, String uri, int offset) Walk down the path starting from the portion immediately following
the scheme. | public String | toString() Returns the string form of the http path. |
L | protected static L10N L(Code) | | |
_cache | protected static LruCache<String, CacheEntry> _cache(Code) | | |
_cacheEntry | protected CacheEntry _cacheEntry(Code) | | |
_port | protected int _port(Code) | | |
HmuxPath | public HmuxPath(String host, int port)(Code) | | Creates a new HTTP root path with a host and a port.
Parameters: host - the target host Parameters: port - the target port, if zero, uses port 80. |
HmuxPath | HmuxPath(FilesystemPath root, String userPath, Map<String, Object> newAttributes, String path, String query)(Code) | | Creates a new HTTP sub path.
Parameters: root - the HTTP filesystem root Parameters: userPath - the argument to the calling lookup() Parameters: newAttributes - any attributes passed to http Parameters: path - the full normalized path Parameters: query - any query string |
cacheCopy | protected Path cacheCopy()(Code) | | |
canRead | public boolean canRead()(Code) | | Returns true if the file is readable.
|
equals | public boolean equals(Object o)(Code) | | Overrides equals to test for equality with an HTTP path.
|
exists | public boolean exists()(Code) | | Returns true if the file exists.
|
fsWalk | public Path fsWalk(String userPath, Map<String, Object> attributes, String uri)(Code) | | Scans the path portion of the URI, i.e. everything after the
host and port.
Parameters: userPath - the user's supplied path Parameters: attributes - the attributes for the new path Parameters: uri - the full uri for the new path. the found path. |
getCache | protected CacheEntry getCache()(Code) | | |
getHost | public String getHost()(Code) | | Returns the host part of the url.
|
getLastModified | public long getLastModified()(Code) | | Returns the last modified time.
|
getLength | public long getLength()(Code) | | Returns the file's length
|
getPort | public int getPort()(Code) | | Returns the port part of the url.
|
getQuery | public String getQuery()(Code) | | Returns the query string.
|
getScheme | public String getScheme()(Code) | | Returns the scheme, http.
|
getURL | public String getURL()(Code) | | Returns a full URL for the path.
|
getUserPath | public String getUserPath()(Code) | | Returns the user's path.
|
getVirtualHost | public String getVirtualHost()(Code) | | Returns the virtual host, if any.
|
hashCode | public int hashCode()(Code) | | Returns a hashCode for the path.
|
isDirectory | public boolean isDirectory()(Code) | | Returns the last modified time.
|
isFile | public boolean isFile()(Code) | | Returns true if the file exists.
|
list | public String[] list() throws IOException(Code) | | The contents of this directory or null if the path does notrefer to a directory. |
lookupImpl | public Path lookupImpl(String userPath, Map<String, Object> newAttributes)(Code) | | Overrides the default lookup to parse the host and port
before parsing the path.
Parameters: userPath - the path passed in by the user Parameters: newAttributes - attributes passed by the user the final path. |
openReadImpl | public StreamImpl openReadImpl() throws IOException(Code) | | Returns a read stream for a GET request.
|
openReadWriteImpl | public StreamImpl openReadWriteImpl() throws IOException(Code) | | Returns a read/write pair for a POST request.
|
schemeWalk | protected Path schemeWalk(String userPath, Map<String, Object> attributes, String uri, int offset)(Code) | | 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.
Parameters: userPath - the user's passed in path Parameters: attributes - the attributes for the new path Parameters: uri - the normalized full uri Parameters: offset - offset into the uri to start processing, i.e. after thescheme. the looked-up path. |
toString | public String toString()(Code) | | Returns the string form of the http path.
|
|
|