Class AZBlobEmitter

  • All Implemented Interfaces:
    org.apache.tika.config.Initializable, org.apache.tika.pipes.emitter.Emitter, org.apache.tika.pipes.emitter.StreamEmitter

    public class AZBlobEmitter
    extends org.apache.tika.pipes.emitter.AbstractEmitter
    implements org.apache.tika.config.Initializable, org.apache.tika.pipes.emitter.StreamEmitter
    Emit files to Azure blob storage. Must set endpoint, sasToken and container via config.
    • Constructor Detail

      • AZBlobEmitter

        public AZBlobEmitter()
    • Method Detail

      • emit

        public void emit​(String emitKey,
                         List<org.apache.tika.metadata.Metadata> metadataList)
                  throws IOException,
                         org.apache.tika.pipes.emitter.TikaEmitterException
        Requires the src-bucket/path/to/my/file.txt in the TikaCoreProperties.SOURCE_PATH.
        Specified by:
        emit in interface org.apache.tika.pipes.emitter.Emitter
        Parameters:
        metadataList -
        Throws:
        IOException
        org.apache.tika.exception.TikaException
        org.apache.tika.pipes.emitter.TikaEmitterException
      • emit

        public void emit​(String path,
                         InputStream is,
                         org.apache.tika.metadata.Metadata userMetadata)
                  throws IOException,
                         org.apache.tika.pipes.emitter.TikaEmitterException
        Specified by:
        emit in interface org.apache.tika.pipes.emitter.StreamEmitter
        Parameters:
        path - object path; prefix will be prepended
        is - inputStream to copy, if a TikaInputStream contains an underlying file, the client will upload the file; if a content-length is included in the metadata, the client will upload the stream with the content-length; otherwise, the client will copy the stream to a byte array and then upload.
        userMetadata - this will be written to the az blob's properties.metadata
        Throws:
        org.apache.tika.pipes.emitter.TikaEmitterException - or IOexception if there is a Runtime client exception
        IOException
      • setSasToken

        @Field
        public void setSasToken​(String sasToken)
      • setEndpoint

        @Field
        public void setEndpoint​(String endpoint)
      • setContainer

        @Field
        public void setContainer​(String container)
      • setOverwriteExisting

        @Field
        public void setOverwriteExisting​(boolean overwriteExisting)
      • setPrefix

        @Field
        public void setPrefix​(String prefix)
      • setFileExtension

        @Field
        public void setFileExtension​(String fileExtension)
        If you want to customize the output file's file extension. Do not include the "."
        Parameters:
        fileExtension -
      • initialize

        public void initialize​(Map<String,​org.apache.tika.config.Param> params)
                        throws org.apache.tika.exception.TikaConfigException
        This initializes the az blob container client
        Specified by:
        initialize in interface org.apache.tika.config.Initializable
        Parameters:
        params - params to use for initialization
        Throws:
        org.apache.tika.exception.TikaConfigException
      • checkInitialization

        public void checkInitialization​(org.apache.tika.config.InitializableProblemHandler problemHandler)
                                 throws org.apache.tika.exception.TikaConfigException
        Specified by:
        checkInitialization in interface org.apache.tika.config.Initializable
        Throws:
        org.apache.tika.exception.TikaConfigException