public class ChunkedUploadsManager extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ChunkedUploadsManager.Builder |
| Modifier and Type | Field and Description |
|---|---|
Authentication |
auth |
NetworkSession |
networkSession |
| Modifier | Constructor and Description |
|---|---|
|
ChunkedUploadsManager() |
protected |
ChunkedUploadsManager(ChunkedUploadsManager.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
UploadSession |
createFileUploadSession(CreateFileUploadSessionRequestBody requestBody)
Creates an upload session for a new file.
|
UploadSession |
createFileUploadSession(CreateFileUploadSessionRequestBody requestBody,
CreateFileUploadSessionHeaders headers)
Creates an upload session for a new file.
|
Files |
createFileUploadSessionCommit(String uploadSessionId,
CreateFileUploadSessionCommitRequestBody requestBody,
CreateFileUploadSessionCommitHeaders headers)
Close an upload session and create a file from the uploaded chunks.
|
Files |
createFileUploadSessionCommitByUrl(String url,
CreateFileUploadSessionCommitByUrlRequestBody requestBody,
CreateFileUploadSessionCommitByUrlHeaders headers)
Using this method with urls provided in response when creating a new upload session is
preferred to use over CreateFileUploadSessionCommit method.
|
UploadSession |
createFileUploadSessionForExistingFile(String fileId,
CreateFileUploadSessionForExistingFileRequestBody requestBody)
Creates an upload session for an existing file.
|
UploadSession |
createFileUploadSessionForExistingFile(String fileId,
CreateFileUploadSessionForExistingFileRequestBody requestBody,
CreateFileUploadSessionForExistingFileHeaders headers)
Creates an upload session for an existing file.
|
void |
deleteFileUploadSessionById(String uploadSessionId)
Abort an upload session and discard all data uploaded.
|
void |
deleteFileUploadSessionById(String uploadSessionId,
DeleteFileUploadSessionByIdHeaders headers)
Abort an upload session and discard all data uploaded.
|
void |
deleteFileUploadSessionByUrl(String url)
Using this method with urls provided in response when creating a new upload session is
preferred to use over DeleteFileUploadSessionById method.
|
void |
deleteFileUploadSessionByUrl(String url,
DeleteFileUploadSessionByUrlHeaders headers)
Using this method with urls provided in response when creating a new upload session is
preferred to use over DeleteFileUploadSessionById method.
|
Authentication |
getAuth() |
UploadSession |
getFileUploadSessionById(String uploadSessionId)
Return information about an upload session.
|
UploadSession |
getFileUploadSessionById(String uploadSessionId,
GetFileUploadSessionByIdHeaders headers)
Return information about an upload session.
|
UploadSession |
getFileUploadSessionByUrl(String url)
Using this method with urls provided in response when creating a new upload session is
preferred to use over GetFileUploadSessionById method.
|
UploadSession |
getFileUploadSessionByUrl(String url,
GetFileUploadSessionByUrlHeaders headers)
Using this method with urls provided in response when creating a new upload session is
preferred to use over GetFileUploadSessionById method.
|
UploadParts |
getFileUploadSessionParts(String uploadSessionId)
Return a list of the chunks uploaded to the upload session so far.
|
UploadParts |
getFileUploadSessionParts(String uploadSessionId,
GetFileUploadSessionPartsHeaders headers)
Return a list of the chunks uploaded to the upload session so far.
|
UploadParts |
getFileUploadSessionParts(String uploadSessionId,
GetFileUploadSessionPartsQueryParams queryParams)
Return a list of the chunks uploaded to the upload session so far.
|
UploadParts |
getFileUploadSessionParts(String uploadSessionId,
GetFileUploadSessionPartsQueryParams queryParams,
GetFileUploadSessionPartsHeaders headers)
Return a list of the chunks uploaded to the upload session so far.
|
UploadParts |
getFileUploadSessionPartsByUrl(String url)
Using this method with urls provided in response when creating a new upload session is
preferred to use over GetFileUploadSessionParts method.
|
UploadParts |
getFileUploadSessionPartsByUrl(String url,
GetFileUploadSessionPartsByUrlHeaders headers)
Using this method with urls provided in response when creating a new upload session is
preferred to use over GetFileUploadSessionParts method.
|
UploadParts |
getFileUploadSessionPartsByUrl(String url,
GetFileUploadSessionPartsByUrlQueryParams queryParams)
Using this method with urls provided in response when creating a new upload session is
preferred to use over GetFileUploadSessionParts method.
|
UploadParts |
getFileUploadSessionPartsByUrl(String url,
GetFileUploadSessionPartsByUrlQueryParams queryParams,
GetFileUploadSessionPartsByUrlHeaders headers)
Using this method with urls provided in response when creating a new upload session is
preferred to use over GetFileUploadSessionParts method.
|
NetworkSession |
getNetworkSession() |
PartAccumulator |
reducer(PartAccumulator acc,
InputStream chunk) |
FileFull |
uploadBigFile(InputStream file,
String fileName,
long fileSize,
String parentFolderId)
Starts the process of chunk uploading a big file.
|
UploadedPart |
uploadFilePart(String uploadSessionId,
InputStream requestBody,
UploadFilePartHeaders headers)
Uploads a chunk of a file for an upload session.
|
UploadedPart |
uploadFilePartByUrl(String url,
InputStream requestBody,
UploadFilePartByUrlHeaders headers)
Using this method with urls provided in response when creating a new upload session is
preferred to use over UploadFilePart method.
|
public Authentication auth
public NetworkSession networkSession
public ChunkedUploadsManager()
protected ChunkedUploadsManager(ChunkedUploadsManager.Builder builder)
public UploadSession createFileUploadSession(CreateFileUploadSessionRequestBody requestBody)
requestBody - Request body of createFileUploadSession methodpublic UploadSession createFileUploadSession(CreateFileUploadSessionRequestBody requestBody, CreateFileUploadSessionHeaders headers)
requestBody - Request body of createFileUploadSession methodheaders - Headers of createFileUploadSession methodpublic UploadSession createFileUploadSessionForExistingFile(String fileId, CreateFileUploadSessionForExistingFileRequestBody requestBody)
fileId - 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` the `file_id` is `123`. Example: "12345"
requestBody - Request body of createFileUploadSessionForExistingFile methodpublic UploadSession createFileUploadSessionForExistingFile(String fileId, CreateFileUploadSessionForExistingFileRequestBody requestBody, CreateFileUploadSessionForExistingFileHeaders headers)
fileId - 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` the `file_id` is `123`. Example: "12345"
requestBody - Request body of createFileUploadSessionForExistingFile methodheaders - Headers of createFileUploadSessionForExistingFile methodpublic UploadSession getFileUploadSessionByUrl(String url)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) endpoint.
url - URL of getFileUploadSessionById methodpublic UploadSession getFileUploadSessionByUrl(String url, GetFileUploadSessionByUrlHeaders headers)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) endpoint.
url - URL of getFileUploadSessionById methodheaders - Headers of getFileUploadSessionById methodpublic UploadSession getFileUploadSessionById(String uploadSessionId)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) endpoint.
uploadSessionId - The ID of the upload session. Example: "D5E3F7A"public UploadSession getFileUploadSessionById(String uploadSessionId, GetFileUploadSessionByIdHeaders headers)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) endpoint.
uploadSessionId - The ID of the upload session. Example: "D5E3F7A"headers - Headers of getFileUploadSessionById methodpublic UploadedPart uploadFilePartByUrl(String url, InputStream requestBody, UploadFilePartByUrlHeaders headers)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
url - URL of uploadFilePart methodrequestBody - Request body of uploadFilePart methodheaders - Headers of uploadFilePart methodpublic UploadedPart uploadFilePart(String uploadSessionId, InputStream requestBody, UploadFilePartHeaders headers)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
uploadSessionId - The ID of the upload session. Example: "D5E3F7A"requestBody - Request body of uploadFilePart methodheaders - Headers of uploadFilePart methodpublic void deleteFileUploadSessionByUrl(String url)
This cannot be reversed.
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
url - URL of deleteFileUploadSessionById methodpublic void deleteFileUploadSessionByUrl(String url, DeleteFileUploadSessionByUrlHeaders headers)
This cannot be reversed.
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
url - URL of deleteFileUploadSessionById methodheaders - Headers of deleteFileUploadSessionById methodpublic void deleteFileUploadSessionById(String uploadSessionId)
This cannot be reversed.
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
uploadSessionId - The ID of the upload session. Example: "D5E3F7A"public void deleteFileUploadSessionById(String uploadSessionId, DeleteFileUploadSessionByIdHeaders headers)
This cannot be reversed.
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
uploadSessionId - The ID of the upload session. Example: "D5E3F7A"headers - Headers of deleteFileUploadSessionById methodpublic UploadParts getFileUploadSessionPartsByUrl(String url)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
url - URL of getFileUploadSessionParts methodpublic UploadParts getFileUploadSessionPartsByUrl(String url, GetFileUploadSessionPartsByUrlQueryParams queryParams)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
url - URL of getFileUploadSessionParts methodqueryParams - Query parameters of getFileUploadSessionParts methodpublic UploadParts getFileUploadSessionPartsByUrl(String url, GetFileUploadSessionPartsByUrlHeaders headers)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
url - URL of getFileUploadSessionParts methodheaders - Headers of getFileUploadSessionParts methodpublic UploadParts getFileUploadSessionPartsByUrl(String url, GetFileUploadSessionPartsByUrlQueryParams queryParams, GetFileUploadSessionPartsByUrlHeaders headers)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
url - URL of getFileUploadSessionParts methodqueryParams - Query parameters of getFileUploadSessionParts methodheaders - Headers of getFileUploadSessionParts methodpublic UploadParts getFileUploadSessionParts(String uploadSessionId)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
uploadSessionId - The ID of the upload session. Example: "D5E3F7A"public UploadParts getFileUploadSessionParts(String uploadSessionId, GetFileUploadSessionPartsQueryParams queryParams)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
uploadSessionId - The ID of the upload session. Example: "D5E3F7A"queryParams - Query parameters of getFileUploadSessionParts methodpublic UploadParts getFileUploadSessionParts(String uploadSessionId, GetFileUploadSessionPartsHeaders headers)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
uploadSessionId - The ID of the upload session. Example: "D5E3F7A"headers - Headers of getFileUploadSessionParts methodpublic UploadParts getFileUploadSessionParts(String uploadSessionId, GetFileUploadSessionPartsQueryParams queryParams, GetFileUploadSessionPartsHeaders headers)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
uploadSessionId - The ID of the upload session. Example: "D5E3F7A"queryParams - Query parameters of getFileUploadSessionParts methodheaders - Headers of getFileUploadSessionParts methodpublic Files createFileUploadSessionCommitByUrl(String url, CreateFileUploadSessionCommitByUrlRequestBody requestBody, CreateFileUploadSessionCommitByUrlHeaders headers)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
url - URL of createFileUploadSessionCommit methodrequestBody - Request body of createFileUploadSessionCommit methodheaders - Headers of createFileUploadSessionCommit methodpublic Files createFileUploadSessionCommit(String uploadSessionId, CreateFileUploadSessionCommitRequestBody requestBody, CreateFileUploadSessionCommitHeaders headers)
The actual endpoint URL is returned by the [`Create upload session`](https://developer.box.com/reference/post-files-upload-sessions) and [`Get upload session`](https://developer.box.com/reference/get-files-upload-sessions-id) endpoints.
uploadSessionId - The ID of the upload session. Example: "D5E3F7A"requestBody - Request body of createFileUploadSessionCommit methodheaders - Headers of createFileUploadSessionCommit methodpublic PartAccumulator reducer(PartAccumulator acc, InputStream chunk)
public FileFull uploadBigFile(InputStream file, String fileName, long fileSize, String parentFolderId)
file - The stream of the file to upload.fileName - The name of the file, which will be used for storage in Box.fileSize - The total size of the file for the chunked upload in bytes.parentFolderId - The ID of the folder where the file should be uploaded.public Authentication getAuth()
public NetworkSession getNetworkSession()