Package org.mockserver.blob.s3
Class S3BlobStore
java.lang.Object
org.mockserver.blob.s3.S3BlobStore
- All Implemented Interfaces:
AutoCloseable,BlobStore
BlobStore implementation backed by AWS S3 (or any S3-compatible
store such as MinIO). Blob keys are mapped to S3 object keys with an
optional configurable prefix.
Metadata is stored as S3 user metadata on the object itself (the
x-amz-meta-* headers). This avoids a secondary metadata store
and keeps each blob's metadata atomically consistent with its data.
Thread-safety: S3Client is thread-safe; this class adds no
mutable state beyond the injected client and configuration.
-
Constructor Summary
ConstructorsConstructorDescriptionS3BlobStore(software.amazon.awssdk.services.s3.S3Client s3Client, String bucket, String keyPrefix) Creates an S3 blob store. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the underlyingS3Client, releasing its HTTP connection pool and I/O threads.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
-
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 underlyingS3Client, releasing its HTTP connection pool and I/O threads.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBlobStore
-