Package org.jclouds.s3.domain.internal

Examples of org.jclouds.s3.domain.internal.CopyObjectResult


      if (qName.equals("ETag")) {
         this.currentETag = currentOrNull(currentText);
      } else if (qName.equals("LastModified")) {
         this.currentLastModified = dateParser.iso8601DateParse(currentOrNull(currentText));
      } else if (qName.equals("CopyObjectResult")) {
         metadata = new CopyObjectResult(currentLastModified, currentETag);
      }
      currentText = new StringBuilder();
   }
View Full Code Here


      if (qName.equals("ETag")) {
         this.currentETag = currentOrNull(currentText);
      } else if (qName.equals("LastModified")) {
         this.currentLastModified = dateParser.iso8601DateParse(currentOrNull(currentText));
      } else if (qName.equals("CopyObjectResult")) {
         metadata = new CopyObjectResult(currentLastModified, currentETag);
      }
      currentText = new StringBuilder();
   }
View Full Code Here

      assert dateService != null;
   }

   public void testApplyInputStream() {
      InputStream is = getClass().getResourceAsStream("/copy_object.xml");
      ObjectMetadata expected = new CopyObjectResult(new SimpleDateFormatDateService()
               .iso8601DateParse("2009-03-19T13:23:27.000Z"),
               "\"92836a3ea45a6984d1b4d23a747d46bb\"");

      ObjectMetadata result = factory.create(
               injector.getInstance(CopyObjectHandler.class)).parse(is);
View Full Code Here

         this.currentETag = currentOrNull(currentText);
      } else if (qName.equals("LastModified")) {
         this.currentLastModified = dateParser
             .iso8601DateOrSecondsDateParse(currentOrNull(currentText));
      } else if (qName.equals("CopyObjectResult")) {
         metadata = new CopyObjectResult(currentLastModified, currentETag);
      }
      currentText = new StringBuilder();
   }
View Full Code Here

      assert dateService != null;
   }

   public void testApplyInputStream() {
      InputStream is = getClass().getResourceAsStream("/copy_object.xml");
      ObjectMetadata expected = new CopyObjectResult(new SimpleDateFormatDateService()
               .iso8601DateParse("2009-03-19T13:23:27.000Z"),
               "\"92836a3ea45a6984d1b4d23a747d46bb\"");

      ObjectMetadata result = factory.create(
               injector.getInstance(CopyObjectHandler.class)).parse(is);
View Full Code Here

    * Verifies that the parser doesn't barf if the timestamp in the copy object
    * xml has time zone designators.
    */
   public void testApplyInputStreamWithSecondsDate() {
      InputStream is = Strings2.toInputStream(copyObjectResultWithSecondsDate);
      ObjectMetadata expected = new CopyObjectResult(
            new SimpleDateFormatDateService()
                  .iso8601SecondsDateParse("2014-07-23T20:53:17+0000"),
            "\"92836a3ea45a6984d1b4d23a747d46bb\"");

      ObjectMetadata result = factory.create(
View Full Code Here

    */
   @Test
   public void testListMyBucketsWithSecondsDate() {
      ListBucketResponse bucket = createParser().parse(
            Strings2.toInputStream(listBucketWithSecondsDate));
      ObjectMetadata expected = new CopyObjectResult(
            new SimpleDateFormatDateService()
                  .iso8601SecondsDateParse("2014-07-23T20:53:17+0000"),
            "\"92836a3ea45a6984d1b4d23a747d46bb\"");

      // Verify that the date was parsed successfully.
      ObjectMetadata metadata = bucket.iterator().next();
      assertEquals(metadata.getLastModified(), expected.getLastModified());
   }
View Full Code Here

         this.currentETag = currentOrNull(currentText);
      } else if (qName.equals("LastModified")) {
         this.currentLastModified = dateParser
             .iso8601DateOrSecondsDateParse(currentOrNull(currentText));
      } else if (qName.equals("CopyObjectResult")) {
         metadata = new CopyObjectResult(currentLastModified, currentETag);
      }
      currentText.setLength(0);
   }
View Full Code Here

   public ListBucketHandler(DateService dateParser) {
      this.dateParser = dateParser;
   }

   public ListBucketResponse getResult() {
      return new ListBucketResponseImpl(bucketName, contents.build(), prefix, marker,
               (isTruncated && nextMarker == null) ? currentKey : nextMarker, maxResults, delimiter, isTruncated,
               commonPrefixes.build());
   }
View Full Code Here

      http.getPayload().getContentMetadata().setContentEncoding("encoding");
      http.getPayload().getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);

      MutableObjectMetadata response = parser.apply(http);

      MutableObjectMetadataImpl expects = new MutableObjectMetadataImpl();
      expects.setCacheControl("cacheControl");
      expects.getContentMetadata().setContentDisposition("contentDisposition");
      expects.getContentMetadata().setContentEncoding("encoding");
      expects.getContentMetadata().setContentType(MediaType.APPLICATION_OCTET_STREAM);
      expects.getContentMetadata().setContentLength(1025l);
      expects.getContentMetadata().setContentMD5(base16().lowerCase().decode("abcd"));
      expects.setETag("\"abcd\"");
      expects.setKey("key");
      expects.setLastModified(now);
      expects.setOwner(null);
      expects.setStorageClass(StorageClass.STANDARD);
      expects.setUserMetadata(userMetadata);
      assertEquals(response, expects);
   }
View Full Code Here

TOP

Related Classes of org.jclouds.s3.domain.internal.CopyObjectResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.