Package com.day.cq.dam.commons.handler
Class XMPProcessor
java.lang.Object
com.day.cq.dam.commons.handler.XMPProcessor
- All Implemented Interfaces:
Processor,FilterStateListener
Process bytes, extract metadata found in <xpacket> tags and add them to
a
Context.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidended(Filter filter, OutputStream out) Invoked when the filter detects the end of a section.final voidprocess(byte[] buf, int off, int len) Process a couple of bytes.static InputStreamprocess(InputStream in) Utility method that processes an input stream and returns the first valid XMP input stream.Invoked when the filter detects the start of a section it understands.
-
Constructor Details
-
XMPProcessor
Create a new instance of this class.- Parameters:
context- context
-
-
Method Details
-
process
Process a couple of bytes.- Specified by:
processin interfaceProcessor- Parameters:
buf- bufferoff- offset inside bufferlen- number of bytes- Throws:
IOException- thrown in event of failure to process the bytes
-
started
Invoked when the filter detects the start of a section it understands.- Specified by:
startedin interfaceFilterStateListener- Parameters:
filter- filter- Returns:
- output stream, if the listener wants to have the consecutive
bytes automatically written to some location or
null
-
ended
Invoked when the filter detects the end of a section.- Specified by:
endedin interfaceFilterStateListener- Parameters:
filter- filterout- output stream returned fromFilterStateListener.started(Filter)ornull
-
process
Utility method that processes an input stream and returns the first valid XMP input stream.- Parameters:
in- input stream- Throws:
IOException- if an I/O error occursProcessorException- if a processor error occurs
-