@Test public void testDeleteFile() 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); basicFileStorage.deleteFile(CONTAINER, storageId); assertThatThrownBy( () -> basicFileStorage.readFile(CONTAINER, storageId) ).isInstanceOf(IOException.class); }
public void deleteFile(String containerName, String storageId) { Path filePath = getFilePath(containerName, storageId); FileUtils.deleteQuietly(filePath.toFile()); }
BasicFileStorage { public void deleteFile(String containerName, String storageId) { Path filePath = getFilePath(containerName, storageId); FileUtils.deleteQuietly(filePath.toFile()); } }
BasicFileStorage { public void deleteFile(String containerName, String storageId) { Path filePath = getFilePath(containerName, storageId); FileUtils.deleteQuietly(filePath.toFile()); } BasicFileStorage(String basePath); }
BasicFileStorage { public void deleteFile(String containerName, String storageId) { Path filePath = getFilePath(containerName, storageId); FileUtils.deleteQuietly(filePath.toFile()); } 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 void deleteFile(String containerName, String storageId) { Path filePath = getFilePath(containerName, storageId); FileUtils.deleteQuietly(filePath.toFile()); } 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);  }