Package com.day.cq.dam.api
Interface FormatHandler
-
- All Known Implementing Classes:
DefaultFormatHandler
public interface FormatHandlerA format handler knows how to handle a container-like file format and can be looked up in OSGI via an ID.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanaccepts(byte[] data, int off, int len)Return a flag indicating whether the handler is able to handle the data.InputStreamgetMetadata(InputStream in)Return metadata as in input stream (utility method).BufferedImagegetThumbnailImage(InputStream in)Return a thumbnail image from an input stream (utility method).voidprocess(InputStream in, Context context)Process the input stream given.
-
-
-
Method Detail
-
accepts
boolean accepts(byte[] data, int off, int len)Return a flag indicating whether the handler is able to handle the data.- Parameters:
data- data bufferoff- offsetlen- number of valid bytes- Returns:
trueif the handler is able to handle the data;falseotherwise
-
process
void process(InputStream in, Context context) throws IOException
Process the input stream given.- Parameters:
in- input streamcontext- call context- Throws:
IOException- if an I/O error occurs
-
getThumbnailImage
BufferedImage getThumbnailImage(InputStream in) throws IOException, ProcessorException
Return a thumbnail image from an input stream (utility method).- Parameters:
in- input stream- Returns:
- buffered image or
null - Throws:
IOException- if an I/O error occursProcessorException- if a processor reports an error
-
getMetadata
InputStream getMetadata(InputStream in) throws IOException, ProcessorException
Return metadata as in input stream (utility method).- Parameters:
in- input stream- Returns:
- metadata input stream or
null - Throws:
IOException- if an I/O error occursProcessorException- if a processor reports an error
-
-