Class AZBlobEmitter
java.lang.Object
org.apache.tika.pipes.emitter.AbstractEmitter
org.apache.tika.pipes.emitter.azblob.AZBlobEmitter
- All Implemented Interfaces:
Initializable
,Emitter
,StreamEmitter
Emit files to Azure blob storage. Must set endpoint, sasToken and container via config.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 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
void
setSasToken
(String sasToken) Methods inherited from class org.apache.tika.pipes.emitter.AbstractEmitter
emit, getName, setName
-
Constructor Details
-
AZBlobEmitter
public AZBlobEmitter()
-
-
Method Details
-
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:
emitKey
-metadataList
-parseContext
-- Throws:
IOException
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; 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.metadataparseContext
-- Throws:
IOException
- if there is a Runtime client exceptionTikaEmitterException
- if there is a Runtime client exception
-
setSasToken
-
setEndpoint
-
setContainer
-
setOverwriteExisting
-
setPrefix
-
setFileExtension
If you want to customize the output file's file extension. Do not include the "."- Parameters:
fileExtension
-
-
initialize
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
-