public class ReqWorker
extends java.lang.Thread
Modifier and Type | Field and Description |
---|---|
static int |
ACCESS_DENIED |
java.net.InetAddress |
clientAddr |
static int |
DUBLICATE_ERROR |
static int |
FILE_MODE |
java.lang.StringBuffer |
httpMsg |
java.lang.String |
method |
java.lang.String |
mimeType |
static int |
NO_RESOURCE |
static int |
NO_SERVICE |
static int |
NORMAL |
int |
port |
pserver.data.VectorMap |
queryParam |
java.lang.String |
queryStr |
java.io.FileInputStream |
rbFile |
long |
rbLength |
java.lang.String |
rbString |
java.lang.String |
request |
static int |
REQUEST_ERR |
boolean |
resAccessible |
java.lang.String |
resFileExt |
java.lang.String |
resPath |
int |
respCode |
int |
respMode |
java.lang.String |
resURI |
static int |
SERVER_ERR |
java.net.Socket |
sock |
java.lang.String |
status |
static int |
UPLOAD_MODE |
Constructor and Description |
---|
ReqWorker(java.net.Socket sock) |
Modifier and Type | Method and Description |
---|---|
boolean |
accessibleFile(java.lang.String physPath)
Checks if the file specified by the physical path is accessible.
|
void |
analyseRequest()
This method analyzes a request.
|
void |
analyzeFileMode() |
void |
analyzeUploadMode() |
java.lang.String |
getFileExt(java.lang.String filename) |
java.lang.String |
getMIMEType(java.lang.String fileExt) |
boolean |
getRequest()
Accepts the incoming HTTP message.
|
void |
httpHeader() |
void |
logRequest() |
boolean |
methodSupported()
Checks if the HTTP request method is supported.
|
void |
parseQueryParam()
Fills the
queryParam parameter. |
boolean |
parseRequest()
Fills all request Parameters, except
queryParam |
void |
respBody()
Checks the the response Code.
|
java.lang.String |
resPhysPath(java.lang.String resLogURI) |
void |
respond() |
void |
run() |
void |
sendResponse() |
java.io.FileInputStream |
streamResponseFile(java.lang.String path) |
void |
switchRespBody() |
void |
switchRespMode() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public java.net.Socket sock
public java.net.InetAddress clientAddr
public int port
public java.lang.String request
public java.lang.String method
public java.lang.String resURI
public java.lang.String queryStr
public pserver.data.VectorMap queryParam
public int respCode
public int respMode
public java.lang.StringBuffer httpMsg
public java.lang.String status
public java.lang.String mimeType
public java.io.FileInputStream rbFile
public java.lang.String rbString
public long rbLength
public static final int NORMAL
public static final int NO_RESOURCE
public static final int REQUEST_ERR
public static final int NO_SERVICE
public static final int SERVER_ERR
public static final int ACCESS_DENIED
public static final int DUBLICATE_ERROR
public static final int FILE_MODE
public static final int UPLOAD_MODE
public java.lang.String resPath
public boolean resAccessible
public java.lang.String resFileExt
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void analyseRequest()
public boolean getRequest()
public boolean parseRequest()
queryParam
request
is null.public boolean methodSupported()
public void parseQueryParam()
queryParam
parameter.public void switchRespMode()
public void analyzeUploadMode()
public void analyzeFileMode()
public java.lang.String resPhysPath(java.lang.String resLogURI)
public boolean accessibleFile(java.lang.String physPath)
physPath
- The path to the file.public java.lang.String getFileExt(java.lang.String filename)
public void respond()
public void respBody()
public void switchRespBody()
public void httpHeader()
public void sendResponse()
public java.io.FileInputStream streamResponseFile(java.lang.String path)
public java.lang.String getMIMEType(java.lang.String fileExt)
public void logRequest()