Class MetadataParser

java.lang.Object
com.idrsolutions.image.tika.MetadataParser
All Implemented Interfaces:
Serializable, org.apache.tika.parser.Parser

public class MetadataParser extends Object implements org.apache.tika.parser.Parser
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 interface org.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 interface org.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.