Package org.mockserver.blob.azure
Class AzureBlobStore
java.lang.Object
org.mockserver.blob.azure.AzureBlobStore
- All Implemented Interfaces:
AutoCloseable,BlobStore
BlobStore implementation backed by Azure Blob Storage.
Blob keys are mapped to Azure blob names with an optional
configurable prefix.
Metadata is stored as Azure blob metadata (custom key-value pairs on the blob itself).
Thread-safety: BlobServiceClient is thread-safe; this class
adds no mutable state beyond the injected client and configuration.
-
Constructor Summary
ConstructorsConstructorDescriptionAzureBlobStore(com.azure.storage.blob.BlobContainerClient containerClient, String keyPrefix) Creates an Azure blob store. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the Azure blob store.booleanDeletes a blob by key.Retrieves a blob by key.Lists all blob keys that start with the given prefix.voidStores a blob, overwriting any existing blob with the same key.
-
Constructor Details
-
AzureBlobStore
Creates an Azure blob store.- Parameters:
containerClient- the Azure container client (caller owns lifecycle)keyPrefix- optional key prefix; empty string for no prefix
-
-
Method Details
-
put
Description copied from interface:BlobStoreStores a blob, overwriting any existing blob with the same key. -
get
Description copied from interface:BlobStoreRetrieves a blob by key. -
list
Description copied from interface:BlobStoreLists all blob keys that start with the given prefix. -
delete
Description copied from interface:BlobStoreDeletes a blob by key. -
close
public void close()Closes the Azure blob store. The AzureBlobServiceClientandBlobContainerClientdo not implementAutoCloseable-- the underlying Netty/Reactor HTTP client is managed by the SDK and does not expose an explicit close. This is a documented no-op.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBlobStore
-