@Test void CompressAndUploadFileToBlob_NullBlob_IllegalArgumentException() { assertThrows( IllegalArgumentException.class, () -> azureStorageClient.compressAndUploadFileToBlob(testFilePath, null)); }
void compressAndUploadFileToBlob(String filePath, CloudBlockBlob blob) throws IOException, StorageException { Ensure.fileExists(filePath); Ensure.argIsNotNull(blob, "blob"); InputStream fin = Files.newInputStream(Paths.get(filePath)); BlobOutputStream bos = blob.openOutputStream(); GZIPOutputStream gzout = new GZIPOutputStream(bos); copyStream(fin, gzout, GZIP_BUFFER_SIZE); gzout.close(); fin.close(); }
AzureStorageClient { void compressAndUploadFileToBlob(String filePath, CloudBlockBlob blob) throws IOException, StorageException { Ensure.fileExists(filePath); Ensure.argIsNotNull(blob, "blob"); InputStream fin = Files.newInputStream(Paths.get(filePath)); BlobOutputStream bos = blob.openOutputStream(); GZIPOutputStream gzout = new GZIPOutputStream(bos); copyStream(fin, gzout, GZIP_BUFFER_SIZE); gzout.close(); fin.close(); } }
AzureStorageClient { void compressAndUploadFileToBlob(String filePath, CloudBlockBlob blob) throws IOException, StorageException { Ensure.fileExists(filePath); Ensure.argIsNotNull(blob, "blob"); InputStream fin = Files.newInputStream(Paths.get(filePath)); BlobOutputStream bos = blob.openOutputStream(); GZIPOutputStream gzout = new GZIPOutputStream(bos); copyStream(fin, gzout, GZIP_BUFFER_SIZE); gzout.close(); fin.close(); }  }
AzureStorageClient { void compressAndUploadFileToBlob(String filePath, CloudBlockBlob blob) throws IOException, StorageException { Ensure.fileExists(filePath); Ensure.argIsNotNull(blob, "blob"); InputStream fin = Files.newInputStream(Paths.get(filePath)); BlobOutputStream bos = blob.openOutputStream(); GZIPOutputStream gzout = new GZIPOutputStream(bos); copyStream(fin, gzout, GZIP_BUFFER_SIZE); gzout.close(); fin.close(); }   }
AzureStorageClient { void compressAndUploadFileToBlob(String filePath, CloudBlockBlob blob) throws IOException, StorageException { Ensure.fileExists(filePath); Ensure.argIsNotNull(blob, "blob"); InputStream fin = Files.newInputStream(Paths.get(filePath)); BlobOutputStream bos = blob.openOutputStream(); GZIPOutputStream gzout = new GZIPOutputStream(bos); copyStream(fin, gzout, GZIP_BUFFER_SIZE); gzout.close(); fin.close(); }    }