public class CMAAssetFile extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
CMAAssetFile.Details
Read only structure, detailing the content of the asset uploaded.
|
| Constructor and Description |
|---|
CMAAssetFile() |
| Modifier and Type | Method and Description |
|---|---|
String |
getContentType()
Get the content type stored here.
|
CMAAssetFile.Details |
getDetails() |
String |
getFileName() |
CMALink |
getUploadFrom() |
String |
getUploadUrl() |
String |
getUrl()
Return the public accessible url of this asset.
|
CMAAssetFile |
setContentType(String contentType)
Set what content type is stored in this asset.
|
CMAAssetFile |
setFileName(String fileName)
Set a filename to be used for identifying the file.
|
CMAAssetFile |
setUploadFrom(CMALink uploadFrom)
Set a link to a Contentful Upload entry, to be used for processing the binary data from.
|
CMAAssetFile |
setUploadUrl(String upload)
Set a public accessible url to be used for processing the binary data from.
|
String |
toString() |
public String getUrl()
This url only exists, if the asset is uploaded and processed
ModuleAssets.process(CMAAsset, String).
public String getUploadUrl()
public CMAAssetFile setUploadUrl(String upload)
Warning: Setting an upload url will also erase the url, details and
uploadFrom, until the asset got processed again.
upload - the remote url of the upload.public CMALink getUploadFrom()
ModuleUploadspublic CMAAssetFile setUploadFrom(CMALink uploadFrom)
Warning: Setting an upload from will also erase the url, details and
upload, until the asset got processed again.
uploadFrom - a link to an uploaded resource.ModuleUploadspublic CMAAssetFile.Details getDetails()
public String getFileName()
public CMAAssetFile setFileName(String fileName)
fileName - the name of the file.public String getContentType()
Constants.DEFAULT_CONTENT_TYPE,
Constants.OCTET_STREAM_CONTENT_TYPEpublic CMAAssetFile setContentType(String contentType)
contentType - the content type used for this file.Constants.DEFAULT_CONTENT_TYPE,
Constants.OCTET_STREAM_CONTENT_TYPECopyright © 2026 Contentful, GmbH.. All rights reserved.