https://github.com/stardogventures/aws-local
Filesystem implementation of S3, for local use on the JVM
https://github.com/stardogventures/aws-local
aws aws-s3 dropwizard java jvm local s3
Last synced: about 2 months ago
JSON representation
Filesystem implementation of S3, for local use on the JVM
- Host: GitHub
- URL: https://github.com/stardogventures/aws-local
- Owner: stardogventures
- License: apache-2.0
- Created: 2018-04-17T18:21:03.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-26T05:14:16.000Z (over 7 years ago)
- Last Synced: 2025-03-16T16:17:40.450Z (over 1 year ago)
- Topics: aws, aws-s3, dropwizard, java, jvm, local, s3
- Language: Java
- Size: 13.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aws-local
Local S3 implementation and fileserver for Java 8+
This module provides a highly incomplete implementation of `AmazonS3`
which loads and stores files in a folder in the local filesystem.
Also includes a JAX-RS resource for serving files from the S3
implementation, suitable for Dropwizard etc.
Do not use this in production! This is purely for local development
purposes where you don't want to have to rely on a real S3 bucket.
### Installation
Add the following to your POM:
```
io.stardog.aws.local
aws-local
0.1.0
```
### Usage
Swap in the implementation of `AmazonS3Local` whereever you would
normally use an `AmazonS3Client`:
```java
if (config.getS3LocalPath() != null) {
bind(AmazonS3.class).toInstance(new AmazonS3Local(new File("/tmp/s3-local));
} else {
bind(AmazonS3.class).toInstance(AmazonS3Client.builder()
.withRegion("us-east-1")
.build());
}
```
### Local fileserver
If you want to serve files from your local S3, add the `S3ServeResource`.
Be sure not to use this in production.
Dropwizard example:
```java
if ("local".equals(config.getEnv())) {
env.jersey().register(new S3ServeResource(s3, "media-bucket-name"));
}
```