public interface ContentItem
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.
Modifier and Type | Field and Description |
---|---|
static String |
CONTENT_SCHEME |
static String |
DEFAULT_FILE_NAME |
static String |
DEFAULT_MIME_TYPE |
static String |
QUALIFIER |
Modifier and Type | Method and Description |
---|---|
String |
getFilename()
Return the filename of the
ContentItem . |
String |
getId()
Return the globally unique ID for the content item.
|
InputStream |
getInputStream()
Return the input stream containing the item's actual data content.
|
Metacard |
getMetacard()
Return the metacard associated with this product.
|
MimeType |
getMimeType()
Return the mime type for the content item, e.g., image/nitf or application/pdf.
|
String |
getMimeTypeRawData()
Return the mime type raw data for the content item, e.g., image/nitf or
application/json;id=geojson.
|
String |
getQualifier()
Return the optional field to describe the
ContentItem as an additional product for a
Metacard . |
long |
getSize()
Return the total number of bytes in the item's input stream.
|
String |
getUri()
Return the URI of the content item.
|
static final String CONTENT_SCHEME
static final String DEFAULT_MIME_TYPE
static final String DEFAULT_FILE_NAME
static final String QUALIFIER
String getId()
String getUri()
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.
String getQualifier()
ContentItem
as an additional product for a
Metacard
. ContentItem
s added to a Metacard
as an additional product
must have a non-blank qualifier.ContentItem
. A null qualifier designates this as the main
ContentItem
of the associated Metacard
.String getFilename()
ContentItem
. If not set it will default to DEFAULT_FILE_NAME
.ContentItem
MimeType getMimeType()
String getMimeTypeRawData()
InputStream getInputStream() throws IOException
IOException
- if the input stream is not availablelong getSize() throws IOException
IOException
- if the total number of bytes is unknown or not applicable (e.g., in the
case of a live stream)Metacard getMetacard()
This work is licensed under a Creative Commons Attribution 4.0 International License.