Package com.contentful.java.cma.model
Class CMAAssetFile
- java.lang.Object
-
- com.contentful.java.cma.model.CMAAssetFile
-
public class CMAAssetFile extends java.lang.ObjectDescription of a file on the asset system of Contentful.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCMAAssetFile.DetailsRead only structure, detailing the content of the asset uploaded.
-
Constructor Summary
Constructors Constructor Description CMAAssetFile()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetContentType()Get the content type stored here.CMAAssetFile.DetailsgetDetails()java.lang.StringgetFileName()CMALinkgetUploadFrom()java.lang.StringgetUploadUrl()java.lang.StringgetUrl()Return the public accessible url of this asset.CMAAssetFilesetContentType(java.lang.String contentType)Set what content type is stored in this asset.CMAAssetFilesetFileName(java.lang.String fileName)Set a filename to be used for identifying the file.CMAAssetFilesetUploadFrom(CMALink uploadFrom)Set a link to a Contentful Upload entry, to be used for processing the binary data from.CMAAssetFilesetUploadUrl(java.lang.String upload)Set a public accessible url to be used for processing the binary data from.java.lang.StringtoString()
-
-
-
Method Detail
-
getUrl
public java.lang.String getUrl()
Return the public accessible url of this asset.This url only exists, if the asset is uploaded and processed
ModuleAssets.process(CMAAsset, String).- Returns:
- the string representing a url without the protocol.
-
getUploadUrl
public java.lang.String getUploadUrl()
- Returns:
- a url the asset will get downloaded from Contentful from.
-
setUploadUrl
public CMAAssetFile setUploadUrl(java.lang.String upload)
Set a public accessible url to be used for processing the binary data from.Warning: Setting an upload url will also erase the
url,detailsanduploadFrom, until the asset got processed again.- Parameters:
upload- the remote url of the upload.- Returns:
- the calling instance for chaining.
-
getUploadFrom
public CMALink getUploadFrom()
- Returns:
- a link to the upload from
ModuleUploads
-
setUploadFrom
public CMAAssetFile setUploadFrom(CMALink uploadFrom)
Set a link to a Contentful Upload entry, to be used for processing the binary data from.Warning: Setting an upload from will also erase the
url,detailsandupload, until the asset got processed again.- Parameters:
uploadFrom- a link to an uploaded resource.- Returns:
- the calling instance for chaining.
- See Also:
ModuleUploads
-
getDetails
public CMAAssetFile.Details getDetails()
- Returns:
- the details of the file uploaded.
-
getFileName
public java.lang.String getFileName()
- Returns:
- the name of the file used.
-
setFileName
public CMAAssetFile setFileName(java.lang.String fileName)
Set a filename to be used for identifying the file.- Parameters:
fileName- the name of the file.- Returns:
- this instance, for ease of chaining.
-
getContentType
public java.lang.String getContentType()
Get the content type stored here.- Returns:
- a content type description.
- See Also:
Constants.DEFAULT_CONTENT_TYPE,Constants.OCTET_STREAM_CONTENT_TYPE
-
setContentType
public CMAAssetFile setContentType(java.lang.String contentType)
Set what content type is stored in this asset.- Parameters:
contentType- the content type used for this file.- Returns:
- the calling instance for easy chaining.
- See Also:
Constants.DEFAULT_CONTENT_TYPE,Constants.OCTET_STREAM_CONTENT_TYPE
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- Returns:
- a human readable string, representing the object.
-
-