Skip to content

Amazon S3 driver for Apache commons-vfs2 (Virtual File System) project

License

Notifications You must be signed in to change notification settings

themartynroberts/vfs2-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amazon S3 driver for VFS (Apache Commons Virtual File System)

Sample Java Code

// Create bucket
FileSystemManager fsManager = VFS.getManager();
FileObject dir = fsManager.resolveFile("s3://simple-bucket/test-folder/");
dir.createFolder();

// Upload file to S3
FileObject dest = fsManager.resolveFile("s3://test-bucket/backup.zip");
FileObject src = fsManager.resolveFile(new File("/path/to/local/file.zip").getAbsolutePath());
dest.copyFrom(src, Selectors.SELECT_SELF);

Running the tests

For running tests you need active credentials for AWS. You can specify them as VM parameters e.g. -Daws.accessKey=ABCD -Daws.secretKey=ABCD -Ds3.testBucket=abcd-tests

Make sure that you never commit your credentials!

This code is based on https://github.com/abashev/vfs-s3

About

Amazon S3 driver for Apache commons-vfs2 (Virtual File System) project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages