public class ModuleUploads.Async extends Object
| Constructor and Description |
|---|
Async() |
| Modifier and Type | Method and Description |
|---|---|
CMACallback<CMAUpload> |
create(InputStream stream,
CMACallback<CMAUpload> callback) |
CMACallback<CMAUpload> |
create(InputStream stream,
int chunkSize,
CMACallback<CMAUpload> callback)
Create a new upload, asynchronously.
|
CMACallback<CMAUpload> |
create(String spaceId,
String environmentId,
InputStream stream,
CMACallback<CMAUpload> callback) |
CMACallback<CMAUpload> |
create(String spaceId,
String environmentId,
InputStream stream,
int chunkSize,
CMACallback<CMAUpload> callback)
Create a new upload, asynchronously.
|
CMACallback<Integer> |
delete(CMAUpload upload,
String environmentId,
CMACallback<Integer> callback)
Delete a given upload again, asynchronously.
|
CMACallback<CMAUpload> |
fetchOne(String uploadId,
String environmentId,
CMACallback<CMAUpload> callback)
Get information about the given upload, asynchronously.
|
CMACallback<CMAUpload> |
fetchOne(String spaceId,
String environmentId,
String uploadId,
CMACallback<CMAUpload> callback)
Get information about the given upload, asynchronously.
|
public CMACallback<CMAUpload> create(InputStream stream, int chunkSize, CMACallback<CMAUpload> callback)
Once an upload is created, you can use it in CMAClient#assets for creating an asset based on a local file.
stream - the actual binary representation of the upload. Cannot be null.callback - the callback to be informed about success or failure.IllegalArgumentException - if configured spaceId is null.IllegalArgumentException - if file is null.IllegalStateException - if something in the transmittal went wrong.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMACallback<CMAUpload> create(InputStream stream, CMACallback<CMAUpload> callback)
public CMACallback<CMAUpload> create(String spaceId, String environmentId, InputStream stream, CMACallback<CMAUpload> callback)
public CMACallback<CMAUpload> create(String spaceId, String environmentId, InputStream stream, int chunkSize, CMACallback<CMAUpload> callback)
Once an upload is created, you can use it in CMAClient#assets for creating an asset based on a local file.
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
spaceId - a nonnull id representing the space to add the upload to.stream - the actual binary representation of the upload. Cannot be null.callback - the callback to be informed about success or failure.IllegalArgumentException - if spaceId is null.IllegalArgumentException - if file is null.IllegalStateException - if something in the transmittal went wrong.public CMACallback<CMAUpload> fetchOne(String uploadId, String environmentId, CMACallback<CMAUpload> callback)
uploadId - what id does the upload have?callback - the callback to be informed about success or failure.IllegalArgumentException - if configured spaceId is null.IllegalArgumentException - if uploadId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMACallback<CMAUpload> fetchOne(String spaceId, String environmentId, String uploadId, CMACallback<CMAUpload> callback)
This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String) and will ignore
CMAClient.Builder.setEnvironmentId(String).
spaceId - which space is this upload hosted under?uploadId - what id does the upload have?callback - the callback to be informed about success or failure.IllegalArgumentException - if spaceId is null.IllegalArgumentException - if uploadId is null.public CMACallback<Integer> delete(CMAUpload upload, String environmentId, CMACallback<Integer> callback)
upload - uploadcallback - the callback to be informed about success or failure.IllegalArgumentException - if spaceId is null.IllegalArgumentException - if uploadId is null.Copyright © 2026 Contentful, GmbH.. All rights reserved.