Class AZBlobEmitter
- java.lang.Object
-
- org.apache.tika.pipes.emitter.AbstractEmitter
-
- org.apache.tika.pipes.emitter.azblob.AZBlobEmitter
-
- All Implemented Interfaces:
Initializable
,Emitter
,StreamEmitter
public class AZBlobEmitter extends AbstractEmitter implements Initializable, StreamEmitter
Emit files to Azure blob storage. Must set endpoint, sasToken and container via config.
-
-
Constructor Summary
Constructors Constructor Description AZBlobEmitter()
-
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)
void
emit(String emitKey, List<Metadata> metadataList)
Requires the src-bucket/path/to/my/file.txt in theTikaCoreProperties.SOURCE_PATH
.void
initialize(Map<String,Param> params)
This initializes the az blob container clientvoid
setContainer(String container)
void
setEndpoint(String endpoint)
void
setFileExtension(String fileExtension)
If you want to customize the output file's file extension.void
setOverwriteExisting(boolean overwriteExisting)
void
setPrefix(String prefix)
void
setSasToken(String sasToken)
-
Methods inherited from class org.apache.tika.pipes.emitter.AbstractEmitter
emit, getName, setName
-
-
-
-
Method Detail
-
emit
public void emit(String emitKey, List<Metadata> metadataList) 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) throws IOException, TikaEmitterException
- Specified by:
emit
in interfaceStreamEmitter
- Parameters:
path
- object path; prefix will be prependedis
- 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:
TikaEmitterException
- or IOexception if there is a Runtime client exceptionIOException
-
setOverwriteExisting
@Field public void setOverwriteExisting(boolean overwriteExisting)
-
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 az blob container 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
-
-