Package org.jclouds.blobstore.domain

Examples of org.jclouds.blobstore.domain.BlobBuilder.payload()


      if (stringPayload) {
         builder = builder.payload(payload.getBytes())// use default Charset
      } else if (urlPayload) {
         InputStream input = new URL(payload).openStream();
         try {
            builder = builder.payload(ByteStreams.toByteArray(input));
         } finally {
            input.close();
         }
      } else {
         BlobBuilder.PayloadBlobBuilder payloadBuilder = builder.payload(new File(payload));
View Full Code Here


            builder = builder.payload(ByteStreams.toByteArray(input));
         } finally {
            input.close();
         }
      } else {
         BlobBuilder.PayloadBlobBuilder payloadBuilder = builder.payload(new File(payload));
         if (!multipartUpload) {
            payloadBuilder = payloadBuilder.calculateMD5();
         }
         builder = payloadBuilder;
      }
View Full Code Here

   public Blob getBlob(final String container, final String key) {
      BlobBuilder builder = blobBuilders.get();
      builder.name(key);
      File file = getFileForBlobKey(container, key);
      try {
         builder.payload(file).calculateMD5();
      } catch (IOException e) {
         logger.error("An error occurred calculating MD5 for blob %s from container ", key, container);
         Throwables.propagateIfPossible(e);
      }
      Blob blob = builder.build();
View Full Code Here

               }
               String value = readStringAttributeIfPresent(view, attributes, attribute);
               userMetadata.put(attribute.substring(XATTR_USER_METADATA_PREFIX.length()), value);
            }

            builder.payload(byteSource)
               .contentDisposition(contentDisposition)
               .contentEncoding(contentEncoding)
               .contentLanguage(contentLanguage)
               .contentLength(byteSource.size())
               .contentMD5(hashCode)
View Full Code Here

               .contentMD5(hashCode)
               .contentType(contentType)
               .expires(expires)
               .userMetadata(userMetadata.build());
         } else {
            builder.payload(byteSource)
               .contentLength(byteSource.size())
               .contentMD5(byteSource.hash(Hashing.md5()).asBytes());
         }
      } catch (IOException e) {
         throw Throwables.propagate(e);
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.