|
@@ -184,7 +184,7 @@ public class UploadToCdfOssUtil {
|
|
|
BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3key, s3secrey);
|
|
|
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
|
|
|
- .withRegion(Regions.EU_WEST_2)
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)
|
|
|
.build();
|
|
|
try {
|
|
|
com.amazonaws.services.s3.model.ObjectMetadata metadata = new com.amazonaws.services.s3.model.ObjectMetadata();
|
|
@@ -333,7 +333,7 @@ public class UploadToCdfOssUtil {
|
|
|
|
|
|
AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCred))
|
|
|
- .withRegion(Regions.EU_WEST_2)
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)
|
|
|
.build();
|
|
|
|
|
|
// Set the pre-signed URL to expire after one hour.
|
|
@@ -412,7 +412,7 @@ public class UploadToCdfOssUtil {
|
|
|
BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3key, s3secrey);
|
|
|
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
|
|
|
- .withRegion(Regions.EU_WEST_2)
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)
|
|
|
.build();
|
|
|
|
|
|
try {
|
|
@@ -454,7 +454,7 @@ public class UploadToCdfOssUtil {
|
|
|
BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3key, s3secrey);
|
|
|
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
|
|
|
- .withRegion(Regions.EU_WEST_2)
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)
|
|
|
.build();
|
|
|
try{
|
|
|
File file = new File(filePath);
|
|
@@ -502,7 +502,7 @@ public class UploadToCdfOssUtil {
|
|
|
BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3key, s3secrey);
|
|
|
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
|
|
|
- .withRegion(Regions.EU_WEST_2)
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)
|
|
|
.build();
|
|
|
|
|
|
if (objectName.startsWith("/")) {
|
|
@@ -616,7 +616,7 @@ public class UploadToCdfOssUtil {
|
|
|
BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3key, s3secrey);
|
|
|
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
|
|
|
- .withRegion(Regions.EU_WEST_2)
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)
|
|
|
.build();
|
|
|
|
|
|
try {
|
|
@@ -772,7 +772,7 @@ public class UploadToCdfOssUtil {
|
|
|
BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3key, s3secrey);
|
|
|
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
|
|
|
- .withRegion(Regions.EU_WEST_2)//s3 地区位置
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)//s3 地区位置
|
|
|
.build();
|
|
|
|
|
|
// 复制文件
|
|
@@ -800,7 +800,7 @@ public class UploadToCdfOssUtil {
|
|
|
BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3key, s3secrey);
|
|
|
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
|
|
|
- .withRegion(Regions.EU_WEST_2)//s3 地区位置
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)//s3 地区位置
|
|
|
.build();
|
|
|
// 复制文件
|
|
|
log.info("开始复制:" + sourceKey);
|
|
@@ -914,7 +914,7 @@ public class UploadToCdfOssUtil {
|
|
|
BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3key, s3secrey);
|
|
|
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
|
|
|
- .withRegion(Regions.EU_WEST_2)
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)
|
|
|
.build();
|
|
|
|
|
|
GetObjectRequest request = new GetObjectRequest(bucketName,objectName);
|
|
@@ -948,10 +948,10 @@ public class UploadToCdfOssUtil {
|
|
|
BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3key, s3secrey);
|
|
|
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
|
|
|
- .withRegion(Regions.EU_WEST_2)
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)
|
|
|
.build();
|
|
|
try {
|
|
|
- boolean exist = s3.doesObjectExist(bucket, objectName);
|
|
|
+ boolean exist = s3.doesObjectExist(s3bucket, objectName);
|
|
|
return exist;
|
|
|
}catch (Exception e){
|
|
|
log.error("s4判断是否存在key异常,key=" + objectName, e);
|
|
@@ -1038,7 +1038,7 @@ public class UploadToCdfOssUtil {
|
|
|
BasicAWSCredentials awsCreds = new BasicAWSCredentials(s3key, s3secrey);
|
|
|
AmazonS3 s3 = AmazonS3ClientBuilder.standard()
|
|
|
.withCredentials(new AWSStaticCredentialsProvider(awsCreds))
|
|
|
- .withRegion(Regions.EU_WEST_2)
|
|
|
+ .withRegion(Regions.AP_SOUTHEAST_1)
|
|
|
.build();
|
|
|
try {
|
|
|
GetObjectRequest request = new GetObjectRequest(this.bucket,objectName);
|