Class CMAAssetFile


  • public class CMAAssetFile
    extends java.lang.Object
    Description of a file on the asset system of Contentful.
    • Constructor Detail

      • CMAAssetFile

        public CMAAssetFile()
    • 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, details and uploadFrom, until the asset got processed again.

        Parameters:
        upload - the remote url of the upload.
        Returns:
        the calling instance for chaining.
      • 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, details and upload, until the asset got processed again.

        Parameters:
        uploadFrom - a link to an uploaded resource.
        Returns:
        the calling instance for chaining.
        See Also:
        ModuleUploads
      • 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.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        a human readable string, representing the object.