Package com.idrsolutions.image.tika
Class MetadataParser
java.lang.Object
com.idrsolutions.image.tika.MetadataParser
- All Implemented Interfaces:
Serializable
,org.apache.tika.parser.Parser
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSet
<org.apache.tika.mime.MediaType> getSupportedTypes
(org.apache.tika.parser.ParseContext parseContext) Get the supported types of this parser.void
parse
(InputStream inputStream, ContentHandler contentHandler, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext parseContext) Attempt to parse metadata from the given image file.
-
Constructor Details
-
MetadataParser
public MetadataParser()
-
-
Method Details
-
getSupportedTypes
public Set<org.apache.tika.mime.MediaType> getSupportedTypes(org.apache.tika.parser.ParseContext parseContext) Get the supported types of this parser. This parser only supports certain image types- Specified by:
getSupportedTypes
in interfaceorg.apache.tika.parser.Parser
- Parameters:
parseContext
- Parse context. Unused.- Returns:
- A set containing the supported image types.
-
parse
public void parse(InputStream inputStream, ContentHandler contentHandler, org.apache.tika.metadata.Metadata metadata, org.apache.tika.parser.ParseContext parseContext) throws IOException, SAXException, org.apache.tika.exception.TikaException Attempt to parse metadata from the given image file.- Specified by:
parse
in interfaceorg.apache.tika.parser.Parser
- Parameters:
inputStream
- Input stream. Please use an instance of TikaInputStream to pass the file path.contentHandler
- Content handler.metadata
- Metadata. Unused.parseContext
- Parse context. Unused.- Throws:
IOException
- Thrown if the image file cannot be opened.SAXException
- Thrown if there is a problem generating the XHTML document.org.apache.tika.exception.TikaException
- Thrown if there is a problem parsing the image file.
-