Integrate minio sdk for jdk and native build modes.
After configuring quarkus BOM
:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
<version>${insert.newest.quarkus.version.here}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
You can just configure the quarkus-minio
extension by adding the following dependency:
<dependency>
<groupId>io.quarkiverse.minio</groupId>
<artifactId>quarkus-minio</artifactId>
<version>${latest.release.version}</version>
</dependency>
An io.minio.MinioClient
is made available to your application as a CDI bean if configuration is found.
package com.acme.minio;
import io.minio.MinioClient;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
@ApplicationScoped
public class SampleService {
@Inject
MinioClient minioClient;
@ConfigProperty(name = "minio.bucket-name")
String bucketName;
public String getObject(String name) {
try (InputStream is = minio.getObject(
GetObjectArgs.builder()
.bucket(bucketName)
.object(objectName)
.build());
) {
// Do whatever you want...
} catch (MinioException e) {
throw new IllegalStateException(e);
}
}
}
Configuration is done through standard application.properties mechanism. Configuration is optional, but if present url has to be a valid http url.
quarkus.minio.url=https://minio.acme
quarkus.minio.access-key=DUMMY-ACCESS-KEY
quarkus.minio.secret-key=DUMMY-SECRET-KEY
Thanks goes to these wonderful people (emoji key):
jtama-op 💻 🚧 |
This project follows the all-contributors specification. Contributions of any kind welcome!
This project is still in its early stage.
Contributions are always welcome, but this repository is not really ready for external contributions yet, better create an issue to discuss them prior to any contributions.