Constructor and Description |
---|
HTTPSession(Socket s) |
Modifier and Type | Method and Description |
---|---|
private void |
decodeHeader(BufferedReader in,
Properties pre,
Properties parms,
Properties header)
Decodes the sent headers and loads the data into
java Properties' key - value pairs
|
private void |
decodeMultipartData(String boundary,
byte[] fbuf,
BufferedReader in,
Properties parms,
Properties files)
Decodes the Multipart Body data and put it
into java Properties' key - value pairs.
|
private void |
decodeParms(String parms,
Properties p)
Decodes parameters in percent-encoded URI-format
( e.g.
|
private String |
decodePercent(String str)
Decodes the percent encoding scheme.
|
int[] |
getBoundaryPositions(byte[] b,
byte[] boundary)
Find the byte positions where multipart boundaries start.
|
void |
run() |
private String |
saveTmpFile(byte[] b,
int offset,
int len)
Retrieves the content of a sent file and saves it
to a temporary file.
|
private void |
sendError(String status,
String msg)
Returns an error message as a HTTP response and
throws InterruptedException to stop further request processing.
|
private void |
sendResponse(String status,
String mime,
Properties header,
InputStream data)
Sends given response to the socket.
|
private int |
stripMultipartHeaders(byte[] b,
int offset)
It returns the offset separating multipart file headers
from the file's data.
|
private Socket mySocket
public HTTPSession(Socket s)
private void decodeHeader(BufferedReader in, Properties pre, Properties parms, Properties header) throws InterruptedException
InterruptedException
private void decodeMultipartData(String boundary, byte[] fbuf, BufferedReader in, Properties parms, Properties files) throws InterruptedException
InterruptedException
public int[] getBoundaryPositions(byte[] b, byte[] boundary)
private String saveTmpFile(byte[] b, int offset, int len)
private int stripMultipartHeaders(byte[] b, int offset)
private String decodePercent(String str) throws InterruptedException
InterruptedException
private void decodeParms(String parms, Properties p) throws InterruptedException
InterruptedException
private void sendError(String status, String msg) throws InterruptedException
InterruptedException
private void sendResponse(String status, String mime, Properties header, InputStream data)
Copyright © 2023. All rights reserved.