public final class ModuleUploads
extends java.lang.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,
java.util.concurrent.Executor callbackExecutor) |
| Modifier and Type | Method and Description |
|---|---|
ModuleUploads.Async |
async() |
CMAUpload |
create(java.lang.String spaceId,
java.io.InputStream stream)
Create a new upload.
|
protected com.contentful.java.cma.ServiceUploads |
createService(retrofit2.Retrofit retrofit) |
int |
delete(java.lang.String spaceId,
java.lang.String uploadId)
Delete a given upload again.
|
CMAUpload |
fetchOne(java.lang.String spaceId,
java.lang.String uploadId)
Get information about the given upload.
|
public ModuleUploads(retrofit2.Retrofit retrofit,
java.util.concurrent.Executor callbackExecutor)
protected com.contentful.java.cma.ServiceUploads createService(retrofit2.Retrofit retrofit)
public CMAUpload create(java.lang.String spaceId, java.io.InputStream stream) throws java.io.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.java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if stream is null.java.io.IOException - if the stream could not be read.public CMAUpload fetchOne(java.lang.String spaceId, java.lang.String uploadId)
spaceId - which space is this upload hosted under?uploadId - what id does the upload have?java.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if uploadId is null.public int delete(java.lang.String spaceId,
java.lang.String uploadId)
spaceId - space id of the upload.uploadId - id of the uploadjava.lang.IllegalArgumentException - if spaceId is null.java.lang.IllegalArgumentException - if uploadId is null.public ModuleUploads.Async async()
Copyright © 2018 Contentful, GmbH.. All Rights Reserved.