public final class HttpResponseStructure
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HTML_BAD_REQUEST |
static java.lang.String |
HTML_INTERNAL_SERVER_ERROR |
static java.lang.String |
HTML_NOT_FOUND |
static java.lang.String |
HTTP_11_STRING |
static java.lang.String |
HTTP_CRLF_STRING |
static int |
HTTP_ENCODING_GZIP |
static java.lang.String |
HTTP_ENCODING_GZIP_STRING |
static int |
HTTP_ENCODING_PLAIN |
static int |
HTTP_ENCODING_ZLIB |
static java.lang.String |
HTTP_ENCODING_ZLIB_STRING |
static java.lang.String |
HTTP_HEADER_CACHE_CONTROL_STRING |
static java.lang.String |
HTTP_HEADER_CACHE_CONTROL_STRINGS |
static java.lang.String |
HTTP_HEADER_DATE_STRING |
static java.lang.String |
HTTP_HEADER_ENCODING_STRING |
static java.lang.String |
HTTP_HEADER_EXPIRES_STRING |
static java.lang.String |
HTTP_HEADER_LENGTH_STRING |
static java.lang.String |
HTTP_HEADER_PRAGMA_STRING |
static java.lang.String |
HTTP_HEADER_TYPE_STRING |
static int |
HTTP_RETURN_ACCEPTED |
static java.lang.String |
HTTP_RETURN_ACCEPTED_STRING |
static int |
HTTP_RETURN_BAD_REQUEST
This constant is used, when HTTP BAD REQUEST (400) shall be returned.
|
static java.lang.String |
HTTP_RETURN_BAD_REQUEST_STRING |
static int |
HTTP_RETURN_INTERNAL_SERVER_ERROR
This constant is used, when HTTP INTERNAL SERVER ERROR (500) shall be returned.
|
static java.lang.String |
HTTP_RETURN_INTERNAL_SERVER_ERROR_STRING |
static int |
HTTP_RETURN_NOT_FOUND
This constant is used, when HTTP NOT FOUND (404) shall be returned.
|
static java.lang.String |
HTTP_RETURN_NOT_FOUND_STRING |
static int |
HTTP_RETURN_OK
This constant is used, when HTTP OK (200) shall be returned.
|
static java.lang.String |
HTTP_RETURN_OK_STRING |
static int |
HTTP_TYPE_APPLICATION_JNLP
This constant is used, when the content part is a JNLP file.
|
static java.lang.String |
HTTP_TYPE_APPLICATION_JNLP_STRING |
static int |
HTTP_TYPE_NO_TYPE
This constant is used, when no content type shall be specified in the HTTP header.
|
static int |
HTTP_TYPE_TEXT_HTML
This constant is used, when the content part is in the HTML format.
|
static java.lang.String |
HTTP_TYPE_TEXT_HTML_STRING |
static int |
HTTP_TYPE_TEXT_PLAIN
This constant is used, when the content part is plain text.
|
static java.lang.String |
HTTP_TYPE_TEXT_PLAIN_STRING |
static int |
HTTP_TYPE_TEXT_XML
This constant is used, when the content part is in the XML format.
|
static java.lang.String |
HTTP_TYPE_TEXT_XML_STRING |
Constructor and Description |
---|
HttpResponseStructure(org.w3c.dom.Document a_xmlDocument)
Creates a new HTTP response with HTTP return code OK (200) and the specified XML data in the
content part.
|
HttpResponseStructure(org.w3c.dom.Document a_xmlDocument,
int a_supportedEncodings)
Creates a new HTTP response with HTTP return code OK (200) and the specified XML data in the
content part.
|
HttpResponseStructure(int a_returnCode)
Creates a new HTTP response, which only consists of the return code specified and sometimes a
describing HTML message.
|
HttpResponseStructure(int a_httpDataType,
int a_httpEncoding,
byte[] a_httpData)
Creates a new HTTP response with HTTP return code OK (200) and the content type and content
data specified.
|
HttpResponseStructure(int a_httpDataType,
int a_httpEncoding,
java.lang.String a_httpData)
Creates a new HTTP response with HTTP return code OK (200) and the content type and content
data specified.
|
HttpResponseStructure(int a_httpDataType,
int a_httpEncoding,
java.lang.String a_httpData,
boolean a_onlyHeader)
Creates a new HTTP response with HTTP return code OK (200) and the content type and content
data specified.
|
HttpResponseStructure(int httpReturnCode,
java.lang.String httpData) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getResponseData()
Returns the data of this HTTP response.
|
public static final int HTTP_RETURN_OK
public static final int HTTP_RETURN_ACCEPTED
public static final int HTTP_RETURN_BAD_REQUEST
public static final int HTTP_RETURN_NOT_FOUND
public static final int HTTP_RETURN_INTERNAL_SERVER_ERROR
public static final int HTTP_TYPE_TEXT_PLAIN
public static final int HTTP_TYPE_TEXT_HTML
public static final int HTTP_TYPE_TEXT_XML
public static final int HTTP_TYPE_APPLICATION_JNLP
public static final int HTTP_ENCODING_PLAIN
public static final int HTTP_ENCODING_ZLIB
public static final int HTTP_ENCODING_GZIP
public static final int HTTP_TYPE_NO_TYPE
public static final java.lang.String HTTP_11_STRING
public static final java.lang.String HTTP_CRLF_STRING
public static final java.lang.String HTTP_RETURN_OK_STRING
public static final java.lang.String HTTP_RETURN_ACCEPTED_STRING
public static final java.lang.String HTTP_RETURN_BAD_REQUEST_STRING
public static final java.lang.String HTTP_RETURN_NOT_FOUND_STRING
public static final java.lang.String HTTP_RETURN_INTERNAL_SERVER_ERROR_STRING
public static final java.lang.String HTTP_HEADER_TYPE_STRING
public static final java.lang.String HTTP_HEADER_ENCODING_STRING
public static final java.lang.String HTTP_HEADER_LENGTH_STRING
public static final java.lang.String HTTP_HEADER_DATE_STRING
public static final java.lang.String HTTP_HEADER_EXPIRES_STRING
public static final java.lang.String HTTP_HEADER_CACHE_CONTROL_STRING
public static final java.lang.String HTTP_HEADER_PRAGMA_STRING
public static final java.lang.String HTTP_HEADER_CACHE_CONTROL_STRINGS
public static final java.lang.String HTTP_ENCODING_ZLIB_STRING
public static final java.lang.String HTTP_ENCODING_GZIP_STRING
public static final java.lang.String HTTP_TYPE_APPLICATION_JNLP_STRING
public static final java.lang.String HTTP_TYPE_TEXT_PLAIN_STRING
public static final java.lang.String HTTP_TYPE_TEXT_HTML_STRING
public static final java.lang.String HTTP_TYPE_TEXT_XML_STRING
public static final java.lang.String HTML_NOT_FOUND
public static final java.lang.String HTML_BAD_REQUEST
public static final java.lang.String HTML_INTERNAL_SERVER_ERROR
public HttpResponseStructure(int a_returnCode)
public HttpResponseStructure(org.w3c.dom.Document a_xmlDocument)
a_xmlDocument
- The XML data for the body of the HTTP response.public HttpResponseStructure(org.w3c.dom.Document a_xmlDocument, int a_supportedEncodings)
a_xmlDocument
- The XML data for the body of the HTTP response.public HttpResponseStructure(int a_httpDataType, int a_httpEncoding, java.lang.String a_httpData)
a_httpDataType
- The content type of the data, see the HTTP_TYPE constants in this
class.a_httpData
- The content data for the HTTP response.public HttpResponseStructure(int a_httpDataType, int a_httpEncoding, byte[] a_httpData)
a_httpDataType
- The content type of the data, see the HTTP_TYPE constants in this
class.a_httpData
- The content data for the HTTP response.public HttpResponseStructure(int a_httpDataType, int a_httpEncoding, java.lang.String a_httpData, boolean a_onlyHeader)
a_httpDataType
- The content type of the data, see the HTTP_TYPE constants in this
class.a_httpData
- The content data for the HTTP response.a_onlyHeader
- If this is true, only the matching HTTP header (including content type
and content length) is included in the response, but not the data
itself. It is needed as response for the HTTP HEAD command. If this
parameter is set to false, the full response including header and
data is created.public HttpResponseStructure(int httpReturnCode, java.lang.String httpData)
Copyright © 2023. All rights reserved.