Skip to content

Commit 2f6a080

Browse files
Merge pull request #78 from scholarsportal/Jayanthy-develop-globus-phase2
Jayanthy develop globus phase2
2 parents f167118 + 2117475 commit 2f6a080

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/main/java/edu/harvard/iq/dataverse/dataaccess/S3AccessIO.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,12 +1106,22 @@ private static AmazonS3 getClient(String driverId) {
11061106
String s3CERegion = System.getProperty("dataverse.files." + driverId + ".custom-endpoint-region", "dataverse");
11071107

11081108
// if the admin has set a system property (see below) we use this endpoint URL instead of the standard ones.
1109-
if (!s3CEUrl.isEmpty()) {
1110-
//s3CB.setEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(s3CEUrl, s3CERegion));
1111-
BasicAWSCredentials creds = new BasicAWSCredentials("14e4f8b986874272894d527a16c06473", "f7b28fbec4984588b0da7d0288ce67f6");
1112-
s3CB.withCredentials(new AWSStaticCredentialsProvider(creds));
1113-
s3CB.setEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(s3CEUrl.trim(), s3CERegion.trim()));
1114-
}
1109+
if (!s3CEUrl.isEmpty()) {
1110+
logger.info("s3CEURL =============== " + s3CEUrl);
1111+
logger.info("s3CERegion =============== " + s3CERegion);
1112+
try {
1113+
s3CB.setEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(s3CEUrl, s3CERegion));
1114+
logger.info(" ==================== Successfully connected ================== ");
1115+
}
1116+
catch(Exception e) {
1117+
logger.info(" ==================== Read the exception ================== ");
1118+
e.printStackTrace();
1119+
//BasicAWSCredentials creds = new BasicAWSCredentials("14e4f8b986874272894d527a16c06473", "f7b28fbec4984588b0da7d0288ce67f6");
1120+
//s3CB.withCredentials(new AWSStaticCredentialsProvider(creds));
1121+
//s3CB.setEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(s3CEUrl.trim(), s3CERegion.trim()));
1122+
logger.info(" ==================== Read the exception ================== ");
1123+
}
1124+
}
11151125
/**
11161126
* Pass in a boolean value if path style access should be used within the S3 client.
11171127
* Anything but case-insensitive "true" will lead to value of false, which is default value, too.

0 commit comments

Comments
 (0)