Skip to content
Amazon S3 driver for Apache commons-vfs (Virtual File System) project
Java HTML Shell
Find file
Pull request Compare This branch is 4 commits ahead, 46 commits behind branch-2.3.x.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

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

Branch Description Build Status
branch-2.2.x See below Build Status
branch-2.1.x Current Switch to Amazon SDK for better integration and stability Build Status
branch-2.0.x Out-dated It uses Jets3t as back-end for interracting with Amazon S3 Build Status

Scope of branch-2.2.x development

  1. Total refactoring for package names - move everything into com.github
  2. Integration with Java 7 as file system provider
  3. Make code more concurrency aware

Using with Maven

Add this section to your repository configuration

        <name>vfs-s3 project repository</name>

Bootstraping with Spring

The class com.scoyo.commons.vfs.S3Util can be used to easily bootstrap the vfs-s3 provider with the Spring Framework:

<bean id="S3Initializer" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean" lazy-init="false">
    <property name="targetClass" value="com.scoyo.commons.vfs.S3Util" />
    <property name="targetMethod" value="initS3Provider" />
    <property name="arguments">

After that you can use VFS as with any other file system.

Sample Java Code

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

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

Running the tests

For running tests you need active credentials for AWS. You can specify them as

  1. Shell environment properties


    And run maven build with profile travis-ci mvn test -Ptravis-ci

  2. Or you can update your settings.xml file with default or profile's properties


Make sure that you never commit your credentials!

This code is based on which is no longer supported.

Something went wrong with that request. Please try again.