ro.polak.littleServlet
Class HTTPRequest

java.lang.Object
  extended by ro.polak.littleServlet.HTTPRequest

public class HTTPRequest
extends java.lang.Object

HTTP request handler

Java Little Web Server Homepage

Version:
1.0/21.02.2008
Author:
Piotr Polak www.polak.ro

Constructor Summary
HTTPRequest(java.net.Socket socket)
          Class constructor
 
Method Summary
 java.lang.String _get(java.lang.String paramName)
          Returns the value of specified GET attribute
 java.lang.String _post(java.lang.String paramName)
          Returns the value of specified POST attribute
 java.lang.String getCookie(java.lang.String cookieName)
           
 FileUpload getFileUpload()
           
 HTTPRequestHeaders getHeaders()
          Returns headers of the request;
 java.lang.String getRemoteAddr()
           
 boolean isKeepAlive()
           
 boolean isMultipart()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPRequest

public HTTPRequest(java.net.Socket socket)
Class constructor

Parameters:
socket - - socket to be read
Method Detail

getRemoteAddr

public java.lang.String getRemoteAddr()
Returns:
string representation of remote IP

isKeepAlive

public boolean isKeepAlive()
Returns:
true for keep-alive connections

isMultipart

public boolean isMultipart()
Returns:
true for multipart requests

getHeaders

public HTTPRequestHeaders getHeaders()
Returns headers of the request;

Returns:
headers of the request

getFileUpload

public FileUpload getFileUpload()
Returns:
FileUpload for multipart request

getCookie

public java.lang.String getCookie(java.lang.String cookieName)
Parameters:
cookieName - name of cookie
Returns:
String value of cookie

_get

public java.lang.String _get(java.lang.String paramName)
Returns the value of specified GET attribute

Parameters:
paramName - name of the GET attribute
Returns:
value of the GET attribute

_post

public java.lang.String _post(java.lang.String paramName)
Returns the value of specified POST attribute

Parameters:
paramName - name of the POSTT attribute
Returns:
value of the POST attribute