MCPcopy Index your code
hub / github.com/abashev/vfs-s3

github.com/abashev/vfs-s3 @17.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 17.0.0 ↗ · + Follow
790 symbols 2,460 edges 71 files 310 documented · 39%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

Roadmap for 17.0

  • [ ] Migrate to Java 17, Gradle, and Palantir code style
  • [ ] Update all dependencies and set up local testing with LocalStack and MinIO
  • [ ] Split into multi-module project: native filesystem, Spring integration, Commons VFS adapter
  • [ ] Make the project AI-native — bots and tooling for fast contribution acceptance
  • [ ] Shade AWS SDK to avoid version conflicts with consumer projects

Latest branch 4.x.x

vfs-s3 Build with integration tests and code coverage codecov

How to add as dependency into your Maven build

For an artifact with embedded AWS SDK (the easiest way to bootstrap without jar hell)

<dependency>
    <groupId>com.github.abashev</groupId>
    <artifactId>vfs-s3-with-awssdk-v1</artifactId>
    <version>4.4.0</version>
</dependency>

For an artifact without dependencies

<dependency>
    <groupId>com.github.abashev</groupId>
    <artifactId>vfs-s3</artifactId>
    <version>4.4.0</version>
</dependency>

How to add as dependency into your Gradle build

implementation 'com.github.abashev:vfs-s3:4.4.0'

URL format

s3://[[access-key:secret-key]:sign-region]@endpoint-url/folder-or-bucket/
  • Access key and Secret key could come from default AWS SDK chain (environment, container etc)
  • Sign-region is useful for custom implementations
  • If endpoint URL from known providers then we will try to get bucket name from host, if not able to do it then bucket is first path segment

Supported providers

Provider URL Example URL
Amazon S3 https://aws.amazon.com/s3/ s3://s3-tests.s3-eu-west-1.amazonaws.com
Yandex Object Storage https://cloud.yandex.ru/services/storage s3://s3-tests.storage.yandexcloud.net/
Mail.ru Cloud Storage https://mcs.mail.ru/storage/ s3://s3-tests.hb.bizmrg.com/
Alibaba Cloud Object Storage Service https://www.alibabacloud.com/product/oss s3://s3-tests.oss-eu-central-1.aliyuncs.com/
Oracle Cloud Object Storage https://www.oracle.com/cloud/storage/object-storage.html s3://frifqsbag2em.compat.objectstorage.eu-frankfurt-1.oraclecloud.com/s3-tests/
DigitalOcean Spaces Object Storage https://www.digitalocean.com/products/spaces/ s3://s3-tests2.ams3.digitaloceanspaces.com
SberCloud Object Storage Service https://sbercloud.ru/ru/products/object-storage-service s3://s3-tests.obs.ru-moscow-1.hc.sbercloud.ru

Sample groovy scripts - https://github.com/abashev/vfs-s3/tree/branch-4.x.x/samples

s3-copy able to copy between clouds, via http url or between different accounts

s3-copy s3://access1:secret1@s3-tests.storage.yandexcloud.net/javadoc.jar s3://access2:secret2@s3.eu-central-1.amazonaws.com/s3-tests-2/javadoc.jar

s3-copy https://oss.sonatype.org/some-name/120133-1-javadoc.jar s3://s3.eu-central-1.amazonaws.com/s3-tests-2/javadoc.jar

Sample Java Code for AWS S3

// 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);

Sample Java Code for Yandex Cloud https://cloud.yandex.ru/

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

Local Development

This project uses mise to manage Java and Maven versions locally.

mise trust
mise exec -- mvn compile
mise exec -- mvn test

On CI (GitHub Actions), Java and Maven are installed via actions/setup-java, so mvn is used directly without mise.

Running tests

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

  1. Shell environment properties

    export AWS_ACCESS_KEY=AAAAAAA
    export AWS_SECRET_KEY=SSSSSSS
    export BASE_URL=s3://<full url like simple-bucket.s3-eu-west-1.amazonaws.com or s3-eu-west-1.amazonaws.com/test-bucket>
    
  2. Or any standard ways how to do it in AWS SDK (iam role and so on)

Make sure that you never commit your credentials!

TODO

  • [x] Shadow all dependencies inside vfs-s3 artifact

Old releases

Branch Build Status Code coverage
branch-3.0.x Build Status codecov
branch-2.4.x Build Status codecov
branch-2.3.x Build Status
branch-2.2.x Build Status

Extension points exported contracts — how you extend this code

IMD5HashGetter (Interface)
Get md5 hash for file. @author Alexey Abashev [5 implementers]
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/operations/IMD5HashGetter.java
ServerSideEncryption (Interface)
File operation to work with server-side encryption. Some cloud providers don't support it. @author <A href="mailto:alex [4 …
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/operations/ServerSideEncryption.java
PlatformFeatures (Interface)
Different S3 implementations have slightly different behaviour, and we need to control it on code side @author <A href= [2 …
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/operations/PlatformFeatures.java
IPublicUrlsGetter (Interface)
File operation for gettin' direct urls to S3 objects. @author Alexey Abashev [2 implementers]
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/operations/IPublicUrlsGetter.java
IAclGetter (Interface)
Interface for getting file Access Control List. @author Marat Komarov [2 implementers]
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/operations/IAclGetter.java

Core symbols most depended-on inside this repo

resolveFile
called by 93
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/AbstractFileSystem.java
getName
called by 60
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/S3FileObject.java
getPath
called by 38
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/AbstractFileName.java
equals
called by 29
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/FileSystemKey.java
createFile
called by 22
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/S3FileSystem.java
getType
called by 22
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/AbstractFileName.java
getInstance
called by 21
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/S3FileSystemConfigBuilder.java
getContent
called by 20
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/AbstractFileObject.java

Shape

Method 711
Class 71
Interface 6
Enum 2

Languages

Java100%

Modules by API surface

modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/AbstractFileObject.java98 symbols
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/DefaultFileContent.java42 symbols
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/AbstractFileSystem.java41 symbols
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/S3FileObject.java38 symbols
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/AbstractFileName.java30 symbols
modules/jdk/src/main/java/com/github/vfss3/jdk/S3Path.java27 symbols
modules/commons-vfs/src/integrationTest/java/com/github/vfss3/commonsvfs/tests/S3ProviderTest.java27 symbols
modules/jdk/src/main/java/com/github/vfss3/jdk/S3FileSystemProvider.java25 symbols
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/S3FileSystemConfigBuilder.java25 symbols
modules/commons-vfs/src/main/java/com/github/vfss3/commonsvfs/S3FileSystemOptions.java23 symbols
modules/spring-6/src/main/java/com/github/vfss3/spring6/S3Resource.java20 symbols
modules/jdk/src/main/java/com/github/vfss3/jdk/S3FileSystem.java20 symbols

For agents

$ claude mcp add vfs-s3 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact