Class GCSEmitter

java.lang.Object
org.apache.tika.pipes.emitter.AbstractEmitter
org.apache.tika.pipes.emitter.gcs.GCSEmitter
All Implemented Interfaces:
org.apache.tika.config.Initializable, org.apache.tika.pipes.emitter.Emitter, org.apache.tika.pipes.emitter.StreamEmitter

public class GCSEmitter extends org.apache.tika.pipes.emitter.AbstractEmitter implements org.apache.tika.config.Initializable, org.apache.tika.pipes.emitter.StreamEmitter
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    checkInitialization(org.apache.tika.config.InitializableProblemHandler problemHandler)
     
    void
    emit(String path, InputStream is, org.apache.tika.metadata.Metadata userMetadata, org.apache.tika.parser.ParseContext parseContext)
     
    void
    emit(String emitKey, List<org.apache.tika.metadata.Metadata> metadataList, org.apache.tika.parser.ParseContext parseContext)
    Requires the src-bucket/path/to/my/file.txt in the TikaCoreProperties.SOURCE_PATH.
    void
    initialize(Map<String,org.apache.tika.config.Param> params)
    This initializes the gcs client.
    void
    setBucket(String bucket)
     
    void
    setFileExtension(String fileExtension)
    If you want to customize the output file's file extension.
    void
    setPrefix(String prefix)
     
    void
    setProjectId(String projectId)
     

    Methods inherited from class org.apache.tika.pipes.emitter.AbstractEmitter

    emit, getName, setName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.tika.pipes.emitter.Emitter

    emit, getName
  • Constructor Details

    • GCSEmitter

      public GCSEmitter()
  • Method Details

    • emit

      public void emit(String emitKey, List<org.apache.tika.metadata.Metadata> metadataList, org.apache.tika.parser.ParseContext parseContext) 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, org.apache.tika.parser.ParseContext parseContext) throws IOException, org.apache.tika.pipes.emitter.TikaEmitterException
      Specified by:
      emit in interface org.apache.tika.pipes.emitter.StreamEmitter
      Parameters:
      path - -- object path, not including the bucket
      is - inputStream to copy
      userMetadata - this will be written to the s3 ObjectMetadata's userMetadata
      Throws:
      org.apache.tika.pipes.emitter.TikaEmitterException - or IOexception if there is a Runtime s3 client exception
      IOException
    • setProjectId

      @Field public void setProjectId(String projectId)
    • setBucket

      @Field public void setBucket(String bucket)
    • 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 gcs 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