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.
|
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<Transaction> |
transaction(List<Key> keys)
Start a transaction with specified keys.
|
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.CompletableFuture<Transaction> transaction(List<Key> keys)
save(Key, Content) or value(Key) only in
the scope of a transaction.keys - The keys regarding which transaction is atomicCopyright © 2019–2020 jcabi.com. All rights reserved.