Package gov.usgs.earthquake.product
Interface Content
- All Known Implementing Classes:
AbstractContent
,ByteContent
,FileContent
,InputStreamContent
,URLContent
public interface Content
Content describes a group of bytes with associated mime type information. *
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Free any resources associated with this content.The type of content.The content bytes as a stream.When the content was modified.How much content there is.Digest of content.
-
Method Details
-
getContentType
String getContentType()The type of content.- Returns:
- the mime content type for this content.
-
getInputStream
The content bytes as a stream.- Returns:
- an InputStream from which content can be read.
- Throws:
IOException
- if an error occurs while creating the stream.
-
getLastModified
Date getLastModified()When the content was modified.- Returns:
- Date when the content was modified.
-
getLength
Long getLength()How much content there is.- Returns:
- the actual content length, or -1 if unknown.
-
getSha256
Digest of content.- Returns:
- base64 encoded sha256 of content bytes.
- Throws:
Exception
- if error occurs
-
close
void close()Free any resources associated with this content.
-