com.ebay.carad.os.vitalsigns.util
Class NanoHTTPD.HTTPSession

java.lang.Object
  extended by com.ebay.carad.os.vitalsigns.util.NanoHTTPD.HTTPSession
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
NanoHTTPD

private class NanoHTTPD.HTTPSession
extends java.lang.Object
implements java.lang.Runnable

Handles one session, i.e. parses the HTTP request and returns the response.


Field Summary
private  java.net.Socket mySocket
           
 
Constructor Summary
NanoHTTPD.HTTPSession(java.net.Socket s)
           
 
Method Summary
private  void decodeParms(java.lang.String parms, java.util.Properties p)
          Decodes parameters in percent-encoded URI-format ( e.g.
private  java.lang.String decodePercent(java.lang.String str)
          Decodes the percent encoding scheme.
 void run()
           
private  void sendError(java.lang.String status, java.lang.String msg)
          Returns an error message as a HTTP response and throws InterruptedException to stop furhter request processing.
private  void sendResponse(java.lang.String status, java.lang.String mime, java.util.Properties header, java.io.InputStream data)
          Sends given response to the socket.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mySocket

private java.net.Socket mySocket
Constructor Detail

NanoHTTPD.HTTPSession

public NanoHTTPD.HTTPSession(java.net.Socket s)
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

decodePercent

private java.lang.String decodePercent(java.lang.String str)
                                throws java.lang.InterruptedException
Decodes the percent encoding scheme.
For example: "an+example%20string" -> "an example string"

Throws:
java.lang.InterruptedException

decodeParms

private void decodeParms(java.lang.String parms,
                         java.util.Properties p)
                  throws java.lang.InterruptedException
Decodes parameters in percent-encoded URI-format ( e.g. "name=Jack%20Daniels&pass=Single%20Malt" ) and adds them to given Properties.

Throws:
java.lang.InterruptedException

sendError

private void sendError(java.lang.String status,
                       java.lang.String msg)
                throws java.lang.InterruptedException
Returns an error message as a HTTP response and throws InterruptedException to stop furhter request processing.

Throws:
java.lang.InterruptedException

sendResponse

private void sendResponse(java.lang.String status,
                          java.lang.String mime,
                          java.util.Properties header,
                          java.io.InputStream data)
Sends given response to the socket.



Copyright © 2004-2009. All Rights Reserved.