Developer
Search…
🗄
SDK

StoreWise SDK for Java

The StoreWise SDK for Java which is based on the AWS S3 Java SDK, enables Java developers to easily integrate with decentralized data storage and build solutions that are S3 compatible.

Getting Started

Sign up for StoreWise

This SDK requires a StoreWise account. To sign-up, visit https://console.staging.storewise.tech/ and move Sign in page.
The following start method requires the registered username and password.

Minimum requirements

Java SE 8. This library also uses SLF4J to output logs.

Install the SDK

API reference

Package tech.storewise.sdk provides Gateway class that has two static methods: start and close.

start

1
@NotNull
2
public static com.amazonaws.services.s3.AmazonS3 start(
3
@NotNull java.nio.file.Path metadataDir,
4
@NotNull java.lang.String user,
5
@NotNull java.lang.String password)
6
throws java.io.IOException, java.lang.InterruptedException
Copied!
This method starts a new gateway process if necessary and returns AmazonS3 client that communicates with the gateway.
Parameters:
  • metadataDir - path to the directory where gateway store metadata.
  • user - StoreWise username.
  • password - password for the StoreWise user.
Returns:
an AmazonS3 client that connects to gateway.
Exceptions:
  • java.io.IOException - if the given metadata directory is not a directory, or starting gateway fails.
  • java.lang.InterruptedException - if it's interrupted while waiting until the gateway gets ready.

close

1
public static void close()
2
throws java.lang.InterruptedException, java.io.IOException
Copied!
This method closes the gateway. It's safe to call this method if no gateway is running.
Exceptions:
  • java.io.IOException - if it fails to close gateway.
  • java.lang.InterruptedException - if it's interrupted while waiting until the gateway finishes.

Sample application

app contains a sample application that lists your buckets.
Last modified 1yr ago