Class TikaPoweredContentTransformer

    • Field Detail

      • sourceMimeTypes

        protected List<String> sourceMimeTypes
      • documentSelector

        protected org.apache.tika.extractor.DocumentSelector documentSelector
    • Constructor Detail

      • TikaPoweredContentTransformer

        protected TikaPoweredContentTransformer​(List<String> sourceMimeTypes)
      • TikaPoweredContentTransformer

        protected TikaPoweredContentTransformer​(String[] sourceMimeTypes)
    • Method Detail

      • getParser

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

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

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

        protected org.apache.tika.parser.ParseContext buildParseContext​(org.apache.tika.metadata.Metadata metadata,
                                                                        String targetMimeType,
                                                                        TransformationOptions options)
        By default returns a ParseContent that does not recurse
      • transformInternal

        public void transformInternal​(org.alfresco.service.cmr.repository.ContentReader reader,
                                      org.alfresco.service.cmr.repository.ContentWriter writer,
                                      TransformationOptions options)
                               throws Exception
        Description copied from class: AbstractContentTransformer2
        Method to be implemented by subclasses wishing to make use of the common infrastructural code provided by this class.
        Specified by:
        transformInternal in class AbstractContentTransformer2
        Parameters:
        reader - the source of the content to transform
        writer - the target to which to write the transformed content
        options - a map of options to use when performing the transformation. The map will never be null.
        Throws:
        Exception - exceptions will be handled by this class - subclasses can throw anything