|
|
@ -79,4 +79,20 @@ public class S3Service {
|
|
|
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int copy() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String bucket = "indie"; //存储桶名
|
|
|
|
|
|
|
|
String sourceKey = "20240121/1.mp3"; //copy的源文件路径
|
|
|
|
|
|
|
|
String destinationKey = "20240121/2.mp3"; // copy的目的地路径
|
|
|
|
|
|
|
|
CopyObjectResponse copyObjectResponse = s3Client.copyObject(CopyObjectRequest.builder().sourceBucket(bucket).sourceKey(sourceKey).destinationBucket(bucket).destinationKey(destinationKey).build());
|
|
|
|
|
|
|
|
SdkHttpResponse sdkHttpResponse = copyObjectResponse.sdkHttpResponse();
|
|
|
|
|
|
|
|
if(!sdkHttpResponse.isSuccessful()){
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|