Class CDAAsset

    • Constructor Detail

      • CDAAsset

        public CDAAsset()
    • Method Detail

      • metadata

        public CDAMetadata metadata()
        Returns:
        the metadata set.
      • title

        public java.lang.String title()
        Returns:
        title of this asset.
      • url

        public java.lang.String url()
        Returns:
        url to the file of this asset.
      • urlForImageWith

        public java.lang.String urlForImageWith​(ImageOption... options)
        Returns a url with the given image manipulation.

        If the asset is not pointing to an image (as identified by its mimetype) the url() is returned. Same happens if the options are empty or non existing, then the url gets returned.

        In an error case (for instance, using the same option twice), the last option with the same operation will be used.

        Parameters:
        options - to manipulate the image the returned url will be pointing to.
        Returns:
        an url reflecting all the options given.
        Throws:
        java.lang.IllegalArgumentException - if no options are given.
        java.lang.IllegalArgumentException - if no mimetype was set on asset.
        java.lang.IllegalArgumentException - if mimetype was not an image.
        See Also:
        ImageOption, url()
      • mimeType

        public java.lang.String mimeType()
        Returns:
        mime-type of this asset.
      • fileField

        public <T> T fileField​(java.lang.String key)
        Helper method to extract a field from the file map.
        Type Parameters:
        T - the type of this field.
        Parameters:
        key - the key who's value to be returned.
        Returns:
        field of this file.
      • toString

        public java.lang.String toString()
        Return a string, showing the id and title.
        Overrides:
        toString in class CDAResource
        Returns:
        a human readable string