使用支持S3协议的云存储作为文件服务器。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

97 lines
2.6 KiB

package com.fanruan.fs.s3.repository.core;
import com.fr.config.Identifier;
import com.fr.config.holder.Conf;
import com.fr.config.holder.factory.Holders;
import com.fr.io.config.CommonRepoConfig;
import com.fr.io.context.info.GetConfig;
import com.fr.io.context.info.SetConfig;
import com.fr.stable.StringUtils;
/**
* @author richie
* @version 10.0
* Created by richie on 2020/6/15
*/
public class S3Config extends CommonRepoConfig {
public S3Config() {
super(S3RepositoryFactory.IDENTITY);
}
@Identifier("endPoint")
private Conf<String> endPoint = Holders.simple(StringUtils.EMPTY);
@Identifier("region")
private Conf<String> region = Holders.simple(StringUtils.EMPTY);
@Identifier("accessKeyId")
private Conf<String> accessKeyId = Holders.simple(StringUtils.EMPTY);
@Identifier("accessKeySecret")
private Conf<String> accessKeySecret = Holders.simple(StringUtils.EMPTY);
@Identifier("bucket")
private Conf<String> bucket = Holders.simple(StringUtils.EMPTY);
@GetConfig("endPoint")
public String getEndPoint() {
return endPoint.get();
}
@SetConfig("endPoint")
public void setEndPoint(String endPoint) {
this.endPoint.set(endPoint);
}
@GetConfig("region")
public String getRegion() {
return region.get();
}
@SetConfig("region")
public void setRegion(String region) {
this.region.set(region);
}
@GetConfig("accessKeyId")
public String getAccessKeyId() {
return accessKeyId.get();
}
@SetConfig("accessKeyId")
public void setAccessKeyId(String accessKeyId) {
this.accessKeyId.set(accessKeyId);
}
@GetConfig("accessKeySecret")
public String getAccessKeySecret() {
return accessKeySecret.get();
}
@SetConfig("accessKeySecret")
public void setAccessKeySecret(String accessKeySecret) {
this.accessKeySecret.set(accessKeySecret);
}
@GetConfig("bucket")
public String getBucket() {
return bucket.get();
}
@SetConfig("bucket")
public void setBucket(String bucket) {
this.bucket.set(bucket);
}
@Override
public S3Config clone() throws CloneNotSupportedException {
S3Config cloned = (S3Config) super.clone();
cloned.endPoint = (Conf<String>) endPoint.clone();
cloned.region = (Conf<String>) region.clone();
cloned.accessKeyId = (Conf<String>) accessKeyId.clone();
cloned.accessKeySecret = (Conf<String>) accessKeySecret.clone();
cloned.bucket = (Conf<String>) bucket.clone();
return cloned;
}
}