public final class Response
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Response.Builder |
Modifier and Type | Field and Description |
---|---|
java.lang.String |
cacheControl |
long |
lastModified |
java.lang.String |
mimeType |
java.lang.String |
redirection |
Status |
status |
Trace |
trace |
Modifier and Type | Method and Description |
---|---|
static Response.Builder |
builder(Status status,
ContentType contentType,
java.lang.String data) |
static Response.Builder |
builder(Status status,
java.lang.String mimeType,
java.io.File file) |
static Response.Builder |
builder(Status status,
java.lang.String mimeType,
java.lang.String data) |
java.lang.String |
checkStatus()
http://www.restapitutorial.com/httpstatuscodes.html
|
byte[] |
getContentAsByteArray()
Get a raw input stream of the content.
|
java.io.File |
getContentAsFile()
Get the content as a file.
|
JSONObject |
getContentAsJSON()
Get the content as a JSON.
|
JSONArray |
getContentAsJSONArray()
Get the content as a JSONArray.
|
java.lang.String |
getContentAsString()
Get the content as a String.
|
org.w3c.dom.Document |
getContentAsXML()
Get the content as a XML.
|
java.util.Date |
getLastModified()
When this response was modified.
|
@Nullable public final java.lang.String redirection
public final Trace trace
public final java.lang.String mimeType
public final java.lang.String cacheControl
public final Status status
public final long lastModified
public static Response.Builder builder(@Nonnull Status status, @Nonnull java.lang.String mimeType, @Nonnull java.io.File file)
public static Response.Builder builder(@Nonnull Status status, @Nonnull java.lang.String mimeType, @Nonnull java.lang.String data)
public static Response.Builder builder(@Nonnull Status status, @Nonnull ContentType contentType, @Nonnull java.lang.String data)
@CheckReturnValue @Nonnull public java.util.Date getLastModified()
@CheckReturnValue @Nonnull public java.lang.String getContentAsString() throws java.io.IOException
java.io.IOException
- problem reading.@CheckReturnValue @Nonnull public org.w3c.dom.Document getContentAsXML() throws java.io.IOException, DocumentException
java.io.IOException
- problem reading.DocumentException
- invalid XML@CheckReturnValue @Nonnull public JSONObject getContentAsJSON() throws java.io.IOException
java.io.IOException
- problem reading.@CheckReturnValue @Nonnull public JSONArray getContentAsJSONArray() throws java.io.IOException
java.io.IOException
- problem reading.@CheckReturnValue @Nonnull public java.io.File getContentAsFile() throws java.io.IOException
java.io.IOException
- problem reading.@CheckReturnValue @Nonnull public byte[] getContentAsByteArray() throws java.io.IOException
java.io.IOException
- a problem reading.@Nonnull public java.lang.String checkStatus() throws java.io.FileNotFoundException, ReSTException
java.io.FileNotFoundException
- 404ReSTException
- unknown error.stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.