CVS update: JGroups/src/org/jgroups/protocols S3_PING.java

"Benjamin Browning" <[email protected]> Fri, 17 Sep 2010 19:50:47 +0000
Newsgroups gmane.comp.java.javagroups.cvs
Message-ID <[email protected]>
  User: benbrowning
  Date: 10/09/17 19:50:47

  Modified:    src/org/jgroups/protocols S3_PING.java
  Log:
  Cleaning up last commit a bit - removing commented out code and centralizing
  logic that determines if we're using pre-signed urls.
  
  (https://jira.jboss.org/browse/JGRP-1235)
  
  Revision  Changes    Path
  1.14      +3 -5      JGroups/src/org/jgroups/protocols/S3_PING.java
  
  Index: S3_PING.java
  ===================================================================
  RCS file: /cvsroot/javagroups/JGroups/src/org/jgroups/protocols/S3_PING.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- S3_PING.java	17 Sep 2010 19:36:37 -0000	1.13
  +++ S3_PING.java	17 Sep 2010 19:50:47 -0000	1.14
  @@ -35,7 +35,7 @@
    * Discovery protocol using Amazon's S3 storage. The S3 access code reuses the example shipped by Amazon.
    * This protocol is unsupported and experimental !
    * @author Bela Ban
  - * @version $Id: S3_PING.java,v 1.13 2010/09/17 19:36:37 benbrowning Exp $
  + * @version $Id: S3_PING.java,v 1.14 2010/09/17 19:50:47 benbrowning Exp $
    */
   @Experimental
   public class S3_PING extends FILE_PING {
  @@ -156,7 +156,7 @@
               byte[] buf=Util.objectToByteBuffer(data);
               S3Object val=new S3Object(buf, null);
   
  -            if (pre_signed_put_url != null) {
  +            if (usingPreSignedUrls()) {
                   Map headers = new TreeMap();
                   headers.put("x-amz-acl", Arrays.asList("public-read"));
                   conn.put(pre_signed_put_url, val, headers).connection.getResponseMessage();
  @@ -180,7 +180,7 @@
           try {
               Map headers=new TreeMap();
               headers.put("Content-Type", Arrays.asList("text/plain"));
  -            if (pre_signed_delete_url != null) {
  +            if (usingPreSignedUrls()) {
                   conn.delete(pre_signed_delete_url).connection.getResponseMessage();
               } else {
                   conn.delete(location, key, headers).connection.getResponseMessage();
  @@ -1810,8 +1810,6 @@
               return "http://" + DEFAULT_HOST + "/" + bucket + "/" + key + "?" +
                   "AWSAccessKeyId=" + awsAccessKey + "&Expires=" + expirationDate +
                   "&Signature=" + encodedCanonical;
  -            // connection.setRequestProperty("Authorization",
  -            //                               "AWS " + this.awsAccessKeyId + ":" + encodedCanonical);
           }
       }
   
  
  
  

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev