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 voidcheckInitialization(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)voidsetPrefix(String prefix)voidsetSasToken(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, 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
-
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:
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
-
-