Reverted library update, kept script improvements and bug fixes

This commit is contained in:
RobinFleige
2018-08-22 11:24:24 +02:00
parent 9cb2499507
commit 592dfc1426
6 changed files with 7 additions and 22 deletions
@@ -93,7 +93,7 @@
id="org.apache.servicemix.bundles.aws-java-sdk"
download-size="0"
install-size="0"
version="1.11.373.1"
version="1.10.73.1"
unpack="false"/>
<plugin
@@ -1,12 +0,0 @@
OSGI-ified version of AWS Java SDK from http://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.aws-java-sdk
Due to bug (https://issues.apache.org/jira/browse/SMX4-1921): add awssdk_config_default.json (obtained from original AWS Java SDK) to downloaded jar.
Note: with bug 3683 we're upgrading to version 1.10.17_1 of the org.apache.servicemix.bundles.aws-java-sdk component. It has an entry
5004 Fri Apr 29 18:48:10 CEST 2016 com/amazonaws/internal/config/awssdk_config_default.json
and hence suggests that the patch described above as necessary for version 1.9.8_1 may no longer be necessary.
Note: with bug 4656 we're upgrading to version 1.11.373_1 of the org.apache.servicemix.bundles.aws-java-sdk component.
This version already includes the awssdk_config_default.json, thus the patch is not necessary anymore.
Nevertheless the bug is still not resolved, since the awssdk_config_default.json in the package is not a valid json file.
To validate it, you have to remove all "Java-Style" comments "//".
+1 -1
View File
@@ -274,7 +274,7 @@
id="org.apache.servicemix.bundles.aws-java-sdk"
download-size="0"
install-size="0"
version="1.11.373.1"
version="1.10.73.1"
unpack="false"/>
<plugin
@@ -8,13 +8,10 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import com.amazonaws.AmazonClientException;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.AWSCredentials;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.auth.profile.ProfileCredentialsProvider;
import com.amazonaws.services.s3.AmazonS3;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.AmazonS3ClientBuilder;
import com.amazonaws.services.s3.model.CannedAccessControlList;
import com.amazonaws.services.s3.model.DeleteObjectRequest;
import com.amazonaws.services.s3.model.ObjectMetadata;
@@ -56,22 +53,22 @@ public class AmazonS3FileStorageServiceImpl extends BaseFileStorageServiceImpl i
}
private AmazonS3Client createS3Client() throws InvalidPropertiesException {
AWSCredentialsProvider creds;
AWSCredentials creds;
// first try to use properties
if (accessId.getValue() != null && accessKey.getValue() != null) {
creds = new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessId.getValue(), accessKey.getValue()));
creds = new BasicAWSCredentials(accessId.getValue(), accessKey.getValue());
} else {
// if properties are empty, read credentials from ~/.aws/credentials
try {
creds = new ProfileCredentialsProvider();
creds = new ProfileCredentialsProvider().getCredentials();
} catch (Exception e) {
throw new InvalidPropertiesException(
"credentials in ~/.aws/credentials seem to be invalid (tried this as fallback because properties were empty)",
e);
}
}
return (AmazonS3Client) AmazonS3ClientBuilder.standard().withCredentials(creds).withRegion(regionRetrievalHost).enableForceGlobalBucketAccess().build();
return new AmazonS3Client(creds);
}
private static String getKey(String fileExtension) {