@Test(expected = IllegalArgumentException.class) public void listBlobsThrows() throws Exception { StorageServiceImpl.listBlobs(invalidStorageInputs); }
@NotNull public static String listBlobs(@NotNull final StorageInputs inputs) throws Exception { final CloudBlobClient blobClient = getCloudBlobClient(inputs); final CloudBlobContainer container = blobClient.getContainerReference(inputs.getContainerName()); final List<String> blobList = new ArrayList<>(); for (final ListBlobItem blobItem : container.listBlobs()) { final String path = blobItem.getUri().getPath(); blobList.add(path.substring(path.lastIndexOf(FORWARD_SLASH) + 1)); } return StringUtilities.join(blobList, COMMA); }
StorageServiceImpl { @NotNull public static String listBlobs(@NotNull final StorageInputs inputs) throws Exception { final CloudBlobClient blobClient = getCloudBlobClient(inputs); final CloudBlobContainer container = blobClient.getContainerReference(inputs.getContainerName()); final List<String> blobList = new ArrayList<>(); for (final ListBlobItem blobItem : container.listBlobs()) { final String path = blobItem.getUri().getPath(); blobList.add(path.substring(path.lastIndexOf(FORWARD_SLASH) + 1)); } return StringUtilities.join(blobList, COMMA); } }
StorageServiceImpl { @NotNull public static String listBlobs(@NotNull final StorageInputs inputs) throws Exception { final CloudBlobClient blobClient = getCloudBlobClient(inputs); final CloudBlobContainer container = blobClient.getContainerReference(inputs.getContainerName()); final List<String> blobList = new ArrayList<>(); for (final ListBlobItem blobItem : container.listBlobs()) { final String path = blobItem.getUri().getPath(); blobList.add(path.substring(path.lastIndexOf(FORWARD_SLASH) + 1)); } return StringUtilities.join(blobList, COMMA); }  }
StorageServiceImpl { @NotNull public static String listBlobs(@NotNull final StorageInputs inputs) throws Exception { final CloudBlobClient blobClient = getCloudBlobClient(inputs); final CloudBlobContainer container = blobClient.getContainerReference(inputs.getContainerName()); final List<String> blobList = new ArrayList<>(); for (final ListBlobItem blobItem : container.listBlobs()) { final String path = blobItem.getUri().getPath(); blobList.add(path.substring(path.lastIndexOf(FORWARD_SLASH) + 1)); } return StringUtilities.join(blobList, COMMA); }  @NotNull static String createContainer(@NotNull final StorageInputs inputs); @NotNull static String listContainers(@NotNull final StorageInputs inputs); @NotNull static String deleteContainer(@NotNull final StorageInputs inputs); @NotNull static String listBlobs(@NotNull final StorageInputs inputs); @NotNull static String deleteBlob(@NotNull final StorageInputs inputs); @NotNull static CloudBlobClient getCloudBlobClient(@NotNull final StorageInputs inputs); }
StorageServiceImpl { @NotNull public static String listBlobs(@NotNull final StorageInputs inputs) throws Exception { final CloudBlobClient blobClient = getCloudBlobClient(inputs); final CloudBlobContainer container = blobClient.getContainerReference(inputs.getContainerName()); final List<String> blobList = new ArrayList<>(); for (final ListBlobItem blobItem : container.listBlobs()) { final String path = blobItem.getUri().getPath(); blobList.add(path.substring(path.lastIndexOf(FORWARD_SLASH) + 1)); } return StringUtilities.join(blobList, COMMA); }  @NotNull static String createContainer(@NotNull final StorageInputs inputs); @NotNull static String listContainers(@NotNull final StorageInputs inputs); @NotNull static String deleteContainer(@NotNull final StorageInputs inputs); @NotNull static String listBlobs(@NotNull final StorageInputs inputs); @NotNull static String deleteBlob(@NotNull final StorageInputs inputs); @NotNull static CloudBlobClient getCloudBlobClient(@NotNull final StorageInputs inputs);  }