Asto stands for Abstract Storage, an abstraction over physical data storage system.
The main entity of the library is an interface com.artipie.asto.Storage
, a contract
which requires to implement the following functionalities:
- put/get operations
- transaction support
- list files in a directory
- check if a file/directory exists
Supported abstractions:
- File system
- S3
This is the dependency you need:
<dependency>
<groupId>com.artipie</groupId>
<artifactId>asto</artifactId>
<version>[...]</version>
</dependency>
Read the Javadoc for more technical details.
Create a hello.txt
file with "Hello World!"
content on file-system-based
storage in blocking way:
final BlockingStorage storage = new BlockingStorage(
new FileStorage(
Files.createTempDirectory("temp-blocking")
)
).save(new Key.From("hello.txt"), "Hello World!".getBytes());
The same with RxJava2 way:
new RxStorageWrapper(
new FileStorage(
Files.createTempDirectory("temp-rx")
)
).save(
new Key.From("hello.txt"),
ByteBuffer.wrap("Hello World!".getBytes())
);
Fork repository, make changes, send us a pull request. We will review
your changes and apply them to the master
branch shortly, provided
they don't violate our quality standards. To avoid frustration, before
sending us your pull request please run full Maven build:
$ mvn clean install -Pqulice
To avoid build errors use Maven 3.2+.