de.tud.dvs1.mmpgp2p
Class ServerThreadHttpInterface

java.lang.Object
  extended by de.tud.dvs1.mmpgp2p.ServerThreadHttpInterface
All Implemented Interfaces:
ServerThreadOutputInterface

public class ServerThreadHttpInterface
extends java.lang.Object
implements ServerThreadOutputInterface

Klasse zur Aufbereitung der ServerThread Daten in einem HttpInterface


Constructor Summary
ServerThreadHttpInterface()
           
 
Method Summary
static byte[] base64Decode(java.lang.String encoded)
          Decodes BASE64 encoded string.
 void log_debug(java.lang.Exception e)
           
 void log_debug(java.lang.String s)
           
 void log(java.lang.Exception e)
           
 void log(java.lang.String s)
           
 void setServerThread(ServerThread p)
           
 void work(java.lang.String requestString, java.io.OutputStream outs, java.io.InputStreamReader ins)
          Ein spartanisches HTTP-Interface erzeugen, um Informationen über den Server abzufragen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerThreadHttpInterface

public ServerThreadHttpInterface()
Method Detail

setServerThread

public void setServerThread(ServerThread p)
Specified by:
setServerThread in interface ServerThreadOutputInterface

log_debug

public void log_debug(java.lang.String s)

log

public void log(java.lang.String s)

log_debug

public void log_debug(java.lang.Exception e)

log

public void log(java.lang.Exception e)

work

public void work(java.lang.String requestString,
                 java.io.OutputStream outs,
                 java.io.InputStreamReader ins)
          throws java.io.IOException,
                 MmpgP2PException
Ein spartanisches HTTP-Interface erzeugen, um Informationen über den Server abzufragen.

Parameters:
requestString - Der HTTP-Request (erste Zeile des Headers, z.B. "GET / HTTP/1.1")
out - Ausgabe-Stream des Client-Sockets
in - Eingabe-Stream des Client-Sockets
Throws:
java.io.IOException
MmpgP2PException

base64Decode

public static byte[] base64Decode(java.lang.String encoded)
Decodes BASE64 encoded string.

Parameters:
encoded - string
Returns:
decoded data as byte array