@Test void UploadStreamToBlob_NullInputStream_IllegalArgumentException() { assertThrows( IllegalArgumentException.class, () -> azureStorageClient.uploadStreamToBlob(null, "blobName", "storageUri", false)); }
CloudBlockBlob uploadStreamToBlob(InputStream inputStream, String blobName, String storageUri, boolean shouldCompress) throws IOException, URISyntaxException, StorageException { log.debug("uploadStreamToBlob: blobName: {}, storageUri: {}", blobName, storageUri); Ensure.argIsNotNull(inputStream, "inputStream"); Ensure.stringIsNotBlank(blobName, "blobName"); Ensure.stringIsNotBlank(storageUri, "storageUri"); CloudBlobContainer container = new CloudBlobContainer(new URI(storageUri)); CloudBlockBlob blob = container.getBlockBlobReference(blobName); if (shouldCompress) { compressAndUploadStream(inputStream, blob); } else { uploadStream(inputStream, blob); } return blob; }
AzureStorageClient { CloudBlockBlob uploadStreamToBlob(InputStream inputStream, String blobName, String storageUri, boolean shouldCompress) throws IOException, URISyntaxException, StorageException { log.debug("uploadStreamToBlob: blobName: {}, storageUri: {}", blobName, storageUri); Ensure.argIsNotNull(inputStream, "inputStream"); Ensure.stringIsNotBlank(blobName, "blobName"); Ensure.stringIsNotBlank(storageUri, "storageUri"); CloudBlobContainer container = new CloudBlobContainer(new URI(storageUri)); CloudBlockBlob blob = container.getBlockBlobReference(blobName); if (shouldCompress) { compressAndUploadStream(inputStream, blob); } else { uploadStream(inputStream, blob); } return blob; } }
AzureStorageClient { CloudBlockBlob uploadStreamToBlob(InputStream inputStream, String blobName, String storageUri, boolean shouldCompress) throws IOException, URISyntaxException, StorageException { log.debug("uploadStreamToBlob: blobName: {}, storageUri: {}", blobName, storageUri); Ensure.argIsNotNull(inputStream, "inputStream"); Ensure.stringIsNotBlank(blobName, "blobName"); Ensure.stringIsNotBlank(storageUri, "storageUri"); CloudBlobContainer container = new CloudBlobContainer(new URI(storageUri)); CloudBlockBlob blob = container.getBlockBlobReference(blobName); if (shouldCompress) { compressAndUploadStream(inputStream, blob); } else { uploadStream(inputStream, blob); } return blob; }  }
AzureStorageClient { CloudBlockBlob uploadStreamToBlob(InputStream inputStream, String blobName, String storageUri, boolean shouldCompress) throws IOException, URISyntaxException, StorageException { log.debug("uploadStreamToBlob: blobName: {}, storageUri: {}", blobName, storageUri); Ensure.argIsNotNull(inputStream, "inputStream"); Ensure.stringIsNotBlank(blobName, "blobName"); Ensure.stringIsNotBlank(storageUri, "storageUri"); CloudBlobContainer container = new CloudBlobContainer(new URI(storageUri)); CloudBlockBlob blob = container.getBlockBlobReference(blobName); if (shouldCompress) { compressAndUploadStream(inputStream, blob); } else { uploadStream(inputStream, blob); } return blob; }   }
AzureStorageClient { CloudBlockBlob uploadStreamToBlob(InputStream inputStream, String blobName, String storageUri, boolean shouldCompress) throws IOException, URISyntaxException, StorageException { log.debug("uploadStreamToBlob: blobName: {}, storageUri: {}", blobName, storageUri); Ensure.argIsNotNull(inputStream, "inputStream"); Ensure.stringIsNotBlank(blobName, "blobName"); Ensure.stringIsNotBlank(storageUri, "storageUri"); CloudBlobContainer container = new CloudBlobContainer(new URI(storageUri)); CloudBlockBlob blob = container.getBlockBlobReference(blobName); if (shouldCompress) { compressAndUploadStream(inputStream, blob); } else { uploadStream(inputStream, blob); } return blob; }    }