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

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

Best Java code snippets using org.jclouds.azureblob.domain.ListBlobBlocksResponse (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.domainListBlobBlocksResponse

Javadoc

Typed response from Get Blob Block List operation

Most used methods

  • getBlocks

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • findViewById (Activity)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • JPanel (javax.swing)
  • Runner (org.openjdk.jmh.runner)
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