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>2.0.0-SNAPSHOT</version>
</dependency>
compile group: 'org.carlspring.cloud.aws', name: 's3fs-nio', version: '2.0.0-SNAPSHOT'
libraryDependencies += "org.carlspring.cloud.aws" % "s3fs-nio" % "2.0.0-SNAPSHOT"

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