Examples of MutableObjectMetadata


Examples of org.jclouds.s3.domain.MutableObjectMetadata

      http.getPayload().getContentMetadata().setContentLength(1025l);
      http.getPayload().getContentMetadata().setContentDisposition("contentDisposition");
      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");
View Full Code Here

Examples of org.jclouds.s3.domain.MutableObjectMetadata

      http.getPayload().getContentMetadata().setContentLength(1025l);
      http.getPayload().getContentMetadata().setContentDisposition("contentDisposition");
      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");
View Full Code Here

Examples of org.jclouds.s3.domain.MutableObjectMetadata

      http.getPayload().getContentMetadata().setContentLength(1025l);
      http.getPayload().getContentMetadata().setContentDisposition("contentDisposition");
      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");
View Full Code Here

Examples of org.jclouds.s3.domain.MutableObjectMetadata

   private String bucket;

   public MutableObjectMetadata apply(BlobMetadata from) {
      if (from == null)
         return null;
      MutableObjectMetadata to = new MutableObjectMetadataImpl();
      HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata());
      to.setUri(from.getUri());
      to.setETag(from.getETag());
      to.setKey(from.getName());
      to.setBucket(bucket);
      to.setLastModified(from.getLastModified());
      if (from.getUserMetadata() != null) {
         for (Entry<String, String> entry : from.getUserMetadata().entrySet())
            to.getUserMetadata().put(entry.getKey().toLowerCase(), entry.getValue());
      }
      return to;
   }
View Full Code Here

Examples of org.jclouds.s3.domain.MutableObjectMetadata

      this.metadataParser = metadataParser;
      this.objectProvider = objectProvider;
   }

   public S3Object apply(HttpResponse from) {
      MutableObjectMetadata metadata = metadataParser.apply(from);
      S3Object object = objectProvider.create(metadata);
      object.getAllHeaders().putAll(from.getHeaders());
      object.setPayload(from.getPayload());
      return object;
   }
View Full Code Here

Examples of org.jclouds.s3.domain.MutableObjectMetadata

    * parses the http response headers to create a new
    * {@link org.jclouds.s3.domain.internal.MutableObjectMetadata} object.
    */
   public MutableObjectMetadata apply(HttpResponse from) {
      BlobMetadata base = blobMetadataParser.apply(from);
      MutableObjectMetadata to = blobToObjectMetadata.apply(base);

      addETagTo(from, to);
      if (to.getContentMetadata().getContentMD5() == null && to.getETag() != null) {
         Matcher md5Matcher = MD5_FROM_ETAG.matcher(to.getETag());
         if (md5Matcher.find()) {
            byte[] md5 = base16().lowerCase().decode(md5Matcher.group(1));
            // it is possible others will look at the http payload directly
            if (from.getPayload() != null)
               from.getPayload().getContentMetadata().setContentMD5(md5);
            to.getContentMetadata().setContentMD5(md5);
         }
      }
      // amz has an etag, but matches syntax for usermetadata
      to.getUserMetadata().remove("object-etag");
      to.setCacheControl(from.getFirstHeaderOrNull(HttpHeaders.CACHE_CONTROL));
      return to;
   }
View Full Code Here

Examples of org.jclouds.s3.domain.MutableObjectMetadata

    * parses the http response headers to create a new
    * {@link org.jclouds.s3.domain.internal.MutableObjectMetadata} object.
    */
   public MutableObjectMetadata apply(HttpResponse from) {
      BlobMetadata base = blobMetadataParser.apply(from);
      MutableObjectMetadata to = blobToObjectMetadata.apply(base);

      addETagTo(from, to);
      if (to.getContentMetadata().getContentMD5() == null && to.getETag() != null) {
         Matcher md5Matcher = MD5_FROM_ETAG.matcher(to.getETag());
         if (md5Matcher.find()) {
            byte[] md5 = base16().lowerCase().decode(md5Matcher.group(1));
            // it is possible others will look at the http payload directly
            if (from.getPayload() != null)
               from.getPayload().getContentMetadata().setContentMD5(md5);
            to.getContentMetadata().setContentMD5(md5);
         }
      }
      // amz has an etag, but matches syntax for usermetadata
      to.getUserMetadata().remove("object-etag");
      to.setCacheControl(from.getFirstHeaderOrNull(HttpHeaders.CACHE_CONTROL));
      return to;
   }
View Full Code Here

Examples of org.jclouds.s3.domain.MutableObjectMetadata

      this.metadataParser = metadataParser;
      this.objectProvider = objectProvider;
   }

   public S3Object apply(HttpResponse from) {
      MutableObjectMetadata metadata = metadataParser.apply(from);
      S3Object object = objectProvider.create(metadata);
      object.getAllHeaders().putAll(from.getHeaders());
      object.setPayload(from.getPayload());
      return object;
   }
View Full Code Here

Examples of org.jclouds.s3.domain.MutableObjectMetadata

    * parses the http response headers to create a new
    * {@link org.jclouds.s3.domain.internal.MutableObjectMetadata} object.
    */
   public MutableObjectMetadata apply(HttpResponse from) {
      BlobMetadata base = blobMetadataParser.apply(from);
      MutableObjectMetadata to = blobToObjectMetadata.apply(base);

      addETagTo(from, to);
      if (to.getContentMetadata().getContentMD5() == null && to.getETag() != null) {
         Matcher md5Matcher = MD5_FROM_ETAG.matcher(to.getETag());
         if (md5Matcher.find()) {
            byte[] md5 = base16().lowerCase().decode(md5Matcher.group(1));
            // it is possible others will look at the http payload directly
            if (from.getPayload() != null)
               from.getPayload().getContentMetadata().setContentMD5(md5);
            to.getContentMetadata().setContentMD5(md5);
         }
      }
      // amz has an etag, but matches syntax for usermetadata
      to.getUserMetadata().remove("object-etag");
      to.setCacheControl(from.getFirstHeaderOrNull(HttpHeaders.CACHE_CONTROL));
      return to;
   }
View Full Code Here

Examples of org.jclouds.s3.domain.MutableObjectMetadata

   private String bucket;

   public MutableObjectMetadata apply(BlobMetadata from) {
      if (from == null)
         return null;
      MutableObjectMetadata to = new MutableObjectMetadataImpl();
      HttpUtils.copy(from.getContentMetadata(), to.getContentMetadata());
      to.setUri(from.getUri());
      to.setETag(from.getETag());
      to.setKey(from.getName());
      to.setBucket(bucket);
      to.setLastModified(from.getLastModified());
      if (from.getUserMetadata() != null) {
         for (Entry<String, String> entry : from.getUserMetadata().entrySet())
            to.getUserMetadata().put(entry.getKey().toLowerCase(), entry.getValue());
      }
      return to;
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.