public final class ModuleUploads extends Object
This module will take care of all `upload.contentful.com` related issues, as in directly uploading a file to contentful, receiving it's id.
| Modifier and Type | Class and Description |
|---|---|
class |
ModuleUploads.Async
Async module.
|
| Constructor and Description |
|---|
ModuleUploads(retrofit2.Retrofit retrofit,
Executor callbackExecutor) |
| Modifier and Type | Method and Description |
|---|---|
ModuleUploads.Async |
async() |
CMAUpload |
create(String spaceId,
InputStream stream)
Create a new upload.
|
protected com.contentful.java.cma.ServiceUploads |
createService(retrofit2.Retrofit retrofit) |
int |
delete(String spaceId,
String uploadId)
Delete a given upload again.
|
CMAUpload |
fetchOne(String spaceId,
String uploadId)
Get information about the given upload.
|
public ModuleUploads(retrofit2.Retrofit retrofit,
Executor callbackExecutor)
protected com.contentful.java.cma.ServiceUploads createService(retrofit2.Retrofit retrofit)
public CMAUpload create(String spaceId, InputStream stream) throws IOException
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.IllegalArgumentException - if spaceId is null.IllegalArgumentException - if stream is null.IOException - if the stream could not be read.public CMAUpload fetchOne(String spaceId, String uploadId)
spaceId - which space is this upload hosted under?uploadId - what id does the upload have?IllegalArgumentException - if spaceId is null.IllegalArgumentException - if uploadId is null.public int delete(String spaceId, String uploadId)
spaceId - space id of the upload.uploadId - id of the uploadIllegalArgumentException - if spaceId is null.IllegalArgumentException - if uploadId is null.public ModuleUploads.Async async()
Copyright © 2017 Contentful, GmbH.. All Rights Reserved.