Interface ContentItem


public interface ContentItem
ContentItem is the POJO representing the information about the content to be stored in the StorageProvider.

A ContentItem encapsulates the content's globally unique ID, mime type, and input stream (i.e., the actual content).

This code is experimental. While this interface is functional and tested, it may change or be removed in a future version of the library.

  • Field Details

  • Method Details

    • getId

      String getId()
      Return the globally unique ID for the content item.
      Returns:
      the content item's ID
    • getUri

      String getUri()
      Return the URI of the content item.

      This is used by the StorageProvider when the content item is stored in the content repository and will be of the form content:<GUID>#<qualifier>.

      Or this is used by the endpoint when the client specifies the content item's location which means the content is stored remote/external to DDF.

      Returns:
      the URI of the content item
    • getQualifier

      String getQualifier()
      Return the optional field to describe the ContentItem as an additional product for a Metacard. ContentItems added to a Metacard as an additional product must have a non-blank qualifier.
      Returns:
      the qualifier of the ContentItem. A null qualifier designates this as the main ContentItem of the associated Metacard.
    • getFilename

      String getFilename()
      Return the filename of the ContentItem. If not set it will default to DEFAULT_FILE_NAME.
      Returns:
      the filename of the ContentItem
    • getMimeType

      javax.activation.MimeType getMimeType()
      Return the mime type for the content item, e.g., image/nitf or application/pdf.
      Returns:
      the mime type for the content item
    • getMimeTypeRawData

      String getMimeTypeRawData()
      Return the mime type raw data for the content item, e.g., image/nitf or application/json;id=geojson.
      Returns:
      the mime type raw data for the content item
    • getInputStream

      InputStream getInputStream() throws IOException
      Return the input stream containing the item's actual data content.
      Returns:
      the item's input stream
      Throws:
      IOException - if the input stream is not available
    • getSize

      long getSize() throws IOException
      Return the total number of bytes in the item's input stream.
      Returns:
      returns the total number of bytes that can be read from the input stream
      Throws:
      IOException - if the total number of bytes is unknown or not applicable (e.g., in the case of a live stream)
    • getMetacard

      Metacard getMetacard()
      Return the metacard associated with this product.
      Returns:
      Metacard