Package com.contentful.java.cma
Class ModuleUploads.Async
- java.lang.Object
-
- com.contentful.java.cma.ModuleUploads.Async
-
- Enclosing class:
- ModuleUploads
public class ModuleUploads.Async extends java.lang.ObjectAsync module.
-
-
Constructor Summary
Constructors Constructor Description Async()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CMACallback<CMAUpload>create(java.io.InputStream stream, int chunkSize, CMACallback<CMAUpload> callback)Create a new upload, asynchronously.CMACallback<CMAUpload>create(java.io.InputStream stream, CMACallback<CMAUpload> callback)CMACallback<CMAUpload>create(java.lang.String spaceId, java.lang.String environmentId, java.io.InputStream stream, int chunkSize, CMACallback<CMAUpload> callback)Create a new upload, asynchronously.CMACallback<CMAUpload>create(java.lang.String spaceId, java.lang.String environmentId, java.io.InputStream stream, CMACallback<CMAUpload> callback)CMACallback<java.lang.Integer>delete(CMAUpload upload, java.lang.String environmentId, CMACallback<java.lang.Integer> callback)Delete a given upload again, asynchronously.CMACallback<CMAUpload>fetchOne(java.lang.String uploadId, java.lang.String environmentId, CMACallback<CMAUpload> callback)Get information about the given upload, asynchronously.CMACallback<CMAUpload>fetchOne(java.lang.String spaceId, java.lang.String environmentId, java.lang.String uploadId, CMACallback<CMAUpload> callback)Get information about the given upload, asynchronously.
-
-
-
Method Detail
-
create
public CMACallback<CMAUpload> create(java.io.InputStream stream, int chunkSize, CMACallback<CMAUpload> callback)
Create a new upload, asynchronously.Once an upload is created, you can use it in CMAClient#assets for creating an asset based on a local file.
- Parameters:
stream- the actual binary representation of the upload. Cannot be null.callback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
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 usingCMAClient.Builder.setEnvironmentId(String).- See Also:
CMAClient.Builder.setSpaceId(String)
-
create
public CMACallback<CMAUpload> create(java.io.InputStream stream, CMACallback<CMAUpload> callback)
-
create
public CMACallback<CMAUpload> create(java.lang.String spaceId, java.lang.String environmentId, java.io.InputStream stream, CMACallback<CMAUpload> callback)
-
create
public CMACallback<CMAUpload> create(java.lang.String spaceId, java.lang.String environmentId, java.io.InputStream stream, int chunkSize, CMACallback<CMAUpload> callback)
Create a new upload, asynchronously.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 ignoreCMAClient.Builder.setEnvironmentId(String).- Parameters:
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.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if spaceId is null.java.lang.IllegalArgumentException- if file is null.java.lang.IllegalStateException- if something in the transmittal went wrong.
-
fetchOne
public CMACallback<CMAUpload> fetchOne(java.lang.String uploadId, java.lang.String environmentId, CMACallback<CMAUpload> callback)
Get information about the given upload, asynchronously.- Parameters:
uploadId- what id does the upload have?callback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if configured spaceId is null.java.lang.IllegalArgumentException- if uploadId is null.CMANotWithEnvironmentsException- if environmentId was set usingCMAClient.Builder.setEnvironmentId(String).- See Also:
CMAClient.Builder.setSpaceId(String)
-
fetchOne
public CMACallback<CMAUpload> fetchOne(java.lang.String spaceId, java.lang.String environmentId, java.lang.String uploadId, CMACallback<CMAUpload> callback)
Get information about the given upload, asynchronously.This method will override the configuration specified through
CMAClient.Builder.setSpaceId(String)and will ignoreCMAClient.Builder.setEnvironmentId(String).- Parameters:
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.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if spaceId is null.java.lang.IllegalArgumentException- if uploadId is null.
-
delete
public CMACallback<java.lang.Integer> delete(CMAUpload upload, java.lang.String environmentId, CMACallback<java.lang.Integer> callback)
Delete a given upload again, asynchronously.- Parameters:
upload- uploadcallback- the callback to be informed about success or failure.- Returns:
- the callback passed in.
- Throws:
java.lang.IllegalArgumentException- if spaceId is null.java.lang.IllegalArgumentException- if uploadId is null.
-
-