Class RemoteConnectorResponseImpl
java.lang.Object
org.alfresco.repo.remoteconnector.RemoteConnectorResponseImpl
- All Implemented Interfaces:
RemoteConnectorResponse
Helper wrapper around a Remote Request, to be performed by the
RemoteConnectorService.- Since:
- 4.0.2
- Author:
- Nick Burch
-
Constructor Summary
ConstructorsConstructorDescriptionRemoteConnectorResponseImpl(RemoteConnectorRequest request, String contentType, String charset, int status, org.apache.commons.httpclient.Header[] headers, byte[] response) RemoteConnectorResponseImpl(RemoteConnectorRequest request, String contentType, String charset, int status, org.apache.commons.httpclient.Header[] headers, InputStream response) Creates a new Response object with the data coming from a stream. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]org.apache.commons.httpclient.Header[]int
-
Constructor Details
-
RemoteConnectorResponseImpl
public RemoteConnectorResponseImpl(RemoteConnectorRequest request, String contentType, String charset, int status, org.apache.commons.httpclient.Header[] headers, InputStream response) Creates a new Response object with the data coming from a stream. Because of the HttpClient lifecycle, a HttpClient response InputStream shouldn't be used as cleanup is needed -
RemoteConnectorResponseImpl
public RemoteConnectorResponseImpl(RemoteConnectorRequest request, String contentType, String charset, int status, org.apache.commons.httpclient.Header[] headers, byte[] response)
-
-
Method Details
-
getStatus
public int getStatus()- Specified by:
getStatusin interfaceRemoteConnectorResponse- Returns:
- The HTTP
StatusCode for the response
-
getCharset
- Specified by:
getCharsetin interfaceRemoteConnectorResponse- Returns:
- The charset of the response content, if available
-
getContentType
- Specified by:
getContentTypein interfaceRemoteConnectorResponse- Returns:
- The mimetype of the response content, if available
-
getRawContentType
- Specified by:
getRawContentTypein interfaceRemoteConnectorResponse- Returns:
- The raw response content type, if available
-
getRequest
- Specified by:
getRequestin interfaceRemoteConnectorResponse- Returns:
- The request that generated this response
-
getResponseHeaders
public org.apache.commons.httpclient.Header[] getResponseHeaders()- Specified by:
getResponseHeadersin interfaceRemoteConnectorResponse- Returns:
- All of the response headers
-
getResponseBodyAsBytes
- Specified by:
getResponseBodyAsBytesin interfaceRemoteConnectorResponse- Returns:
- The response data, as a byte array
- Throws:
IOException
-
getResponseBodyAsStream
- Specified by:
getResponseBodyAsStreamin interfaceRemoteConnectorResponse- Returns:
- The response data, as a stream
-
getResponseBodyAsString
- Specified by:
getResponseBodyAsStringin interfaceRemoteConnectorResponse- Returns:
- The response as a string, based on the response content type charset
- Throws:
IOException
-