jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From am...@apache.org
Subject svn commit: r1621678 - in /jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext: S3Constants.java Utils.java
Date Mon, 01 Sep 2014 06:01:30 GMT
Author: amitj
Date: Mon Sep  1 06:01:30 2014
New Revision: 1621678

URL: http://svn.apache.org/r1621678
Log:
JCR-3804 - [jackrabbit-aws] Allow http communication to S3
Applying patch from Shashank Gupta.

Modified:
    jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/S3Constants.java
    jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/Utils.java

Modified: jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/S3Constants.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/S3Constants.java?rev=1621678&r1=1621677&r2=1621678&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/S3Constants.java
(original)
+++ jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/S3Constants.java
Mon Sep  1 06:01:30 2014
@@ -66,6 +66,11 @@ public final class S3Constants {
      * Amazon aws S3 region.
      */
     public static final String S3_END_POINT = "s3EndPoint";
+    
+    /**
+     * Constant for S3 Connector Protocol
+     */
+    public static final String S3_CONN_PROTOCOL = "s3ConnProtocol";
 
     /**
      * Constant to rename keys
@@ -76,7 +81,7 @@ public final class S3Constants {
      * Constant to rename keys
      */
     public static final String S3_WRITE_THREADS = "writeThreads";
-
+    
     /**
      * private constructor so that class cannot initialized from outside.
      */

Modified: jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/Utils.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/Utils.java?rev=1621678&r1=1621677&r2=1621678&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/Utils.java
(original)
+++ jackrabbit/trunk/jackrabbit-aws-ext/src/main/java/org/apache/jackrabbit/aws/ext/Utils.java
Mon Sep  1 06:01:30 2014
@@ -27,6 +27,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.amazonaws.ClientConfiguration;
+import com.amazonaws.Protocol;
 import com.amazonaws.auth.AWSCredentials;
 import com.amazonaws.auth.BasicAWSCredentials;
 import com.amazonaws.services.s3.AmazonS3;
@@ -67,6 +68,10 @@ public final class Utils {
         int maxConnections = Integer.parseInt(prop.getProperty(S3Constants.S3_MAX_CONNS));
         int maxErrorRetry = Integer.parseInt(prop.getProperty(S3Constants.S3_MAX_ERR_RETRY));
         ClientConfiguration cc = new ClientConfiguration();
+        String protocol = prop.getProperty(S3Constants.S3_CONN_PROTOCOL);
+        if ( protocol != null && protocol.equalsIgnoreCase("http")) {
+            cc.setProtocol(Protocol.HTTP);
+        }
         cc.setConnectionTimeout(connectionTimeOut);
         cc.setSocketTimeout(socketTimeOut);
         cc.setMaxConnections(maxConnections);



Mime
View raw message