public class HttpResponseUtils
extends java.lang.Object
| 修飾子とタイプ | クラス | 説明 |
|---|---|---|
static class |
HttpResponseUtils.RedirectStatusCode |
| コンストラクタ | 説明 |
|---|---|
HttpResponseUtils() |
| 修飾子とタイプ | メソッド | 説明 |
|---|---|---|
static <T> void |
charset(HttpResponse response,
java.lang.String charset) |
Sets a charset to the response.
|
static java.lang.Long |
connectionContentLength(java.net.URLConnection conn) |
|
static java.util.Date |
connectionLastModified(java.net.URLConnection conn) |
|
static HttpResponse |
contentLength(HttpResponse response,
java.lang.Long len) |
Sets a size of the response message.
|
static HttpResponse |
contentType(HttpResponse response,
java.lang.String type) |
Sets a content type to the response.
|
static <T> T |
getHeader(HttpResponse response,
java.lang.String name) |
Returns the header value of the given response.
|
static void |
header(HttpResponse response,
java.lang.String name,
java.lang.String value) |
Sets a response header with the given name and value
|
static boolean |
isEmptyBody(HttpResponse response) |
|
static boolean |
isJarDirectory(java.net.JarURLConnection conn) |
|
static HttpResponse |
lastModified(HttpResponse response,
java.util.Date lastModified) |
|
static HttpResponse |
redirect(java.lang.String url,
HttpResponseUtils.RedirectStatusCode code) |
Create a response with a Location header.
|
static enkan.util.HttpResponseUtils.ContentData |
resourceData(java.net.URL url) |
|
static HttpResponse |
resourceResponse(java.lang.String path,
enkan.collection.OptionMap options) |
|
static HttpResponse |
response(java.lang.String body) |
Create a response with a string body.
|
static HttpResponse |
urlResponse(java.net.URL url) |
public static HttpResponse redirect(java.lang.String url, HttpResponseUtils.RedirectStatusCode code)
url - a redirect urlcode - a HTTP status code in redirectpublic static HttpResponse response(java.lang.String body)
body - string bodypublic static <T> T getHeader(HttpResponse response, java.lang.String name)
T - the type of the header valueresponse - a response objectname - the name of the headerpublic static void header(HttpResponse response, java.lang.String name, java.lang.String value)
response - a response objectname - the name of the headervalue - the header valuepublic static <T> void charset(HttpResponse response, java.lang.String charset)
response - a response objectcharset - the name of the character setpublic static HttpResponse contentType(HttpResponse response, java.lang.String type)
response - a response objecttype - the type of the contentpublic static HttpResponse contentLength(HttpResponse response, java.lang.Long len)
response - a response objectlen - the length of response messagepublic static HttpResponse lastModified(HttpResponse response, java.util.Date lastModified)
public static boolean isJarDirectory(java.net.JarURLConnection conn)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.Long connectionContentLength(java.net.URLConnection conn)
public static java.util.Date connectionLastModified(java.net.URLConnection conn)
public static enkan.util.HttpResponseUtils.ContentData resourceData(java.net.URL url)
public static HttpResponse urlResponse(java.net.URL url)
public static HttpResponse resourceResponse(java.lang.String path, enkan.collection.OptionMap options)
public static boolean isEmptyBody(HttpResponse response)
Copyright © 2016–2018. All rights reserved.