@Test public void testFileListingEmpty() throws Exception { BasicFileStorage basicFileStorage = new BasicFileStorage(temporaryFolder.getRoot().getAbsolutePath()); Stream<String> storageIds = basicFileStorage.listStorageIdsByContainerName(CONTAINER); assertThat(IteratorUtils.toList(storageIds.iterator())) .isEmpty(); }
public Stream<String> listStorageIdsByContainerName(String containerName) throws IOException { Path containerPath = getContainerPath(basePath, containerName); if (!Files.exists(containerPath)) { return Stream.empty(); } return Files.list(containerPath) .map(path -> path.toFile().getName()); }
BasicFileStorage { public Stream<String> listStorageIdsByContainerName(String containerName) throws IOException { Path containerPath = getContainerPath(basePath, containerName); if (!Files.exists(containerPath)) { return Stream.empty(); } return Files.list(containerPath) .map(path -> path.toFile().getName()); } }
BasicFileStorage { public Stream<String> listStorageIdsByContainerName(String containerName) throws IOException { Path containerPath = getContainerPath(basePath, containerName); if (!Files.exists(containerPath)) { return Stream.empty(); } return Files.list(containerPath) .map(path -> path.toFile().getName()); } BasicFileStorage(String basePath); }
BasicFileStorage { public Stream<String> listStorageIdsByContainerName(String containerName) throws IOException { Path containerPath = getContainerPath(basePath, containerName); if (!Files.exists(containerPath)) { return Stream.empty(); } return Files.list(containerPath) .map(path -> path.toFile().getName()); } BasicFileStorage(String basePath); String writeFile(String containerName, String objectName, InputStream inputStream, long size); InputStream readFile(String containerName, String storageId); void deleteFile(String containerName, String storageId); Stream<String> listStorageIdsByContainerName(String containerName); }
BasicFileStorage { public Stream<String> listStorageIdsByContainerName(String containerName) throws IOException { Path containerPath = getContainerPath(basePath, containerName); if (!Files.exists(containerPath)) { return Stream.empty(); } return Files.list(containerPath) .map(path -> path.toFile().getName()); } BasicFileStorage(String basePath); String writeFile(String containerName, String objectName, InputStream inputStream, long size); InputStream readFile(String containerName, String storageId); void deleteFile(String containerName, String storageId); Stream<String> listStorageIdsByContainerName(String containerName);  }