|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.util.HttpServer.RequestHandler
public static class HttpServer.RequestHandler
Class RequestHandler handles requests
| Field Summary | |
|---|---|
static String |
CRLF
crlf |
static char |
LF
_more_ |
protected HttpServer |
server
Back reference to server |
| Constructor Summary | |
|---|---|
HttpServer.RequestHandler(HttpServer server,
Socket socket)
Ctor |
|
| Method Summary | |
|---|---|
protected void |
addArg(Hashtable args,
String name,
String value)
|
OutputStream |
getOutputStream()
_more_ |
Socket |
getSocket()
_more_ |
protected void |
handleFileUpload(String attrName,
String filename,
Hashtable props,
Hashtable args,
org.apache.commons.fileupload.MultipartStream multipartStream)
_more_ |
protected void |
handleRequest(String path,
Hashtable formArgs,
Hashtable httpArgs,
String content)
Handle the request. |
protected void |
log(String msg)
_more_ |
protected boolean |
okToParseContent(String path,
String contentString,
Hashtable httpArgs)
_more_ |
protected void |
parseArgs(String args,
Hashtable ht)
Utility to parse name=value& args |
void |
redirect(String url)
_more_ |
void |
run()
Run the read |
protected void |
writeBytes(InputStream fis,
String type,
long length)
Transfer bytes |
protected void |
writeHeader(int code,
long length,
String type)
_more_ |
protected void |
writeHeaderArgs()
_more_ |
void |
writeHtml(StringBuffer content)
_more_ |
protected void |
writeLine(String line)
Write the line to the output |
void |
writeResult(boolean ok,
byte[] content,
String type)
_more_ |
void |
writeResult(boolean ok,
StringBuffer content,
String type)
_more_ |
void |
writeResult(boolean ok,
String content,
String type)
Write header and content |
void |
writeResult(int code,
byte[] content,
String type)
_more_ |
void |
writeResult(int code,
InputStream inputStream,
String type)
_more_ |
void |
writeResult(int code,
StringBuffer content,
String type)
_more_ |
void |
writeResult(int code,
String content,
String type)
_more_ |
void |
writeXml(StringBuffer content)
_more_ |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CRLF
public static final char LF
protected HttpServer server
| Constructor Detail |
|---|
public HttpServer.RequestHandler(HttpServer server,
Socket socket)
throws Exception
server - The serversocket - The socket
Exception - On badness| Method Detail |
|---|
public Socket getSocket()
public OutputStream getOutputStream()
public void run()
run in interface Runnableprotected void log(String msg)
msg - _more_
protected void addArg(Hashtable args,
String name,
String value)
protected void handleFileUpload(String attrName,
String filename,
Hashtable props,
Hashtable args,
org.apache.commons.fileupload.MultipartStream multipartStream)
throws Exception
attrName - _more_filename - _more_props - _more_args - _more_multipartStream - _more_
Exception - _more_
protected boolean okToParseContent(String path,
String contentString,
Hashtable httpArgs)
path - _more_contentString - _more_httpArgs - _more_
protected void parseArgs(String args,
Hashtable ht)
args - Argsht - Table to put args in
protected void handleRequest(String path,
Hashtable formArgs,
Hashtable httpArgs,
String content)
throws Exception
path - Url pathformArgs - get or post argshttpArgs - http headerscontent - _more_
Exception - On badness
protected void writeLine(String line)
throws Exception
line - Line of text
Exception - On badness
public void writeResult(boolean ok,
String content,
String type)
throws Exception
ok - Was okcontent - The content to writetype - Type of content
Exception - On badness
public void writeResult(int code,
String content,
String type)
throws Exception
code - _more_content - _more_type - _more_
Exception - _more_
public void writeResult(boolean ok,
StringBuffer content,
String type)
throws Exception
ok - _more_content - _more_type - _more_
Exception - _more_
public void writeResult(int code,
StringBuffer content,
String type)
throws Exception
code - _more_content - _more_type - _more_
Exception - _more_
public void writeXml(StringBuffer content)
throws Exception
content - _more_
Exception - _more_
public void writeHtml(StringBuffer content)
throws Exception
content - _more_
Exception - _more_
public void writeResult(boolean ok,
byte[] content,
String type)
throws Exception
ok - _more_content - _more_type - _more_
Exception - On badness
public void writeResult(int code,
byte[] content,
String type)
throws Exception
code - _more_content - _more_type - _more_
Exception - _more_
public void writeResult(int code,
InputStream inputStream,
String type)
throws Exception
code - _more_inputStream - _more_type - _more_
Exception - _more_
protected void writeHeader(int code,
long length,
String type)
throws Exception
code - return codelength - _more_type - _more_
Exception - On badness
public void redirect(String url)
throws Exception
url - _more_
Exception - _more_
protected void writeHeaderArgs()
throws Exception
Exception - _more_
protected void writeBytes(InputStream fis,
String type,
long length)
throws Exception
fis - input streamtype - _more_length - _more_
Exception - On badness
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||