Class GCSEmitter
- java.lang.Object
-
- org.apache.tika.pipes.emitter.AbstractEmitter
-
- org.apache.tika.pipes.emitter.gcs.GCSEmitter
-
- All Implemented Interfaces:
Initializable
,Emitter
,StreamEmitter
public class GCSEmitter extends AbstractEmitter implements Initializable, StreamEmitter
-
-
Constructor Summary
Constructors Constructor Description GCSEmitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkInitialization(InitializableProblemHandler problemHandler)
void
emit(String path, InputStream is, Metadata userMetadata, ParseContext parseContext)
void
emit(String emitKey, List<Metadata> metadataList, ParseContext parseContext)
Requires the src-bucket/path/to/my/file.txt in theTikaCoreProperties.SOURCE_PATH
.void
initialize(Map<String,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
-
-
-
-
Method Detail
-
emit
public void emit(String emitKey, List<Metadata> metadataList, ParseContext parseContext) throws IOException, TikaEmitterException
Requires the src-bucket/path/to/my/file.txt in theTikaCoreProperties.SOURCE_PATH
.- Specified by:
emit
in interfaceEmitter
- Parameters:
metadataList
-- Throws:
IOException
TikaException
TikaEmitterException
-
emit
public void emit(String path, InputStream is, Metadata userMetadata, ParseContext parseContext) throws IOException, TikaEmitterException
- Specified by:
emit
in interfaceStreamEmitter
- Parameters:
path
- -- object path, not including the bucketis
- inputStream to copyuserMetadata
- this will be written to the s3 ObjectMetadata's userMetadata- Throws:
TikaEmitterException
- or IOexception if there is a Runtime s3 client exceptionIOException
-
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,Param> params) throws TikaConfigException
This initializes the gcs client.- Specified by:
initialize
in interfaceInitializable
- Parameters:
params
- params to use for initialization- Throws:
TikaConfigException
-
checkInitialization
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException
- Specified by:
checkInitialization
in interfaceInitializable
- Parameters:
problemHandler
- if there is a problem and no custom initializableProblemHandler has been configured via Initializable parameters, this is called to respond.- Throws:
TikaConfigException
-
-