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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Free any resources associated with this content.java.lang.String
getContentType()
The type of content.java.io.InputStream
getInputStream()
The content bytes as a stream.java.util.Date
getLastModified()
When the content was modified.java.lang.Long
getLength()
How much content there is.java.lang.String
getSha256()
Digest of content.
-
-
-
Method Detail
-
getContentType
java.lang.String getContentType()
The type of content.- Returns:
- the mime content type for this content.
-
getInputStream
java.io.InputStream getInputStream() throws java.io.IOException
The content bytes as a stream.- Returns:
- an InputStream from which content can be read.
- Throws:
java.io.IOException
- if an error occurs while creating the stream.
-
getLastModified
java.util.Date getLastModified()
When the content was modified.- Returns:
- Date when the content was modified.
-
getLength
java.lang.Long getLength()
How much content there is.- Returns:
- the actual content length, or -1 if unknown.
-
getSha256
java.lang.String getSha256() throws java.lang.Exception
Digest of content.- Returns:
- base64 encoded sha256 of content bytes.
- Throws:
java.lang.Exception
- if error occurs
-
close
void close()
Free any resources associated with this content.
-
-