| |
|
| java.lang.Object org.savarese.barehttp.HTTPSession
HTTPSession | public class HTTPSession (Code) | | An HTTPSession executes an HTTP conversation via an InputStream and
OutputSream. It processes only one request and then terminates the
session. Only HTTP/0.9, 1.0, and 1.1 GET requests and HTTP/1.0 and
1.1 HEAD requests are supported. The canonical pathname of served
files is checked against the document root. If the file path does
not fall under the document root, an HTTP "403 Forbidden Resource"
error is returned.
author: Daniel F. Savarese |
Inner Class :final class Request | |
Constructor Summary | |
public | HTTPSession(String documentRoot, InputStream in, OutputStream out) Creates an HTTPSession rooted at the specified document directory
and communicating via the specified streams. |
NOT_IMPLEMENTED_STATUS | final static String NOT_IMPLEMENTED_STATUS(Code) | | |
PATTERN | final static Pattern[] PATTERN(Code) | | |
URL_PATTERN_STRING | final static String URL_PATTERN_STRING(Code) | | |
matcher | Perl5Matcher matcher(Code) | | |
HTTPSession | public HTTPSession(String documentRoot, InputStream in, OutputStream out) throws IOException(Code) | | Creates an HTTPSession rooted at the specified document directory
and communicating via the specified streams.
Parameters: documentRoot - The fully qualified directory pathname toserve as the document root. Parameters: in - The InputStream via which the client submits its request. Parameters: out - The OutputStram via which the HTTPSession sends its reply. |
execute | public void execute() throws IOException(Code) | | Executes the HTTP conversation and closes the session after
satisfying the first request.
|
validateFile | boolean validateFile(File file) throws IOException(Code) | | Makes a feeble attempt to confine the file to a tree
rooted at the server's document directory.
|
|
|
|