Class TikaPoweredMetadataExtracter

    • Constructor Detail

      • TikaPoweredMetadataExtracter

        public TikaPoweredMetadataExtracter​(String extractorContext,
                                            ArrayList<String> supportedMimeTypes)
        Deprecated.
      • TikaPoweredMetadataExtracter

        public TikaPoweredMetadataExtracter​(ArrayList<String> supportedMimeTypes)
        Deprecated.
      • TikaPoweredMetadataExtracter

        public TikaPoweredMetadataExtracter​(ArrayList<String> supportedMimeTypes,
                                            ArrayList<String> supportedEmbedMimeTypes)
        Deprecated.
      • TikaPoweredMetadataExtracter

        public TikaPoweredMetadataExtracter​(HashSet<String> supportedMimeTypes)
        Deprecated.
      • TikaPoweredMetadataExtracter

        public TikaPoweredMetadataExtracter​(HashSet<String> supportedMimeTypes,
                                            HashSet<String> supportedEmbedMimeTypes)
        Deprecated.
      • TikaPoweredMetadataExtracter

        public TikaPoweredMetadataExtracter​(String extractorContext,
                                            HashSet<String> supportedMimeTypes,
                                            HashSet<String> supportedEmbedMimeTypes)
        Deprecated.
    • Method Detail

      • getMetadataSeparator

        public String getMetadataSeparator()
        Deprecated.
      • setMetadataSeparator

        public void setMetadataSeparator​(String metadataSeparator)
        Deprecated.
      • buildSupportedMimetypes

        protected static ArrayList<String> buildSupportedMimetypes​(String[] explicitTypes,
                                                                   org.apache.tika.parser.Parser... tikaParsers)
        Deprecated.
        Builds up a list of supported mime types by merging an explicit list with any that Tika also claims to support
      • getExtractorContext

        protected String getExtractorContext()
        Deprecated.
        Gets context for the current implementation
        Returns:
        String value which determines current context
      • getParser

        protected abstract org.apache.tika.parser.Parser getParser()
        Deprecated.
        Returns the correct Tika Parser to process the document. If you don't know which you want, use TikaAutoMetadataExtracter which makes use of the Tika auto-detection.
      • getEmbedder

        protected org.apache.tika.embedder.Embedder getEmbedder()
        Deprecated.
        Returns the Tika Embedder to modify the document.
        Returns:
        the Tika embedder
      • needHeaderContents

        protected boolean needHeaderContents()
        Deprecated.
        Do we care about the contents of the extracted header, or nothing at all?
      • getInputStream

        protected InputStream getInputStream​(ContentReader reader)
                                      throws IOException
        Deprecated.
        There seems to be some sort of issue with some downstream 3rd party libraries, and input streams that come from a ContentReader. This happens most often with JPEG and Tiff files. For these cases, buffer out to a local file if not already there
        Throws:
        IOException
      • setDocumentSelector

        public void setDocumentSelector​(org.apache.tika.extractor.DocumentSelector documentSelector)
        Deprecated.
        Sets the document selector, used for determining whether to parse embedded resources.
        Parameters:
        documentSelector -
      • getDocumentSelector

        protected org.apache.tika.extractor.DocumentSelector getDocumentSelector​(org.apache.tika.metadata.Metadata metadata,
                                                                                 String targetMimeType)
        Deprecated.
        Gets the document selector, used for determining whether to parse embedded resources, null by default so parse all.
        Parameters:
        metadata -
        targetMimeType -
        Returns:
        the document selector
      • buildParseContext

        protected org.apache.tika.parser.ParseContext buildParseContext​(org.apache.tika.metadata.Metadata metadata,
                                                                        String sourceMimeType)
        Deprecated.
        By default returns a new ParseContent
        Parameters:
        metadata -
        sourceMimeType -
        Returns:
        the parse context
      • extractRaw

        protected Map<String,​Serializable> extractRaw​(ContentReader reader)
                                                     throws Throwable
        Deprecated.
        Description copied from class: AbstractMappingMetadataExtracter
        Override to provide the raw extracted metadata values. An extracter should extract as many of the available properties as is realistically possible. Even if the default mapping doesn't handle all properties, it is possible for each instance of the extracter to be configured differently and more or less of the properties may be used in different installations.

        Raw values must not be trimmed or removed for any reason. Null values and empty strings are

        • Null: Removed
        • Empty String: Passed to the OverwritePolicy
        • Non Serializable: Converted to String or fails if that is not possible

        Properties extracted and their meanings and types should be thoroughly described in the class-level javadocs of the extracter implementation, for example:

         editor: - the document editor        -->  cm:author
         title:  - the document title         -->  cm:title
         user1:  - the document summary
         user2:  - the document description   -->  cm:description
         user3:  -
         user4:  -
         
        Specified by:
        extractRaw in class AbstractMappingMetadataExtracter
        Parameters:
        reader - the document to extract the values from. This stream provided by the reader must be closed if accessed directly.
        Returns:
        Returns a map of document property values keyed by property name.
        Throws:
        Throwable - All exception conditions can be handled.
        See Also:
        AbstractMappingMetadataExtracter.getDefaultMapping()
      • embedInternal

        protected void embedInternal​(Map<String,​Serializable> properties,
                                     ContentReader reader,
                                     ContentWriter writer)
                              throws Throwable
        Deprecated.
        Description copied from class: AbstractMappingMetadataExtracter
        Override to embed metadata values. An extracter should embed as many of the available properties as is realistically possible. Even if the default mapping doesn't handle all properties, it is possible for each instance of the extracter to be configured differently and more or less of the properties may be used in different installations.
        Overrides:
        embedInternal in class AbstractMappingMetadataExtracter
        Parameters:
        properties - the metadata keys and values to embed in the content file
        reader - the reader for the original document. This stream provided by the reader must be closed if accessed directly.
        writer - the writer for the document to embed the values in. This stream provided by the writer must be closed if accessed directly.
        Throws:
        Throwable - All exception conditions can be handled.
        See Also:
        AbstractMappingMetadataExtracter.getDefaultEmbedMapping()
      • extractSize

        protected String extractSize​(String sizeText)
        Deprecated.
        Exif metadata for size also returns the string "pixels" after the number value , this function will stop at the first non digit character found in the text
        Parameters:
        sizeText - string text
        Returns:
        the size value