kom.tools.web
Class POSTResponse

java.lang.Object
  |
  +--kom.tools.web.HTTPResponse
        |
        +--kom.tools.web.POSTResponse

public class POSTResponse
extends HTTPResponse
implements HTTPRequestParser

Response to a POST request


Field Summary
(package private) static java.lang.String CDFDN
           
(package private) static java.lang.String CTCOLSP
           
private  java.lang.String delimiter
           
private  java.lang.String DLMS
           
(package private) static java.lang.String FILENAME_KEY
           
protected  UniqueId id
          Unique id generator
private  java.io.ByteArrayOutputStream line
           
private  boolean lynx
           
(package private) static java.lang.String MULTIPART_FORM_DATA
           
private  ReadFile rf
           
private  long sleep
           
protected  java.lang.String tmpDir
          Temporary directory for uploading
 
Fields inherited from class kom.tools.web.HTTPResponse
APPLICATION_URLENCODED, boundary, BOUNDARY, broke, close, config, contentType, cursor, fileToDelete, gateway, header, in, len, method, newSession, out, pairs, protocol, reasonPhrase, request, response, sendBytes, servletBase, session, sessionId, statusCode, tmpFile, upload, uri
 
Constructor Summary
POSTResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, HTTPConfig config, Gateway gateway, UniqueId id)
          Class constructor
 
Method Summary
 void addvalue(java.lang.String key, java.lang.String value)
          Puts a String into the pairs table, possibly as a new element in the old value.
 void finalize()
          Removes the temporary request file
 java.io.InputStream getResponseData()
          Creates InputStream for result of POST request.
 void parse()
          Parses the request
protected  void parseBody()
          Parses the body of the HTTP request
private  void parseMultipart()
          Parses multipart data
private  void parseURLEncoded()
          Parses URL-encoded data
 void processPart()
          Processes a part of a multipart request
 void uploadFileData(java.lang.String mime, java.lang.String name, java.lang.String filename)
          Uploads the contents of a file from the request.
 
Methods inherited from class kom.tools.web.HTTPResponse
addHeader, get, getHttpSession, getValues, names, parseURI, processRequest, put, put, readRequest, setCookie, setPhrase, setStatus
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

tmpDir

protected java.lang.String tmpDir
Temporary directory for uploading

id

protected UniqueId id
Unique id generator

sleep

private long sleep

delimiter

private java.lang.String delimiter

line

private java.io.ByteArrayOutputStream line

rf

private ReadFile rf

MULTIPART_FORM_DATA

static final java.lang.String MULTIPART_FORM_DATA

FILENAME_KEY

static final java.lang.String FILENAME_KEY

CDFDN

static final java.lang.String CDFDN

CTCOLSP

static final java.lang.String CTCOLSP

lynx

private boolean lynx

DLMS

private final java.lang.String DLMS
Constructor Detail

POSTResponse

public POSTResponse(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response,
                    HTTPConfig config,
                    Gateway gateway,
                    UniqueId id)
             throws javax.servlet.ServletException,
                    java.io.IOException
Class constructor
Parameters:
request - HTTP request
response - HTTP response
config - Server configuration data
gateway - Client supervisor
id - Unique id initial value
Throws:
ServletException, - IOException
Method Detail

finalize

public void finalize()
Removes the temporary request file
Specified by:
finalize in interface HTTPRequestParser
Overrides:
finalize in class java.lang.Object

addvalue

public void addvalue(java.lang.String key,
                     java.lang.String value)
Puts a String into the pairs table, possibly as a new element in the old value.
Parameters:
key - Key to value
value - String value

parse

public void parse()
Parses the request
Specified by:
parse in interface HTTPRequestParser

parseBody

protected void parseBody()
Parses the body of the HTTP request

parseURLEncoded

private void parseURLEncoded()
Parses URL-encoded data

parseMultipart

private void parseMultipart()
Parses multipart data

processPart

public void processPart()
Processes a part of a multipart request

uploadFileData

public void uploadFileData(java.lang.String mime,
                           java.lang.String name,
                           java.lang.String filename)
Uploads the contents of a file from the request.
Specified by:
uploadFileData in interface HTTPRequestParser
Parameters:
mime - MIME type for file data
name - "name" of file
filename - File name from original

getResponseData

public java.io.InputStream getResponseData()
Creates InputStream for result of POST request.
Overrides:
getResponseData in class HTTPResponse
Tags copied from class: HTTPResponse
Returns:
InputStream for response