public static class BoxRequestsFile.CreateUploadSession extends BoxRequest<BoxUploadSession,BoxRequestsFile.CreateUploadSession>
BoxRequest.BoxRequestHandler<R extends BoxRequest>, BoxRequest.ContentTypes, BoxRequest.Methods, BoxRequest.TLSSSLSocketFactoryJSON_OBJECT, mBodyMap, mContentType, mHeaderMap, mListener, mQueryMap, mRequestMethod, mRequestUrlString, mRequiresSocket, mSession, mTimeout| Constructor and Description |
|---|
CreateUploadSession(java.io.File file,
java.lang.String destinationFolderId,
java.lang.String requestUrl,
BoxSession session)
Creates an upload file session with the default parameters
|
CreateUploadSession(java.io.InputStream is,
java.lang.String fileName,
long fileSize,
java.lang.String destinationFolderId,
java.lang.String requestUrl,
BoxSession session)
Creates an upload file session with the default parameters
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDestinationFolderId()
Returns the destination folder id for the uploaded file.
|
java.lang.String |
getFileName()
Returns the name of the file to upload.
|
long |
getFileSize()
Returns the size of the file to upload
|
protected void |
onSendCompleted(BoxResponse<BoxUploadSession> response)
Post action that will be performed after a successful send occurs.
|
void |
setFileName(java.lang.String mFileName)
Set file name of the file to upload
|
buildUrl, createHeaderMap, createHttpRequest, createQuery, equals, getIfMatchEtag, getIfNoneMatchEtag, getRequestHandler, getSession, getSocket, getStringBody, handleSendForCachedResult, handleToTaskForCachedResult, handleUpdateCache, hashCode, importRequestContentMapsFrom, logDebug, logRequest, onSend, parseHashMapEntry, parseJsonObject, send, sendRequest, setBody, setContentType, setHeaders, setIfMatchEtag, setIfNoneMatchEtag, setRequestHandler, setTimeOut, toTaskpublic CreateUploadSession(java.io.File file,
java.lang.String destinationFolderId,
java.lang.String requestUrl,
BoxSession session)
throws java.io.FileNotFoundException
file - file to uploaddestinationFolderId - id of the parent folder for the new filerequestUrl - URL of the upload file endpointsession - the authenticated session that will be used to make the request withjava.io.FileNotFoundExceptionpublic CreateUploadSession(java.io.InputStream is,
java.lang.String fileName,
long fileSize,
java.lang.String destinationFolderId,
java.lang.String requestUrl,
BoxSession session)
is - the inputStream from where to read the file datafileName - the new file namefileSize - the file sizedestinationFolderId - id of the parent folder for the new filerequestUrl - URL of the upload file endpointsession - the authenticated session that will be used to make the request withprotected void onSendCompleted(BoxResponse<BoxUploadSession> response) throws BoxException
BoxRequestonSendCompleted in class BoxRequest<BoxUploadSession,BoxRequestsFile.CreateUploadSession>response - response of the BoxRequestBoxException - thrown if there was a problem with handling the request.public void setFileName(java.lang.String mFileName)
mFileName - public java.lang.String getFileName()
public long getFileSize()
public java.lang.String getDestinationFolderId()