org.cruxframework.crux.core.server.rest.spi
Class HttpUtil

java.lang.Object
  extended by org.cruxframework.crux.core.server.rest.spi.HttpUtil

public class HttpUtil
extends Object

Author:
Thiago da Rosa de Bustamante

Constructor Summary
HttpUtil()
           
 
Method Summary
static boolean acceptsGzipEncoding(HttpRequest request)
           
static List<MediaType> extractAccepts(MultivaluedMap<String,String> requestHeaders)
           
static HttpHeaders extractHttpHeaders(javax.servlet.http.HttpServletRequest request)
           
static List<String> extractLanguages(MultivaluedMap<String,String> requestHeaders)
           
static MultivaluedMap<String,String> extractRequestHeaders(javax.servlet.http.HttpServletRequest request)
           
static UriInfo extractUriInfo(javax.servlet.http.HttpServletRequest request)
           
static void sendError(javax.servlet.http.HttpServletResponse response, int status, String message)
           
static boolean shouldGzipResponseContent(HttpRequest request, String responseContent)
           
static String wGet(String targetURL, String urlParameters, String method, String locale)
           
static void writeResponse(HttpRequest request, HttpResponse response, ResourceMethod.MethodReturn methodReturn)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpUtil

public HttpUtil()
Method Detail

extractUriInfo

public static UriInfo extractUriInfo(javax.servlet.http.HttpServletRequest request)

extractHttpHeaders

public static HttpHeaders extractHttpHeaders(javax.servlet.http.HttpServletRequest request)

wGet

public static String wGet(String targetURL,
                          String urlParameters,
                          String method,
                          String locale)

extractAccepts

public static List<MediaType> extractAccepts(MultivaluedMap<String,String> requestHeaders)

extractLanguages

public static List<String> extractLanguages(MultivaluedMap<String,String> requestHeaders)

extractRequestHeaders

public static MultivaluedMap<String,String> extractRequestHeaders(javax.servlet.http.HttpServletRequest request)

acceptsGzipEncoding

public static boolean acceptsGzipEncoding(HttpRequest request)

shouldGzipResponseContent

public static boolean shouldGzipResponseContent(HttpRequest request,
                                                String responseContent)

writeResponse

public static void writeResponse(HttpRequest request,
                                 HttpResponse response,
                                 ResourceMethod.MethodReturn methodReturn)
                          throws IOException
Throws:
IOException

sendError

public static void sendError(javax.servlet.http.HttpServletResponse response,
                             int status,
                             String message)
                      throws IOException
Throws:
IOException


Copyright © 2014. All rights reserved.