E - type of BoxJsonObject to be returned in the response.R - type of BoxRequest being created.public abstract class BoxRequestUpload<E extends BoxJsonObject,R extends BoxRequest<E,R>> extends BoxRequestItem<E,R>
| Modifier and Type | Class and Description |
|---|---|
static class |
BoxRequestUpload.UploadRequestHandler
A request handler that is designed to handle the parsing logic necessary for a BoxRequestUpload.
|
BoxRequest.BoxRequestHandler<R extends BoxRequest>, BoxRequest.ContentTypes, BoxRequest.MethodsmId, QUERY_FIELDSJSON_OBJECT, mBodyMap, mContentType, mHeaderMap, mListener, mQueryMap, mRequestMethod, mRequestUrlString, mRequiresSocket, mSession, mTimeout| Constructor and Description |
|---|
BoxRequestUpload(java.lang.Class<E> clazz,
java.io.InputStream fileInputStream,
java.lang.String requestUrl,
BoxSession session)
Creates an upload request from an InputStream with the default parameters.
|
| Modifier and Type | Method and Description |
|---|---|
protected com.box.androidsdk.content.requests.BoxHttpRequest |
createHttpRequest() |
protected com.box.androidsdk.content.requests.BoxRequestMultipart |
createMultipartRequest() |
java.util.Date |
getCreatedDate()
Returns the content created date currently set in the request.
|
java.io.File |
getFile()
Returns the file to upload.
|
protected java.io.InputStream |
getInputStream() |
java.util.Date |
getModifiedDate()
Returns the content modified date currently set in the request.
|
java.lang.String |
getSha1()
Returns the sha1 currently set in the request.
|
long |
getUploadSize()
Returns the size of the upload.
|
protected BoxHttpResponse |
sendRequest(com.box.androidsdk.content.requests.BoxHttpRequest request,
java.net.HttpURLConnection connection) |
R |
setCreatedDate(java.util.Date mCreatedDate)
Sets the content created date in the request.
|
protected void |
setHeaders(com.box.androidsdk.content.requests.BoxHttpRequest request) |
R |
setModifiedDate(java.util.Date mModifiedDate)
Sets the content modified date in the request.
|
R |
setProgressListener(ProgressListener listener)
Sets the progress listener for the upload request.
|
void |
setSha1(java.lang.String sha1)
Sets the sha1 in the request.
|
R |
setUploadSize(long mUploadSize)
Sets the upload size in the request.
|
getId, onSendCompleted, setFieldsbuildUrl, createHeaderMap, createQuery, equals, getIfMatchEtag, getIfNoneMatchEtag, getRequestHandler, getSession, getSocket, getStringBody, handleSendForCachedResult, handleToTaskForCachedResult, handleUpdateCache, hashCode, importRequestContentMapsFrom, logDebug, logRequest, onSend, parseHashMapEntry, parseJsonObject, send, setBody, setContentType, setIfMatchEtag, setIfNoneMatchEtag, setRequestHandler, setTimeOut, toTaskpublic BoxRequestUpload(java.lang.Class<E> clazz, java.io.InputStream fileInputStream, java.lang.String requestUrl, BoxSession session)
clazz - class of the object returned in the response.fileInputStream - file input stream to upload.requestUrl - URL for the upload endpoint.session - the authenticated session that will be used to make the request with.protected void setHeaders(com.box.androidsdk.content.requests.BoxHttpRequest request)
setHeaders in class BoxRequest<E extends BoxJsonObject,R extends BoxRequest<E,R>>protected java.io.InputStream getInputStream()
throws java.io.FileNotFoundException
java.io.FileNotFoundException - thrown if a file was specified, but is not found.protected com.box.androidsdk.content.requests.BoxRequestMultipart createMultipartRequest()
throws java.io.IOException,
BoxException
java.io.IOExceptionBoxExceptionprotected com.box.androidsdk.content.requests.BoxHttpRequest createHttpRequest()
throws java.io.IOException,
BoxException
createHttpRequest in class BoxRequest<E extends BoxJsonObject,R extends BoxRequest<E,R>>java.io.IOExceptionBoxExceptionprotected BoxHttpResponse sendRequest(com.box.androidsdk.content.requests.BoxHttpRequest request, java.net.HttpURLConnection connection) throws java.io.IOException, BoxException
sendRequest in class BoxRequest<E extends BoxJsonObject,R extends BoxRequest<E,R>>java.io.IOExceptionBoxExceptionpublic R setProgressListener(ProgressListener listener)
listener - progress listener for the request.public long getUploadSize()
public R setUploadSize(long mUploadSize)
mUploadSize - size of the upload in bytes.public java.util.Date getModifiedDate()
public R setModifiedDate(java.util.Date mModifiedDate)
mModifiedDate - date to set as the content modified date.public java.util.Date getCreatedDate()
public R setCreatedDate(java.util.Date mCreatedDate)
mCreatedDate - date to set as the content created date in the request.public java.lang.String getSha1()
public void setSha1(java.lang.String sha1)
sha1 - sha1 to set in the request.public java.io.File getFile()