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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckInitialization(InitializableProblemHandler problemHandler) voidemit(String path, InputStream is, Metadata userMetadata, ParseContext parseContext) voidemit(String emitKey, List<Metadata> metadataList, ParseContext parseContext) Requires the src-bucket/path/to/my/file.txt in theTikaCoreProperties.SOURCE_PATH.voidinitialize(Map<String, Param> params) This initializes the az blob container clientvoidsetContainer(String container) voidsetEndpoint(String endpoint) voidsetFileExtension(String fileExtension) If you want to customize the output file's file extension.voidsetOverwriteExisting(boolean overwriteExisting) voidvoidsetSasToken(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:
emitin interfaceEmitter- Parameters:
emitKey-metadataList-parseContext-- Throws:
IOExceptionTikaEmitterException
-
emit
public void emit(String path, InputStream is, Metadata userMetadata, ParseContext parseContext) throws IOException, TikaEmitterException - Specified by:
emitin 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:
initializein interfaceInitializable- Parameters:
params- params to use for initialization- Throws:
TikaConfigException
-
checkInitialization
public void checkInitialization(InitializableProblemHandler problemHandler) throws TikaConfigException - Specified by:
checkInitializationin 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
-