Skip to content

MINA Example

This article illustrates how to use our library with Apache MINA.

Please, get acquainted with the Basic Example first.

The possible configuration settings can be found here.

Required Dependencies

<dependency>
    <groupId>org.carlspring.cloud.aws</groupId>
    <artifactId>s3fs-nio</artifactId>
    <version>1.0.6</version>
</dependency>
compile group: 'org.carlspring.cloud.aws', name: 's3fs-nio', version: '1.0.6'
libraryDependencies += "org.carlspring.cloud.aws" % "s3fs-nio" % "1.0.6"

MINA Code Example

You can use our library with MINA like this:

public FileSystemFactory createFileSystemFactory(final String bucketName)
        throws IOException
{
    final FileSystem fileSystem = FileSystems.newFileSystem(URI.create("s3:///"),
                                                            env,
                                                            Thread.currentThread()
                                                                  .getContextClassLoader());

    final Path bucketPath = fileSystem.getPath(bucketName);

    return new VirtualFileSystemFactory(bucketPath);
}