public final class ModuleUploads.Async
extends java.lang.Object
| Constructor and Description |
|---|
Async() |
| Modifier and Type | Method and Description |
|---|---|
CMACallback<CMAUpload> |
create(java.io.InputStream stream,
CMACallback<CMAUpload> callback)
Create a new upload, asynchronously.
|
CMACallback<CMAUpload> |
create(java.lang.String spaceId,
java.io.InputStream stream,
CMACallback<CMAUpload> callback)
Create a new upload, asynchronously.
|
CMACallback<java.lang.Integer> |
delete(CMAUpload upload,
CMACallback<java.lang.Integer> callback)
Delete a given upload again, asynchronously.
|
CMACallback<CMAUpload> |
fetchOne(java.lang.String uploadId,
CMACallback<CMAUpload> callback)
Get information about the given upload, asynchronously.
|
CMACallback<CMAUpload> |
fetchOne(java.lang.String spaceId,
java.lang.String uploadId,
CMACallback<CMAUpload> callback)
Get information about the given upload, asynchronously.
|
public CMACallback<CMAUpload> create(java.io.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.
stream - the actual binary representation of the upload. Cannot be null.callback - the callback to be informed about success or failure.java.lang.IllegalArgumentException - if configured spaceId is null.java.lang.IllegalArgumentException - if file is null.java.lang.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(java.lang.String spaceId, java.io.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.
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.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if file is null.java.lang.IllegalStateException - if something in the transmittal went wrong.public CMACallback<CMAUpload> fetchOne(java.lang.String uploadId, CMACallback<CMAUpload> callback)
uploadId - what id does the upload have?callback - the callback to be informed about success or failure.java.lang.IllegalArgumentException - if configured spaceId is null.java.lang.IllegalArgumentException - if uploadId is null.CMANotWithEnvironmentsException - if environmentId was set using
CMAClient.Builder.setEnvironmentId(String).CMAClient.Builder.setSpaceId(String)public CMACallback<CMAUpload> fetchOne(java.lang.String spaceId, java.lang.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.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if uploadId is null.public CMACallback<java.lang.Integer> delete(CMAUpload upload, CMACallback<java.lang.Integer> callback)
upload - uploadcallback - the callback to be informed about success or failure.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if uploadId is null.Copyright © 2019 Contentful, GmbH.. All Rights Reserved.