/** * Downloads a blob to a string using the platform's default encoding. * * @return A <code>String</code> which represents the blob's contents. * * @throws StorageException * If a storage service error occurred. * @throws IOException */ public String downloadText() throws StorageException, IOException { return this .downloadText(null /* charsetName */, null /* accessCondition */, null /* options */, null /* opContext */); }
/** * Downloads a blob to a string using the platform's default encoding. * * @return A <code>String</code> which represents the blob's contents. * * @throws StorageException * If a storage service error occurred. * @throws IOException */ public String downloadText() throws StorageException, IOException { return this .downloadText(null /* charsetName */, null /* accessCondition */, null /* options */, null /* opContext */); }
private AzureBlobLease downloadLease(CloudBlockBlob blob, BlobRequestOptions options) throws StorageException, IOException { String jsonLease = blob.downloadText(null, null, options, null); TRACE_LOGGER.debug(this.hostContext.withHost("Raw JSON downloaded: " + jsonLease)); AzureBlobLease rehydrated = this.gson.fromJson(jsonLease, AzureBlobLease.class); AzureBlobLease blobLease = new AzureBlobLease(rehydrated, blob, this.leaseOperationOptions); if (blobLease.getOffset() != null) { this.latestCheckpoint.put(blobLease.getPartitionId(), blobLease.getCheckpoint()); } return blobLease; }
exportedDevicesJson = retrievedBlob.downloadText();
private void doUploadDownloadStringTest(CloudBlockBlob blob, int length) throws StorageException, IOException { String stringToUse = this.getRandomUNCString(length); blob.uploadText(stringToUse, Constants.UTF8_CHARSET, null, null, null); String newString = blob.downloadText(Constants.UTF8_CHARSET, null, null, null); assertEquals("Strings are not equal", stringToUse, newString); stringToUse = this.getRandomUNCString(length); blob.uploadText(stringToUse, "UTF-16", null, null, null); newString = blob.downloadText("UTF-16", null, null, null); assertEquals("Strings are not equal", stringToUse, newString); stringToUse = this.getRandomUNCString(length); blob.uploadText(stringToUse, "UTF-16BE", null, null, null); newString = blob.downloadText("UTF-16BE", null, null, null); assertEquals("Strings are not equal", stringToUse, newString); stringToUse = this.getRandomUNCString(length); blob.uploadText(stringToUse, "UTF-16LE", null, null, null); newString = blob.downloadText("UTF-16LE", null, null, null); assertEquals("Strings are not equal", stringToUse, newString); stringToUse = this.getRandomASCIIString(length); blob.uploadText(stringToUse, "US-ASCII", null, null, null); newString = blob.downloadText("US-ASCII", null, null, null); assertEquals("Strings are not equal", stringToUse, newString); }
act.outputText(view, retrievedBlob.downloadText());
@Test public void testBlobAttributesEncryption() throws URISyntaxException, StorageException, IOException { this.blob.downloadAttributes(); assertTrue(this.blob.getProperties().isServerEncrypted()); CloudBlockBlob testBlob = this.container.getBlockBlobReference(this.blob.getName()); testBlob.downloadText(); assertTrue(testBlob.getProperties().isServerEncrypted()); }
assertTrue(destination.getProperties().getLastModified().compareTo(new Date(calendar.get(Calendar.MINUTE) - 1)) > 0); String copyData = destination.downloadText(Constants.UTF8_CHARSET, null, null, null); assertEquals(data, copyData);
assertTrue(copy.getCopyState().getCompletionTime().compareTo(new Date(calendar.get(Calendar.MINUTE) - 1)) > 0); String copyData = copy.downloadText(Constants.UTF8_CHARSET, null, null, null); assertEquals(data, copyData);
new Date(calendar.get(Calendar.MINUTE) - 6))); String copyData = destination.downloadText(Constants.UTF8_CHARSET, null, options, null); assertEquals(data, copyData);
source.uploadText(newData, Constants.UTF8_CHARSET, null, null, null); assertEquals(newData, source.downloadText(Constants.UTF8_CHARSET, null, null, null)); assertEquals(data, snapshot.downloadText(Constants.UTF8_CHARSET, null, null, null)); assertEquals(data, copy.downloadText(Constants.UTF8_CHARSET, null, null, null)); assertEquals(copyId, copy.getProperties().getCopyState().getCopyId());
String copyData = destination.downloadText(Constants.UTF8_CHARSET, null, null, null); assertEquals(data, copyData);