<dependency>
<groupId>com.github.abashev</groupId>
<artifactId>vfs-s3</artifactId>
<version>3.0.0.RC2</version>
</dependency>
Please be aware that vfs-s3 is using custom build of commons-vfs2. It works in the same way as original commons-vfs2 but it was patched to fix some concurrency issues.
implementation 'com.github.abashev:commons-vfs2:2.2-20181130'
implementation 'com.github.abashev:vfs-s3:3.0.0.RC2'
// Create a folder
FileSystemManager fsManager = VFS.getManager();
FileObject dir = fsManager.resolveFile("s3://simple-bucket.s3-eu-west-1.amazonaws.com/test-folder/");
dir.createFolder();
// Upload file to S3
FileObject dest = fsManager.resolveFile("s3://s3-eu-west-1.amazonaws.com/test-bucket/backup.zip");
FileObject src = fsManager.resolveFile(new File("/path/to/local/file.zip").getAbsolutePath());
dest.copyFrom(src, Selectors.SELECT_SELF);
For running tests you need active credentials for AWS. You can specify them as
-
Shell environment properties
export AWS_ACCESS_KEY=AAAAAAA export AWS_SECRET_KEY=SSSSSSS export AWS_TEST_BUCKET=<full url like simple-bucket.s3-eu-west-1.amazonaws.com or s3-eu-west-1.amazonaws.com/test-bucket>
-
Or any standard ways how to do it in AWS SDK (iam role and so on)
Make sure that you never commit your credentials!
- Fix tests for 2.x branch
- Fix tests for 3.x branch
- Submit Release Candidate or SNAPSHOT builds for 3.x branch
- Submit artifacts to Maven central
- Merge changes into
commons-vfs
project - Add ability to work with vanilla
commons-vfs
Branch | Build Status | Code coverage |
---|---|---|
branch-2.4.x | ||
branch-2.3.x | ||
branch-2.2.x |