public interface ResourceHandler
Modifier and Type | Field and Description |
---|---|
static int |
MAX_PRIORITY
Maximum priority.
|
static int |
MIN_PRIORITY
Minimum priority.
|
Modifier and Type | Method and Description |
---|---|
void |
generateResource(Source source,
OutputStream out,
Parameters parameters)
Generate the resource configured during setup, and output it
|
Serializable |
getKey(Source source,
Parameters parameters)
Get the unique key for this resource, for cache purpose.
|
long |
getLastModified(Source source,
Parameters parameters)
Get the resource last modified time
|
String |
getMimeType(Source source,
Parameters parameters)
Return the mime type of the configured resource.
|
int |
getPriority()
Get the priority of this handler
|
long |
getSize(Source source,
Parameters parameters)
Get the resource size, if available.
|
SourceValidity |
getValidity(Source source,
Parameters parameters)
Get the resource validity, for cache purpose.
|
boolean |
isSupported(String src)
Determines if the resource is supported by this handler
|
Source |
setup(String source,
Parameters par)
Initialize the resource handler with a resource.
|
static final int MIN_PRIORITY
static final int MAX_PRIORITY
Source setup(String source, Parameters par) throws IOException, ProcessingException
source
- The source uripar
- The parametersIOException
- If an error occursProcessingException
- If an error occursvoid generateResource(Source source, OutputStream out, Parameters parameters) throws IOException, ProcessingException
source
- The sourceout
- The output stream to write toparameters
- The parametersIOException
- If an error occursProcessingException
- If an error occursboolean isSupported(String src)
src
- The uri of resourcetrue
if the resource is supportedint getPriority()
String getMimeType(Source source, Parameters parameters)
source
- The sourceparameters
- The parametersSerializable getKey(Source source, Parameters parameters)
source
- The sourceparameters
- The parametersSourceValidity getValidity(Source source, Parameters parameters)
source
- The sourceparameters
- The parameterslong getSize(Source source, Parameters parameters)
source
- The sourceparameters
- The parameterslong getLastModified(Source source, Parameters parameters)
source
- The sourceparameters
- The parameters