Package org.jclouds.blobstore.domain.internal

Examples of org.jclouds.blobstore.domain.internal.BlobImpl


      ObjectApi objectApi = api.objectApiInRegionForContainer(region.getId(), container);
      SwiftObject object = objectApi.get(name, toGetOptions.apply(options));
      if (object == null) {
         return null;
      }
      Blob blob = new BlobImpl(toBlobMetadata(container).apply(object));
      blob.setPayload(object.payload());
      blob.setAllHeaders(object.headers());
      return blob;
   }
View Full Code Here


         if (pollingStrategy.get().waitForSuccess(container, jobId)) {
            MutableBlobMetadata blobMetadata = new MutableBlobMetadataImpl();
            blobMetadata.setContainer(container);
            blobMetadata.setName(key);

            Blob blob = new BlobImpl(blobMetadata);
            blob.setPayload(sync.getJobOutput(container, jobId));
            return blob;
         }
         return null;
      } catch (InterruptedException e) {
         throw new RuntimeException(e);
View Full Code Here

      @Inject
      Provider<MutableBlobMetadata> metadataProvider;

      public Blob create(MutableBlobMetadata metadata) {
         return new BlobImpl(metadata != null ? metadata : metadataProvider.get());
      }
View Full Code Here

      MutableBlobMetadata metadata = new MutableBlobMetadataImpl();
      MutableContentMetadata contentMetadata = new BaseMutableContentMetadata();
      contentMetadata.setContentLength(MultipartUploadStrategy.MAX_BLOCK_SIZE * 3 + oneMB);
      metadata.setName(blobName);
      metadata.setContentMetadata(contentMetadata);
      Blob blob = new BlobImpl(metadata);
      Payload payload = new StringPayload("ABCD");
      payload.setContentMetadata(contentMetadata);
      blob.setPayload(payload);

      expect(slicer.slice(payload, 0, MultipartUploadStrategy.MAX_BLOCK_SIZE)).andReturn(payload);
      expect(slicer.slice(payload, MultipartUploadStrategy.MAX_BLOCK_SIZE, MultipartUploadStrategy.MAX_BLOCK_SIZE)).andReturn(payload);
      expect(slicer.slice(payload, MultipartUploadStrategy.MAX_BLOCK_SIZE * 2, MultipartUploadStrategy.MAX_BLOCK_SIZE)).andReturn(payload);
      expect(slicer.slice(payload, MultipartUploadStrategy.MAX_BLOCK_SIZE * 3, oneMB)).andReturn(payload);
View Full Code Here

      ObjectApi objectApi = api.getObjectApiForRegionAndContainer(regionId, container);
      SwiftObject object = objectApi.get(name, toGetOptions.apply(options));
      if (object == null) {
         return null;
      }
      Blob blob = new BlobImpl(toBlobMetadata(container).apply(object));
      blob.setPayload(object.getPayload());
      blob.setAllHeaders(object.getHeaders());
      return blob;
   }
View Full Code Here

      MutableBlobMetadata metadata = new MutableBlobMetadataImpl();
      MutableContentMetadata contentMetadata = new BaseMutableContentMetadata();
      contentMetadata.setContentLength(MultipartUploadStrategy.MAX_BLOCK_SIZE * 3 + oneMB);
      metadata.setName(blobName);
      metadata.setContentMetadata(contentMetadata);
      Blob blob = new BlobImpl(metadata);
      Payload payload = new StringPayload("ABCD");
      payload.setContentMetadata(contentMetadata);
      blob.setPayload(payload);

      expect(slicer.slice(payload, 0, MultipartUploadStrategy.MAX_BLOCK_SIZE)).andReturn(payload);
      expect(slicer.slice(payload, MultipartUploadStrategy.MAX_BLOCK_SIZE, MultipartUploadStrategy.MAX_BLOCK_SIZE)).andReturn(payload);
      expect(slicer.slice(payload, MultipartUploadStrategy.MAX_BLOCK_SIZE * 2, MultipartUploadStrategy.MAX_BLOCK_SIZE)).andReturn(payload);
      expect(slicer.slice(payload, MultipartUploadStrategy.MAX_BLOCK_SIZE * 3, oneMB)).andReturn(payload);
View Full Code Here

      ObjectApi objectApi = api.objectApiInRegionForContainer(region.getId(), container);
      SwiftObject object = objectApi.get(name, toGetOptions.apply(options));
      if (object == null) {
         return null;
      }
      Blob blob = new BlobImpl(toBlobMetadata(container).apply(object));
      blob.setPayload(object.getPayload());
      blob.setAllHeaders(object.getHeaders());
      return blob;
   }
View Full Code Here

      ObjectApi objectApi = api.getObjectApiForRegionAndContainer(regionId, container);
      SwiftObject object = objectApi.get(name, toGetOptions.apply(options));
      if (object == null) {
         return null;
      }
      Blob blob = new BlobImpl(toBlobMetadata(container).apply(object));
      blob.setPayload(object.getPayload());
      blob.setAllHeaders(object.getHeaders());
      return blob;
   }
View Full Code Here

      @Inject
      Provider<MutableBlobMetadata> metadataProvider;

      public Blob create(MutableBlobMetadata metadata) {
         return new BlobImpl(metadata != null ? metadata : metadataProvider.get());
      }
View Full Code Here

      @Inject
      Provider<MutableBlobMetadata> metadataProvider;

      public Blob create(MutableBlobMetadata metadata) {
         return new BlobImpl(metadata != null ? metadata : metadataProvider.get());
      }
View Full Code Here

TOP

Related Classes of org.jclouds.blobstore.domain.internal.BlobImpl

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.