Is there any official java.nio.file
implementation for AWS
?
I found one for GoogleCloudStorage
here, and need similar for AWS
and Azure
.
For anyone interested, the Upplication/Amazon-S3-FileSystem-NIO2 was abandoned a very long time ago. Pull requests and fixes are no longer accepted. Many developers forked it and made their fixes for their own purposes and then those forks died as well.
We decided to make a new new spin-off project -- not as a fork, but as a new project called s3fs-nio that is based on Upplication/Amazon-S3-FileSystem-NIO2's master
. You can find out more about the history and reasoning here. We have tried to collect some of the more important fixes from forks and have added them to our project (with the authors' permissions).
Our spin-off uses AWS SDK for Java version 2.x and is under an Apache 2.0 license.
The documentation for configuring things can be found here.
Code examples are located here.
We've now cut a release for org.carlspring.cloud.aws:s3fs-nio:1.0.0
and this is available via Maven Central (https://repo.maven.apache.org/maven2/). Here are our Release Notes.
We are also working on improving our documentation and contributions would be highly appreciated.
We would like to welcome you to test and report back any findings!
For those of you interested in contributing, there is plenty yet to be done and we'd be more than happy to have you aboard!
Here's a basic configuration:
<dependency>
<groupId>org.carlspring.cloud.aws</groupId>
<artifactId>s3fs-nio</artifactId>
<version>1.0.0</version>
</dependency>
implementation 'org.carlspring.cloud.aws:s3fs-nio:1.0.0'
amazon.properties
file
In your src/main/resources/amazon.properties
, add the following settings:s3fs.access.key=access-key
s3fs.secret.key=secret-key
Use the following code to create the FileSystem and set it to a specific end-point:
FileSystems.newFileSystem(URI.create("s3:///"),
new HashMap<>(),
Thread.currentThread()
.getContextClassLoader());