org.plovr
Class HttpUtil

java.lang.Object
  extended by org.plovr.HttpUtil

public final class HttpUtil
extends Object


Method Summary
static URI getReferrer(com.sun.net.httpserver.HttpExchange exchange)
           
static void return404(com.sun.net.httpserver.HttpExchange exchange)
           
static void writeErrorMessageResponse(com.sun.net.httpserver.HttpExchange exchange, String message)
          Returns a 400 with the specified message.
static void writeHtmlErrorMessageResponse(com.sun.net.httpserver.HttpExchange exchange, String htmlMessage)
          Returns a 400 with the specified HTML message.
static void writeHtmlErrorMessageResponse(com.sun.net.httpserver.HttpExchange exchange, String htmlMessage, int errorCode)
           
static void writeNotFound(com.sun.net.httpserver.HttpExchange exchange)
           
static void writeNullResponse(com.sun.net.httpserver.HttpExchange exchange)
          Returns a 400 with no message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getReferrer

public static URI getReferrer(com.sun.net.httpserver.HttpExchange exchange)

writeNullResponse

public static void writeNullResponse(com.sun.net.httpserver.HttpExchange exchange)
                              throws IOException
Returns a 400 with no message.

Throws:
IOException

writeNotFound

public static void writeNotFound(com.sun.net.httpserver.HttpExchange exchange)
                          throws IOException
Throws:
IOException

writeErrorMessageResponse

public static void writeErrorMessageResponse(com.sun.net.httpserver.HttpExchange exchange,
                                             String message)
                                      throws IOException
Returns a 400 with the specified message.

Throws:
IOException

return404

public static void return404(com.sun.net.httpserver.HttpExchange exchange)
                      throws IOException
Throws:
IOException

writeHtmlErrorMessageResponse

public static void writeHtmlErrorMessageResponse(com.sun.net.httpserver.HttpExchange exchange,
                                                 String htmlMessage,
                                                 int errorCode)
                                          throws IOException
Throws:
IOException

writeHtmlErrorMessageResponse

public static void writeHtmlErrorMessageResponse(com.sun.net.httpserver.HttpExchange exchange,
                                                 String htmlMessage)
                                          throws IOException
Returns a 400 with the specified HTML message.

Throws:
IOException