com.github.javaclub.ossclient.confg.MinioConfig Maven / Gradle / Ivy
The newest version!
package com.github.javaclub.ossclient.confg;
import com.github.javaclub.ossclient.OssConstants.Minio;
import com.github.javaclub.toolbox.conf.CompositeAppConfigProperties;
import io.minio.MinioClient;
public class MinioConfig {
private static class SingletonHolder {
static String endpoint = CompositeAppConfigProperties.getInstance().getValue(Minio.ENDPOINT);
static String accessKey = CompositeAppConfigProperties.getInstance().getValue(Minio.ACCESS_KEY);
static String secretKey = CompositeAppConfigProperties.getInstance().getValue(Minio.SECRET_KEY);
private static final MinioClient INSTANCE = MinioClient.builder()
.endpoint(endpoint)
.credentials(accessKey, secretKey)
.build();
}
public static MinioClient getInstance() {
return SingletonHolder.INSTANCE;
}
}