|
|
|
@ -1,8 +1,8 @@
|
|
|
|
|
package com.fanruan.fs.s3.repository.core; |
|
|
|
|
|
|
|
|
|
import com.fanruan.api.conf.HolderKit; |
|
|
|
|
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.ResourceModuleContext; |
|
|
|
|
import com.fr.io.context.info.GetConfig; |
|
|
|
@ -21,19 +21,16 @@ public class S3Config extends CommonRepoConfig {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Identifier("endPoint") |
|
|
|
|
private Conf<String> endPoint = Holders.simple(StringUtils.EMPTY); |
|
|
|
|
private Conf<String> endPoint = HolderKit.simple(StringUtils.EMPTY); |
|
|
|
|
|
|
|
|
|
@Identifier("region") |
|
|
|
|
private Conf<String> region = Holders.simple(StringUtils.EMPTY); |
|
|
|
|
private Conf<String> region = HolderKit.simple(StringUtils.EMPTY); |
|
|
|
|
|
|
|
|
|
@Identifier("accessKeyId") |
|
|
|
|
private Conf<String> accessKeyId = Holders.simple(StringUtils.EMPTY); |
|
|
|
|
|
|
|
|
|
@Identifier("accessKeySecret") |
|
|
|
|
private Conf<String> accessKeySecret = Holders.simple(StringUtils.EMPTY); |
|
|
|
|
private Conf<String> accessKeyId = HolderKit.simple(StringUtils.EMPTY); |
|
|
|
|
|
|
|
|
|
@Identifier("bucket") |
|
|
|
|
private Conf<String> bucket = Holders.simple(StringUtils.EMPTY); |
|
|
|
|
private Conf<String> bucket = HolderKit.simple(StringUtils.EMPTY); |
|
|
|
|
|
|
|
|
|
@GetConfig("endPoint") |
|
|
|
|
public String getEndPoint() { |
|
|
|
@ -65,16 +62,6 @@ public class S3Config extends CommonRepoConfig {
|
|
|
|
|
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(); |
|
|
|
@ -93,7 +80,6 @@ public class S3Config extends CommonRepoConfig {
|
|
|
|
|
this.setEndPoint(newConfig.getEndPoint()); |
|
|
|
|
this.setRegion(newConfig.getRegion()); |
|
|
|
|
this.setAccessKeyId(newConfig.getAccessKeyId()); |
|
|
|
|
this.setAccessKeySecret(newConfig.getAccessKeySecret()); |
|
|
|
|
this.setBucket(newConfig.getBucket()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -104,7 +90,6 @@ public class S3Config extends CommonRepoConfig {
|
|
|
|
|
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; |
|
|
|
|
} |
|
|
|
|