This is a manager for chunked uploads (allowed for files at least 20MB).
- Create upload session
- Create upload session for existing file
- Get upload session by URL
- Get upload session
- Upload part of file by URL
- Upload part of file
- Remove upload session by URL
- Remove upload session
- List parts by URL
- List parts
- Commit upload session by URL
- Commit upload session
- Upload big file
Creates an upload session for a new file.
This operation is performed by calling function createFileUploadSession
.
See the endpoint docs at API Reference.
client.getChunkedUploads().createFileUploadSession(new CreateFileUploadSessionRequestBody(parentFolderId, fileSize, fileName))
- requestBody
CreateFileUploadSessionRequestBody
- Request body of createFileUploadSession method
- headers
CreateFileUploadSessionHeaders
- Headers of createFileUploadSession method
This function returns a value of type UploadSession
.
Returns a new upload session.
Creates an upload session for an existing file.
This operation is performed by calling function createFileUploadSessionForExistingFile
.
See the endpoint docs at API Reference.
Currently we don't have an example for calling createFileUploadSessionForExistingFile
in integration tests
- fileId
String
- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL
https://*.app.box.com/files/123
thefile_id
is123
. Example: "12345"
- The unique identifier that represents a file. The ID for any file can be determined by visiting a file in the web application and copying the ID from the URL. For example, for the URL
- requestBody
CreateFileUploadSessionForExistingFileRequestBody
- Request body of createFileUploadSessionForExistingFile method
- headers
CreateFileUploadSessionForExistingFileHeaders
- Headers of createFileUploadSessionForExistingFile method
This function returns a value of type UploadSession
.
Returns a new upload session.
Return information about an upload session.
The actual endpoint URL is returned by the Create upload session
endpoint.
This operation is performed by calling function getFileUploadSessionByUrl
.
See the endpoint docs at API Reference.
client.getChunkedUploads().getFileUploadSessionByUrl(statusUrl)
- url
String
- URL of getFileUploadSessionById method
- headers
GetFileUploadSessionByUrlHeaders
- Headers of getFileUploadSessionById method
This function returns a value of type UploadSession
.
Returns an upload session object.
Return information about an upload session.
The actual endpoint URL is returned by the Create upload session
endpoint.
This operation is performed by calling function getFileUploadSessionById
.
See the endpoint docs at API Reference.
client.getChunkedUploads().getFileUploadSessionById(uploadSessionId)
- uploadSessionId
String
- The ID of the upload session. Example: "D5E3F7A"
- headers
GetFileUploadSessionByIdHeaders
- Headers of getFileUploadSessionById method
This function returns a value of type UploadSession
.
Returns an upload session object.
Uploads a chunk of a file for an upload session.
The actual endpoint URL is returned by the Create upload session
and Get upload session
endpoints.
This operation is performed by calling function uploadFilePartByUrl
.
See the endpoint docs at API Reference.
client.getChunkedUploads().uploadFilePartByUrl(acc.getUploadPartUrl(), generateByteStreamFromBuffer(chunkBuffer), new UploadFilePartByUrlHeaders(digest, contentRange))
- url
String
- URL of uploadFilePart method
- requestBody
InputStream
- Request body of uploadFilePart method
- headers
UploadFilePartByUrlHeaders
- Headers of uploadFilePart method
This function returns a value of type UploadedPart
.
Chunk has been uploaded successfully.
Uploads a chunk of a file for an upload session.
The actual endpoint URL is returned by the Create upload session
and Get upload session
endpoints.
This operation is performed by calling function uploadFilePart
.
See the endpoint docs at API Reference.
client.getChunkedUploads().uploadFilePart(acc.getUploadSessionId(), generateByteStreamFromBuffer(chunkBuffer), new UploadFilePartHeaders(digest, contentRange))
- uploadSessionId
String
- The ID of the upload session. Example: "D5E3F7A"
- requestBody
InputStream
- Request body of uploadFilePart method
- headers
UploadFilePartHeaders
- Headers of uploadFilePart method
This function returns a value of type UploadedPart
.
Chunk has been uploaded successfully.
Abort an upload session and discard all data uploaded.
This cannot be reversed.
The actual endpoint URL is returned by the Create upload session
and Get upload session
endpoints.
This operation is performed by calling function deleteFileUploadSessionByUrl
.
See the endpoint docs at API Reference.
client.getChunkedUploads().deleteFileUploadSessionByUrl(abortUrl)
- url
String
- URL of deleteFileUploadSessionById method
- headers
DeleteFileUploadSessionByUrlHeaders
- Headers of deleteFileUploadSessionById method
This function returns a value of type void
.
A blank response is returned if the session was successfully aborted.
Abort an upload session and discard all data uploaded.
This cannot be reversed.
The actual endpoint URL is returned by the Create upload session
and Get upload session
endpoints.
This operation is performed by calling function deleteFileUploadSessionById
.
See the endpoint docs at API Reference.
client.getChunkedUploads().deleteFileUploadSessionById(uploadSessionId)
- uploadSessionId
String
- The ID of the upload session. Example: "D5E3F7A"
- headers
DeleteFileUploadSessionByIdHeaders
- Headers of deleteFileUploadSessionById method
This function returns a value of type void
.
A blank response is returned if the session was successfully aborted.
Return a list of the chunks uploaded to the upload session so far.
The actual endpoint URL is returned by the Create upload session
and Get upload session
endpoints.
This operation is performed by calling function getFileUploadSessionPartsByUrl
.
See the endpoint docs at API Reference.
client.getChunkedUploads().getFileUploadSessionPartsByUrl(listPartsUrl)
- url
String
- URL of getFileUploadSessionParts method
- queryParams
GetFileUploadSessionPartsByUrlQueryParams
- Query parameters of getFileUploadSessionParts method
- headers
GetFileUploadSessionPartsByUrlHeaders
- Headers of getFileUploadSessionParts method
This function returns a value of type UploadParts
.
Returns a list of parts that have been uploaded.
Return a list of the chunks uploaded to the upload session so far.
The actual endpoint URL is returned by the Create upload session
and Get upload session
endpoints.
This operation is performed by calling function getFileUploadSessionParts
.
See the endpoint docs at API Reference.
client.getChunkedUploads().getFileUploadSessionParts(uploadSessionId)
- uploadSessionId
String
- The ID of the upload session. Example: "D5E3F7A"
- queryParams
GetFileUploadSessionPartsQueryParams
- Query parameters of getFileUploadSessionParts method
- headers
GetFileUploadSessionPartsHeaders
- Headers of getFileUploadSessionParts method
This function returns a value of type UploadParts
.
Returns a list of parts that have been uploaded.
Close an upload session and create a file from the uploaded chunks.
The actual endpoint URL is returned by the Create upload session
and Get upload session
endpoints.
This operation is performed by calling function createFileUploadSessionCommitByUrl
.
See the endpoint docs at API Reference.
client.getChunkedUploads().createFileUploadSessionCommitByUrl(commitUrl, new CreateFileUploadSessionCommitByUrlRequestBody(parts), new CreateFileUploadSessionCommitByUrlHeaders(digest))
- url
String
- URL of createFileUploadSessionCommit method
- requestBody
CreateFileUploadSessionCommitByUrlRequestBody
- Request body of createFileUploadSessionCommit method
- headers
CreateFileUploadSessionCommitByUrlHeaders
- Headers of createFileUploadSessionCommit method
This function returns a value of type Files
.
Returns the file object in a list.Returns when all chunks have been uploaded but not yet processed.
Inspect the upload session to get more information about the progress of processing the chunks, then retry committing the file when all chunks have processed.
Close an upload session and create a file from the uploaded chunks.
The actual endpoint URL is returned by the Create upload session
and Get upload session
endpoints.
This operation is performed by calling function createFileUploadSessionCommit
.
See the endpoint docs at API Reference.
client.getChunkedUploads().createFileUploadSessionCommit(uploadSessionId, new CreateFileUploadSessionCommitRequestBody(parts), new CreateFileUploadSessionCommitHeaders(digest))
- uploadSessionId
String
- The ID of the upload session. Example: "D5E3F7A"
- requestBody
CreateFileUploadSessionCommitRequestBody
- Request body of createFileUploadSessionCommit method
- headers
CreateFileUploadSessionCommitHeaders
- Headers of createFileUploadSessionCommit method
This function returns a value of type Files
.
Returns the file object in a list.Returns when all chunks have been uploaded but not yet processed.
Inspect the upload session to get more information about the progress of processing the chunks, then retry committing the file when all chunks have processed.
Starts the process of chunk uploading a big file. Should return a File object representing uploaded file.
This operation is performed by calling function uploadBigFile
.
client.getChunkedUploads().uploadBigFile(fileByteStream, fileName, fileSize, parentFolderId)
- file
InputStream
- The stream of the file to upload.
- fileName
String
- The name of the file, which will be used for storage in Box.
- fileSize
long
- The total size of the file for the chunked upload in bytes.
- parentFolderId
String
- The ID of the folder where the file should be uploaded.
This function returns a value of type FileFull
.