use of com.zhouzifei.tool.config.AwsFileProperties in project simpleFS by shengdingbox.
the class AwsS3ApiClient method init.
@Override
public AwsS3ApiClient init(FileProperties fileProperties) {
final AwsFileProperties awsFileProperties = fileProperties.getAws();
this.accessKey = awsFileProperties.getSecretKey();
this.secretKey = awsFileProperties.getSecretKey();
this.domainUrl = awsFileProperties.getDomainUrl();
this.endpoint = awsFileProperties.getEndpoint();
this.region = awsFileProperties.getRegion();
this.bucketName = awsFileProperties.getBucketName();
checkDomainUrl(domainUrl);
return this;
}
use of com.zhouzifei.tool.config.AwsFileProperties in project simpleFS by shengdingbox.
the class AwsS3ApiClient method main.
public static void main(String[] args) {
final FileProperties fileProperties = new FileProperties();
final AwsFileProperties awsFileProperties = fileProperties.getAws();
awsFileProperties.setAccessKey("LTAI5tFpTDE26XYiPmH9dxDz");
awsFileProperties.setSecretKey("9gC7gs5kEJJmZec6a6QupoefIL82Kr");
awsFileProperties.setEndpoint("oss-cn-beijing.aliyuncs.com");
awsFileProperties.setBucketName("simple-fs");
awsFileProperties.setDomainUrl("https://simple-fs.oss-cn-beijing.aliyuncs.com/");
final AwsS3ApiClient awsS3ApiClient = new AwsS3ApiClient(fileProperties);
final File file = new File("/Users/Dabao/Downloads/videoplayback.mp4");
final VirtualFile virtualFile = awsS3ApiClient.uploadFile(file);
System.out.println(virtualFile);
System.out.println(1);
}
Aggregations