Package com.microsoft.windowsazure.services.blob.models

Examples of com.microsoft.windowsazure.services.blob.models.GetBlobResult


        String blob = "createblobblocknullcontainerworks";
        String content = new String(new char[512]);
        service.createBlockBlob(container, blob, new ByteArrayInputStream(
                content.getBytes("UTF-8")));
        GetBlobPropertiesResult result = service.getBlobProperties(null, blob);
        GetBlobResult getBlobResult = service.getBlob(null, blob);

        // Assert
        assertNotNull(result);
        assertNotNull(result.getMetadata());
        assertEquals(0, result.getMetadata().size());
        BlobProperties props = result.getProperties();
        assertNotNull(props);

        assertEquals(content,
                inputStreamToString(getBlobResult.getContentStream(), "UTF-8"));
    }
View Full Code Here


                        .setCacheControl("test")
                        .setContentEncoding("UTF-8")
                        /* .setContentMD5("1234") */.setContentType(
                                "text/plain"));

        GetBlobResult result = service.getBlob(TEST_CONTAINER_FOR_BLOBS,
                "test2");

        // Assert
        assertNotNull(result);

        assertNotNull(result.getMetadata());
        assertEquals(0, result.getMetadata().size());

        BlobProperties props = result.getProperties();
        assertNotNull(props);
        assertEquals("test", props.getCacheControl());
        assertEquals("UTF-8", props.getContentEncoding());
        assertEquals("en-us", props.getContentLanguage());
        assertEquals("text/plain", props.getContentType());
        assertEquals(content.length(), props.getContentLength());
        assertNotNull(props.getEtag());
        assertNull(props.getContentMD5());
        assertNotNull(props.getLastModified());
        assertEquals("BlockBlob", props.getBlobType());
        assertEquals("unlocked", props.getLeaseStatus());
        assertEquals(0, props.getSequenceNumber());
        assertEquals(content,
                inputStreamToString(result.getContentStream(), "UTF-8"));
    }
View Full Code Here

        ClientResponse response = builder.get(ClientResponse.class);
        throwIfNotSuccess(response);

        GetBlobPropertiesResult properties = getBlobPropertiesResultFromResponse(response);
        GetBlobResult blobResult = new GetBlobResult();
        blobResult.setProperties(properties.getProperties());
        blobResult.setMetadata(properties.getMetadata());
        blobResult.setContentStream(response.getEntityInputStream());
        return blobResult;
    }
View Full Code Here

TOP

Related Classes of com.microsoft.windowsazure.services.blob.models.GetBlobResult

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.