Search in sources :

Example 1 with BlockListingFilter

use of com.microsoft.azure.storage.blob.BlockListingFilter in project camel by apache.

the class BlobServiceProducer method getBlobBlockList.

private void getBlobBlockList(Exchange exchange) throws Exception {
    CloudBlockBlob client = BlobServiceUtil.createBlockBlobClient(getConfiguration());
    BlobServiceRequestOptions opts = BlobServiceUtil.getRequestOptions(exchange);
    LOG.trace("Getting the blob block list [{}] from exchange [{}]...", getConfiguration().getBlobName(), exchange);
    BlockListingFilter filter = exchange.getIn().getBody(BlockListingFilter.class);
    if (filter == null) {
        filter = BlockListingFilter.COMMITTED;
    }
    List<BlockEntry> blockEntries = client.downloadBlockList(filter, opts.getAccessCond(), opts.getRequestOpts(), opts.getOpContext());
    ExchangeUtil.getMessageForResponse(exchange).setBody(blockEntries);
}
Also used : BlockListingFilter(com.microsoft.azure.storage.blob.BlockListingFilter) BlockEntry(com.microsoft.azure.storage.blob.BlockEntry) CloudBlockBlob(com.microsoft.azure.storage.blob.CloudBlockBlob)

Aggregations

BlockEntry (com.microsoft.azure.storage.blob.BlockEntry)1 BlockListingFilter (com.microsoft.azure.storage.blob.BlockListingFilter)1 CloudBlockBlob (com.microsoft.azure.storage.blob.CloudBlockBlob)1