public class RestResult
extends java.lang.Object
implements java.lang.AutoCloseable
HttpURLConnection
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the result.
|
java.net.HttpURLConnection |
getConnection()
Returns the underlying HttpURLConnection object
|
java.io.InputStream |
getInputStream()
Returns the input stream from the response
|
int |
getResponseCode()
Returns the http response code for the request
|
java.lang.String |
getResponseMessage()
Returns the http response message for the request.
|
RestSession |
getSession()
Returns the RestSession object this RestResult is associated with
|
java.lang.String |
readInputStream()
Convenience method for reading the input stream in its entirety.
|
public RestSession getSession()
public java.net.HttpURLConnection getConnection()
public java.lang.String readInputStream() throws java.io.IOException
java.io.IOException
- if an error occurs reading the input stream.public int getResponseCode() throws java.io.IOException
java.io.IOException
- if the underlying getResponseCode() call throws an IOExceptionpublic java.lang.String getResponseMessage() throws java.io.IOException
java.io.IOException
- if the underlying getResponseMessage() call throws an IOExceptionpublic java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
- if the underlying getInputStream() call throws an IOExceptionpublic void close()
close
in interface java.lang.AutoCloseable