I
- Cloud vendor-specific upload request class or builder.O
- Cloud vendor-specific upload response.D
- Cloud vendor-specific delete response.public interface ObjectStorageOperations<I,O,D>
Modifier and Type | Method and Description |
---|---|
default void |
copy(java.lang.String sourceKey,
java.lang.String destinationKey)
Copies an object stored at
sourceKey to destinationKey , within the
same object storage (bucket/container). |
D |
delete(java.lang.String key)
Deletes an object from the object storage.
|
default boolean |
exists(java.lang.String key)
Checks whether an entry with the given key exists in the object storage.
|
default java.util.Set<java.lang.String> |
listObjects()
Lists the objects that exist in the object storage.
|
<E extends ObjectStorageEntry<?>> |
retrieve(java.lang.String key)
Gets the object from object storage.
|
UploadResponse<O> |
upload(UploadRequest request)
Uploads an object to the object storage.
|
UploadResponse<O> |
upload(UploadRequest request,
java.util.function.Consumer<I> requestConsumer)
Uploads an object to the object storage.
|
@NonNull UploadResponse<O> upload(@NonNull UploadRequest request)
request
- the upload requestObjectStorageException
- if there was a failure storing the object@NonNull UploadResponse<O> upload(@NonNull UploadRequest request, @NonNull java.util.function.Consumer<I> requestConsumer)
request
- the upload requestrequestConsumer
- Upload request builder consumerObjectStorageException
- if there was a failure storing the object@NonNull <E extends ObjectStorageEntry<?>> java.util.Optional<E> retrieve(@NonNull java.lang.String key)
E
- an instance of ObjectStorageEntry
.key
- the object path in the format /foo/bar/file
ObjectStorageException
- if there was a failure retrieving the object@NonNull D delete(@NonNull java.lang.String key)
key
- object path in the format /foo/bar/file
ObjectStorageException
- if there was a failure deleting the objectdefault boolean exists(@NonNull java.lang.String key)
key
- object path in the format /foo/bar/file
@NonNull default java.util.Set<java.lang.String> listObjects()
default void copy(@NonNull java.lang.String sourceKey, @NonNull java.lang.String destinationKey)
sourceKey
to destinationKey
, within the
same object storage (bucket/container). If the destination exists, it will be overwritten.sourceKey
- the key of the source objectdestinationKey
- the key of the destination object