levigo / s3-java-example

This repository demonstrates how to create a s3 client for java that generates and fetches presigned urls

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

S3 java client demo repository (with pre-signed url showcase)

This project serves as an example of how to create a s3 client in java for custom instances (not provided by aws) in order to:

  • upload a file to s3 and receiving a presigned url that allows to access the file for a certain duration
  • retrieving a file via a presigned url from the s3 service
  • deleting a file via a presigned url from the s3 service

Tests

To be able to run the tests provide an application-test.yml file in the src/test/resources folder with the following content:

publisher:
  s3:
    bucket: <bucket-name>
    endpoint: <s3-service-endpoint-name>
    access-key: <s3-service-access-key>
    secret-key: <s3-service-secret-key>
    protocol: <s3-service-http-protocol-scheme>

And after that remove the @Disabled annotation.

The build process of this repository creates a jar and a jar-with-dependencies that includes all the dependencies for this project into on fat jar.

About

This repository demonstrates how to create a s3 client for java that generates and fetches presigned urls

License:Apache License 2.0


Languages

Language:Java 100.0%