public interface Storage
You are supposed to implement this interface the way you want. It has
to abstract the binary storage. You may use FileStorage
if you
want to work with files. Otherwise, for S3 or something else, you have
to implement it yourself.
Modifier and Type | Interface and Description |
---|---|
static class |
Storage.Wrap
Forwarding decorator for
Storage . |
Modifier and Type | Method and Description |
---|---|
CompletableFuture<Void> |
delete(Key key)
Removes value from storage.
|
<T> CompletionStage<T> |
exclusively(Key key,
Function<Storage,CompletionStage<T>> operation)
Runs operation exclusively for specified key.
|
CompletableFuture<Boolean> |
exists(Key key)
This file exists?
|
CompletableFuture<Collection<Key>> |
list(Key prefix)
Return the list of keys that start with this prefix, for
example "foo/bar/".
|
CompletableFuture<Void> |
move(Key source,
Key destination)
Moves value from one location to another.
|
CompletableFuture<Void> |
save(Key key,
Content content)
Saves the bytes to the specified key.
|
CompletableFuture<Long> |
size(Key key)
Get value size.
|
CompletableFuture<Content> |
value(Key key)
Obtain bytes by key.
|
CompletableFuture<Boolean> exists(Key key)
key
- The key (file name)CompletableFuture<Collection<Key>> list(Key prefix)
prefix
- The prefix.CompletableFuture<Void> save(Key key, Content content)
key
- The keycontent
- Bytes to saveCompletableFuture<Void> move(Key source, Key destination)
source
- Source key.destination
- Destination key.CompletableFuture<Long> size(Key key)
key
- The key of value.CompletableFuture<Content> value(Key key)
key
- The keyCompletableFuture<Void> delete(Key key)
key
- Key for value to be deleted.<T> CompletionStage<T> exclusively(Key key, Function<Storage,CompletionStage<T>> operation)
T
- Operation result type.key
- Key which is scope of operation.operation
- Operation to be performed exclusively.Copyright © 2019–2021 jcabi.com. All rights reserved.