Package org.apache.xmlgraphics.xmp
Class XMPPacketParser
java.lang.Object
org.apache.xmlgraphics.xmp.XMPPacketParser
This class is a parser for XMP packets. By default, it tries to locate the first XMP packet
it finds and parses it.
Important: Before you use this class to look for an XMP packet in some random file, please read the chapter on "Scanning Files for XMP Packets" in the XMP specification!
-
Method Summary
Modifier and TypeMethodDescriptionstatic Metadata
parse
(InputStream in) Locates an XMP packet in a stream, parses it and returns the XMP metadata.
-
Method Details
-
parse
Locates an XMP packet in a stream, parses it and returns the XMP metadata. If no XMP packet is found until the stream ends, null is returned. Note: This method only finds the first XMP packet in a stream. And it cannot determine whether it has found the right XMP packet if there are multiple packets.- Parameters:
in
- the InputStream to search- Returns:
- the parsed XMP metadata or null if no XMP packet is found
- Throws:
IOException
- if an I/O error occursTransformerException
- if an error occurs while parsing the XMP packet
-