@Test public void testReadFile() throws Exception { BasicFileStorage basicFileStorage = new BasicFileStorage(temporaryFolder.getRoot().getAbsolutePath()); byte[] data = "data".getBytes(); String storageId = basicFileStorage.writeFile(CONTAINER, OBJ_1, new ByteArrayInputStream(data), data.length); try (InputStream inputStream = basicFileStorage.readFile(CONTAINER, storageId)) { assertThat(inputStream).hasSameContentAs(new ByteArrayInputStream(data)); } }
public InputStream readFile(String containerName, String storageId) throws IOException { Path filePath = getFilePath(containerName, storageId); return Files.newInputStream(filePath, StandardOpenOption.READ); }
BasicFileStorage { public InputStream readFile(String containerName, String storageId) throws IOException { Path filePath = getFilePath(containerName, storageId); return Files.newInputStream(filePath, StandardOpenOption.READ); } }
BasicFileStorage { public InputStream readFile(String containerName, String storageId) throws IOException { Path filePath = getFilePath(containerName, storageId); return Files.newInputStream(filePath, StandardOpenOption.READ); } BasicFileStorage(String basePath); }
BasicFileStorage { public InputStream readFile(String containerName, String storageId) throws IOException { Path filePath = getFilePath(containerName, storageId); return Files.newInputStream(filePath, StandardOpenOption.READ); } 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 InputStream readFile(String containerName, String storageId) throws IOException { Path filePath = getFilePath(containerName, storageId); return Files.newInputStream(filePath, StandardOpenOption.READ); } 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);  }