Examples of blobBuilder()


Examples of org.jclouds.blobstore.BlobStore.blobBuilder()

      assertNull(ToBlob.INSTANCE.apply(null));
      BlobStore blobStore = getBlobStore();
      blobStore.createContainerInLocation(null, "container");
      blobStore.createDirectory("container", "one");

      blobStore.putBlob("container", blobStore.blobBuilder("myblob").payload("testcontent").build());
      Blob representation = ToBlob.INSTANCE.apply(blobStore.getBlob("container", "myblob"));
      assertNotNull(representation);
      assertNotNull(representation.getBlobMetadata());
   }
}
View Full Code Here

Examples of org.jclouds.blobstore.BlobStore.blobBuilder()

   @Override
   protected Object doExecute() throws Exception {
      BlobStore blobStore = getBlobStore();

      BlobBuilder builder = blobStore.blobBuilder(blobName);
      if (stringPayload) {
         builder = builder.payload(payload.getBytes())// use default Charset
      } else if (urlPayload) {
         InputStream input = new URL(payload).openStream();
         try {
View Full Code Here

Examples of org.jclouds.blobstore.BlobStore.blobBuilder()

       String containerName = getContainerName();

       try {
           BlobStore blobStore = view.getBlobStore();
           blobStore.createContainerInLocation(null, containerName);
           Blob blob = blobStore.blobBuilder("const.txt")
                   .payload(new File("target/const.txt")).contentMD5(oneHundredOneConstitutionsMD5).build();
           blobStore.putBlob(containerName, blob, PutOptions.Builder.multipart());
       } finally {
           returnContainer(containerName);
       }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStore.blobBuilder()

                Runnable putBlob = new Runnable() {
                    @Override
                    public void run() {
                        try {
                            readLatch.await();
                            Blob blob = blobStore.blobBuilder(blobName).payload(tmpBlob).build();
                            blobStore.putBlob(containerName, blob);
                            tmpBlob.delete();
                            tmpDir.delete();
                        } catch (InterruptedException e) {
                            logger.error("Interrupted while waiting on blob read.", e);
View Full Code Here

Examples of org.jclouds.blobstore.BlobStore.blobBuilder()

  @Override
  public void save(Cluster cluster) throws IOException {
    BlobStore store = context.getBlobStore();

    Blob blob = store.blobBuilder(blobName).payload(serialize(cluster)).build();
    store.putBlob(container, blob);

    LOG.info("Saved cluster state to '{}' ", context.getSigner()
      .signGetBlob(container, blobName).getEndpoint().toString());
  }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStore.blobBuilder()

      String containerName = getContainerName();

      try {
         BlobStore blobStore = view.getBlobStore();
         blobStore.createContainerInLocation(null, containerName);
         Blob blob = blobStore.blobBuilder("const.txt").payload(file).build();
         String expected = blobStore.putBlob(containerName, blob, PutOptions.Builder.multipart());
         String etag = blobStore.blobMetadata(containerName, "const.txt").getETag();
         assertEquals(etag, expected);
      } finally {
         returnContainer(containerName);
View Full Code Here

Examples of org.jclouds.blobstore.BlobStore.blobBuilder()

      String containerName = getContainerName();

      try {
         BlobStore blobStore = view.getBlobStore();
         blobStore.createContainerInLocation(null, containerName);
         Blob blob = blobStore.blobBuilder("const.txt").payload(file).build();
         String expected = blobStore.putBlob(containerName, blob, PutOptions.Builder.multipart());
         String etag = blobStore.blobMetadata(containerName, "const.txt").getETag();
         assertEquals(etag, expected);
      } finally {
         returnContainer(containerName);
View Full Code Here

Examples of org.jclouds.blobstore.BlobStore.blobBuilder()

                  String.format("creating public container %s in location %s", containerName, nonDefault.getId()));
         blobStore.createContainerInLocation(nonDefault, containerName, publicRead());
         assertConsistencyAwareContainerExists(containerName);
         assertConsistencyAwareContainerInLocation(containerName, nonDefault);

         blobStore.putBlob(containerName, blobStore.blobBuilder(blobName).payload(payload).build());

         assertConsistencyAwareContainerSize(containerName, 1);

         BlobMetadata metadata = view.getBlobStore().blobMetadata(containerName, blobName);
         assertEquals(Strings2.toStringAndClose(view.utils().http().get(metadata.getPublicUri())), payload);
View Full Code Here

Examples of org.jclouds.blobstore.BlobStore.blobBuilder()

      String containerName = getContainerName();
     
      try {
         BlobStore blobStore = view.getBlobStore();
         blobStore.createContainerInLocation(null, containerName);
         Blob blob = blobStore.blobBuilder("const.txt").payload(file).build();
         blobStore.putBlob(containerName, blob, PutOptions.Builder.multipart());

      } finally {
         returnContainer(containerName);
      }
View Full Code Here

Examples of org.jclouds.blobstore.BlobStore.blobBuilder()

      try {
         String blobName = "test-rrs";
         BlobStore blobStore = view.getBlobStore();
         blobStore.createContainerInLocation(null, containerName);

         Blob blob = blobStore.blobBuilder(blobName).payload("something").build();
         blobStore.putBlob(containerName, blob,
            storageClass(StorageClass.REDUCED_REDUNDANCY));

         S3Client s3Client = S3Client.class.cast(view.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi());
         ListBucketResponse response = s3Client.listBucket(containerName, withPrefix(blobName));
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.