public class GCSEmitter extends AbstractEmitter implements Initializable, StreamEmitter
Constructor and Description |
---|
GCSEmitter() |
Modifier and Type | Method and Description |
---|---|
void |
checkInitialization(InitializableProblemHandler problemHandler) |
void |
emit(String path,
InputStream is,
Metadata userMetadata) |
void |
emit(String emitKey,
List<Metadata> metadataList)
Requires the src-bucket/path/to/my/file.txt in the
TikaCoreProperties.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) |
emit, getName, setName
public void emit(String emitKey, List<Metadata> metadataList) throws IOException, TikaEmitterException
TikaCoreProperties.SOURCE_PATH
.emit
in interface Emitter
metadataList
- IOException
TikaException
TikaEmitterException
public void emit(String path, InputStream is, Metadata userMetadata) throws IOException, TikaEmitterException
emit
in interface StreamEmitter
path
- -- object path, not including the bucketis
- inputStream to copyuserMetadata
- this will be written to the s3 ObjectMetadata's userMetadataTikaEmitterException
- or IOexception if there is a Runtime s3 client exceptionIOException
@Field public void setFileExtension(String fileExtension)
fileExtension
- public void initialize(Map<String,Param> params) throws TikaConfigException
initialize
in interface Initializable
params
- params to use for initializationTikaConfigException
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException
checkInitialization
in interface Initializable
problemHandler
- if there is a problem and no
custom initializableProblemHandler has been configured
via Initializable parameters,
this is called to respond.TikaConfigException
Copyright © 2007–2021 The Apache Software Foundation. All rights reserved.