public final class ModuleUploads.Async extends Object
| Constructor and Description |
|---|
Async() |
| Modifier and Type | Method and Description |
|---|---|
CMACallback<CMAUpload> |
create(String spaceId,
InputStream stream,
CMACallback<CMAUpload> callback)
Create a new upload, asynchronously.
|
CMACallback<Integer> |
delete(String spaceId,
String uploadId,
CMACallback<Integer> callback)
Delete a given upload again, asynchronously.
|
CMACallback<CMAUpload> |
fetchOne(String spaceId,
String uploadId,
CMACallback<CMAUpload> callback)
Get information about the given upload, asynchronously.
|
public CMACallback<CMAUpload> create(String spaceId, InputStream stream, CMACallback<CMAUpload> callback)
Once an upload is created, you can use it in CMAClient#assets for creating an asset based on a local file.
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 spaceId, String uploadId, CMACallback<CMAUpload> callback)
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(String spaceId, String uploadId, CMACallback<Integer> callback)
spaceId - space id of the upload.uploadId - id of the uploadcallback - the callback to be informed about success or failure.IllegalArgumentException - if spaceId is null.IllegalArgumentException - if uploadId is null.Copyright © 2017 Contentful, GmbH.. All Rights Reserved.