Package gov.usgs.earthquake.product
Interface Content
-
- All Known Implementing Classes:
AbstractContent,ByteContent,FileContent,InputStreamContent,URLContent
public interface ContentContent describes a group of bytes with associated mime type information. *
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()Free any resources associated with this content.java.lang.StringgetContentType()The type of content.java.io.InputStreamgetInputStream()The content bytes as a stream.java.util.DategetLastModified()When the content was modified.java.lang.LonggetLength()How much content there is.java.lang.StringgetSha256()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.IOExceptionThe 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.ExceptionDigest 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.
-
-