Codota Logo
ListBlobBlocksResponse.getBlocks
Code IndexAdd Codota to your IDE (free)

How to use
getBlocks
method
in
org.jclouds.azureblob.domain.ListBlobBlocksResponse

Best Java code snippets using org.jclouds.azureblob.domain.ListBlobBlocksResponse.getBlocks (Showing top 3 results out of 315)

  • Common ways to obtain ListBlobBlocksResponse
private void myMethod () {
ListBlobBlocksResponse l =
  • Codota IconList blocks;new ListBlobBlocksResponseImpl(blocks)
  • Codota IconAzureBlobClient azureBlobClient;String container;String name;azureBlobClient.getBlockList(container, name)
  • Smart code suggestions by Codota
}
origin: Nextdoor/bender

@Override
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu) {
 ListBlobBlocksResponse response;
 try {
   response = sync.getBlockList(mpu.containerName(), mpu.blobName());
 } catch (KeyNotFoundException knfe) {
   return ImmutableList.<MultipartPart>of();
 }
 ImmutableList.Builder<MultipartPart> parts = ImmutableList.builder();
 for (BlobBlockProperties properties : response.getBlocks()) {
   int partNumber = Ints.fromByteArray(BaseEncoding.base64().decode(properties.getBlockName()));
   String eTag = "";  // getBlockList does not return ETag
   Date lastModified = null;  // getBlockList does not return LastModified
   parts.add(MultipartPart.create(partNumber, properties.getContentLength(), eTag, lastModified));
 }
 return parts.build();
}
origin: apache/jclouds

@Override
public List<MultipartPart> listMultipartUpload(MultipartUpload mpu) {
 ListBlobBlocksResponse response;
 try {
   response = sync.getBlockList(mpu.containerName(), mpu.blobName());
 } catch (KeyNotFoundException knfe) {
   return ImmutableList.<MultipartPart>of();
 }
 ImmutableList.Builder<MultipartPart> parts = ImmutableList.builder();
 for (BlobBlockProperties properties : response.getBlocks()) {
   int partNumber = Ints.fromByteArray(BaseEncoding.base64().decode(properties.getBlockName()));
   String eTag = "";  // getBlockList does not return ETag
   Date lastModified = null;  // getBlockList does not return LastModified
   parts.add(MultipartPart.create(partNumber, properties.getContentLength(), eTag, lastModified));
 }
 return parts.build();
}
origin: apache/jclouds

@Test(timeOut = 5 * 60 * 1000)
public void testBlockOperations() throws Exception {
 String blockContainer = CONTAINER_PREFIX + containerIndex.incrementAndGet();
 String blockBlob = "myblockblob-" + new SecureRandom().nextInt();
 String A = "A";
 String B = "B";
 String C = "C";
 String blockIdA = BaseEncoding.base64().encode((blockBlob + "-" + A).getBytes());
 String blockIdB = BaseEncoding.base64().encode((blockBlob + "-" + B).getBytes());
 String blockIdC = BaseEncoding.base64().encode((blockBlob + "-" + C).getBytes());
 getApi().createContainer(blockContainer);
 getApi().putBlock(blockContainer, blockBlob, blockIdA, Payloads.newByteArrayPayload(A.getBytes()));
 getApi().putBlock(blockContainer, blockBlob, blockIdB, Payloads.newByteArrayPayload(B.getBytes()));
 getApi().putBlock(blockContainer, blockBlob, blockIdC, Payloads.newByteArrayPayload(C.getBytes()));
 ListBlobsResponse blobs = getApi().listBlobs(blockContainer);
 assertThat(blobs).isEmpty();
 blobs = getApi().listBlobs(blockContainer, new ListBlobsOptions().include(EnumSet.allOf(ListBlobsInclude.class)));
 assertThat(blobs).hasSize(1);
 getApi().putBlockList(blockContainer, blockBlob, Arrays.asList(blockIdA, blockIdB, blockIdC));
 ListBlobBlocksResponse blocks = getApi().getBlockList(blockContainer, blockBlob);
 assertEquals(3, blocks.getBlocks().size());
 assertEquals(blockIdA, blocks.getBlocks().get(0).getBlockName());
 assertEquals(blockIdB, blocks.getBlocks().get(1).getBlockName());
 assertEquals(blockIdC, blocks.getBlocks().get(2).getBlockName());
 assertEquals(1, blocks.getBlocks().get(0).getContentLength());
 assertEquals(1, blocks.getBlocks().get(1).getContentLength());
 assertEquals(1, blocks.getBlocks().get(2).getContentLength());
 getApi().deleteContainer(blockContainer);
}
org.jclouds.azureblob.domainListBlobBlocksResponsegetBlocks

Popular methods of ListBlobBlocksResponse

    Popular in Java

    • Start an intent from android
    • setContentView (Activity)
    • getResourceAsStream (ClassLoader)
      Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
    • setScale (BigDecimal)
      Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
    • VirtualMachine (com.sun.tools.attach)
      A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
    • RandomAccessFile (java.io)
      Allows reading from and writing to a file in a random-access manner. This is different from the uni-
    • String (java.lang)
    • URL (java.net)
      A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
    • URLEncoder (java.net)
      This class is used to encode a string using the format required by application/x-www-form-urlencoded
    • BitSet (java.util)
      This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Codota for your IDE now