Package ddf.catalog.content.data
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturn the filename of theContentItem.getId()Return the globally unique ID for the content item.Return the input stream containing the item's actual data content.Return the metacard associated with this product.javax.activation.MimeTypeReturn the mime type for the content item, e.g., image/nitf or application/pdf.Return the mime type raw data for the content item, e.g., image/nitf or application/json;id=geojson.Return the optional field to describe theContentItemas an additional product for aMetacard.longgetSize()Return the total number of bytes in the item's input stream.getUri()Return the URI of the content item.
-
Field Details
-
CONTENT_SCHEME
- See Also:
-
DEFAULT_MIME_TYPE
- See Also:
-
DEFAULT_FILE_NAME
- See Also:
-
QUALIFIER_KEYWORD
- See Also:
-
-
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
StorageProviderwhen the content item is stored in the content repository and will be of the formcontent:<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 theContentItemas an additional product for aMetacard.ContentItems added to aMetacardas an additional product must have a non-blank qualifier.- Returns:
- the qualifier of the
ContentItem. A null qualifier designates this as the mainContentItemof the associatedMetacard.
-
getFilename
String getFilename()Return the filename of theContentItem. If not set it will default toDEFAULT_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
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
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
-