public interface Resource
Every implementation of this interface should return correct values for content type and size.
If it is not possible to determinate the content type of the resource, the getContentType() method should return at least the application/octet-stream content type.
| Modifier and Type | Method and Description |
|---|---|
ContentType |
getContentType()
Returns the content type of this resource.
|
HashMap |
getHeaderFields()
Returns additional header fields for this resource.
|
java.lang.Object |
getKey() |
long |
getLastModifiedDate()
Returns the last time where this resource was modified as UNIX timestamp.
|
void |
serialize(URI request,
RequestHeader requestHeader,
java.io.InputStream requestBody,
java.io.OutputStream out,
CredentialInfo credentialInfo,
java.lang.String comManId)
Serializes this resource to the given output stream
out. |
java.lang.String |
shortDescription()
A short string representation of this resource.
|
long |
size()
The size of the resource.
|
ContentType getContentType()
If it is not possible to determinate the content type of the resource, the getContentType() method should return at least the application/octet-stream content type.
void serialize(URI request, RequestHeader requestHeader, java.io.InputStream requestBody, java.io.OutputStream out, CredentialInfo credentialInfo, java.lang.String comManId) throws java.io.IOException
out.request - the request URIrequestHeader - the header of the requestrequestBody - makes the content of the request body availableout - the outputs stream to serialize this resource overcredentialInfo - java.io.IOException - if an IO failure occurs during serializationHashMap getHeaderFields()
The additional header fields allow to add header fields to the response which will be created to send this resource.
NOTICE: The map must contain a String, String
mapping.
long size()
If it is not possible to determinate the size of the resource. The implementation should
return -1. This will allow to send the resource as chunked content.
long getLastModifiedDate()
java.lang.String shortDescription()
java.lang.Object getKey()