Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.meterware.pseudoserver
Class HttpRequest  view HttpRequest download HttpRequest.java

java.lang.Object
  extended bycom.meterware.pseudoserver.ReceivedHttpMessage
      extended bycom.meterware.pseudoserver.HttpRequest

class HttpRequest
extends ReceivedHttpMessage

Represents a single HTTP request, extracted from the input stream.

Since:
1.6

Field Summary
private  java.lang.String _command
           
private  java.util.Hashtable _parameters
           
private  java.lang.String _protocol
           
private  java.lang.String _uri
           
 
Constructor Summary
(package private) HttpRequest(java.io.InputStream inputStream)
           
 
Method Summary
private  void addParameter(java.util.Hashtable parameters, java.lang.String name, java.lang.String value)
           
(package private)  void appendContents(java.lang.StringBuffer sb)
           
(package private)  void appendMessageHeader(java.lang.StringBuffer sb)
           
(package private)  byte[] getBody()
           
 java.lang.String getCommand()
          Returns the command associated with this request.
private  java.lang.String getConnectionHeader()
           
(package private)  java.lang.String getHeader(java.lang.String name)
           
 java.lang.String[] getParameter(java.lang.String name)
          Returns the parameter with the specified name.
private  java.lang.String getParameterString(java.lang.String uri)
           
 java.lang.String getProtocol()
          Returns the protocol string specified in the message header for this request.
(package private)  java.io.Reader getReader()
           
 java.lang.String getURI()
          Returns the URI specified in the message header for this request.
(package private)  void interpretMessageHeader(java.lang.String messageHeader)
           
private  java.util.Hashtable readParameters(java.lang.String content)
           
 java.lang.String toString()
          Convert this Object to a human-readable String.
(package private)  boolean wantsKeepAlive()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_protocol

private java.lang.String _protocol

_command

private java.lang.String _command

_uri

private java.lang.String _uri

_parameters

private java.util.Hashtable _parameters
Constructor Detail

HttpRequest

HttpRequest(java.io.InputStream inputStream)
      throws java.io.IOException
Method Detail

interpretMessageHeader

void interpretMessageHeader(java.lang.String messageHeader)
Specified by:
interpretMessageHeader in class ReceivedHttpMessage

appendMessageHeader

void appendMessageHeader(java.lang.StringBuffer sb)
Specified by:
appendMessageHeader in class ReceivedHttpMessage

getCommand

public java.lang.String getCommand()
Returns the command associated with this request.


getURI

public java.lang.String getURI()
Returns the URI specified in the message header for this request.


getProtocol

public java.lang.String getProtocol()
Returns the protocol string specified in the message header for this request.


getParameter

public java.lang.String[] getParameter(java.lang.String name)
Returns the parameter with the specified name. If no such parameter exists, will return null.


getParameterString

private java.lang.String getParameterString(java.lang.String uri)

wantsKeepAlive

boolean wantsKeepAlive()

readParameters

private java.util.Hashtable readParameters(java.lang.String content)

addParameter

private void addParameter(java.util.Hashtable parameters,
                          java.lang.String name,
                          java.lang.String value)

getConnectionHeader

private java.lang.String getConnectionHeader()

toString

public java.lang.String toString()
Description copied from class: java.lang.Object
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it into System.out.println() 55 and such.

It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.

This method will be called when performing string concatenation with this object. If the result is null, string concatenation will instead use "null".

The default implementation returns getClass().getName() + "@" + Integer.toHexString(hashCode()).


appendContents

void appendContents(java.lang.StringBuffer sb)

getReader

java.io.Reader getReader()

getHeader

java.lang.String getHeader(java.lang.String name)

getBody

byte[] getBody()