T - The class of the response type.public abstract class BaseStreamRequest<T> extends java.lang.Object implements IHttpStreamRequest
| Constructor and Description |
|---|
BaseStreamRequest(java.lang.String requestUrl,
IOneDriveClient client,
java.util.List<Option> options,
java.lang.Class<T> responseClass)
Creates the stream request.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(java.lang.String header,
java.lang.String value)
Adds a header to this request.
|
java.util.List<HeaderOption> |
getHeaders()
Gets the headers.
|
HttpMethod |
getHttpMethod()
Gets the http method.
|
java.util.List<Option> |
getOptions()
Gets the query options for this request.
|
java.net.URL |
getRequestUrl()
Gets the request url.
|
protected java.io.InputStream |
send()
Sends this request.
|
protected T |
send(byte[] fileContents)
Sends this request.
|
protected void |
send(byte[] fileContents,
ICallback<T> callback)
Sends this request.
|
protected void |
send(ICallback<java.io.InputStream> callback)
Sends this request.
|
public BaseStreamRequest(java.lang.String requestUrl,
IOneDriveClient client,
java.util.List<Option> options,
java.lang.Class<T> responseClass)
requestUrl - The url to make the request against.client - The client which can issue the request.options - The options for this request.responseClass - The class for the response.protected void send(ICallback<java.io.InputStream> callback)
callback - The callback when this request complements. The caller needs to close the stream.protected java.io.InputStream send()
throws ClientException
ClientException - An exception occurs if there was an error while the request was sent.protected void send(byte[] fileContents,
ICallback<T> callback)
fileContents - The file to upload.callback - The callback when this request complements. The caller needs to close the stream.protected T send(byte[] fileContents)
fileContents - The file to upload.public java.net.URL getRequestUrl()
getRequestUrl in interface IHttpRequestpublic HttpMethod getHttpMethod()
getHttpMethod in interface IHttpRequestpublic void addHeader(java.lang.String header,
java.lang.String value)
addHeader in interface IHttpRequestheader - The name of the header.value - The value of the header.public java.util.List<HeaderOption> getHeaders()
getHeaders in interface IHttpRequestpublic java.util.List<Option> getOptions()
getOptions in interface IHttpRequest