@Test void testStore() throws IOException { File file = fileStore.store(new ByteArrayInputStream(new byte[] {1, 2, 3}), "bytes.bin"); assertArrayEquals(new byte[] {1, 2, 3}, readFileToByteArray(file)); }
public File store(InputStream is, String fileName) throws IOException { validatePathname(fileName); File file = new File(storageDir + separator + fileName); try (FileOutputStream fos = new FileOutputStream(file)) { IOUtils.copy(is, fos); } return file; }
FileStore { public File store(InputStream is, String fileName) throws IOException { validatePathname(fileName); File file = new File(storageDir + separator + fileName); try (FileOutputStream fos = new FileOutputStream(file)) { IOUtils.copy(is, fos); } return file; } }
FileStore { public File store(InputStream is, String fileName) throws IOException { validatePathname(fileName); File file = new File(storageDir + separator + fileName); try (FileOutputStream fos = new FileOutputStream(file)) { IOUtils.copy(is, fos); } return file; } FileStore(String storageDir); }
FileStore { public File store(InputStream is, String fileName) throws IOException { validatePathname(fileName); File file = new File(storageDir + separator + fileName); try (FileOutputStream fos = new FileOutputStream(file)) { IOUtils.copy(is, fos); } return file; } FileStore(String storageDir); FileStore inSubdir(String subdir); boolean createDirectory(String dirName); void deleteDirectory(String dirName); File store(InputStream is, String fileName); void move(String sourceDir, String targetDir); File getFile(String fileName); File getFileUnchecked(String fileName); void delete(String fileName); String getStorageDir(); }
FileStore { public File store(InputStream is, String fileName) throws IOException { validatePathname(fileName); File file = new File(storageDir + separator + fileName); try (FileOutputStream fos = new FileOutputStream(file)) { IOUtils.copy(is, fos); } return file; } FileStore(String storageDir); FileStore inSubdir(String subdir); boolean createDirectory(String dirName); void deleteDirectory(String dirName); File store(InputStream is, String fileName); void move(String sourceDir, String targetDir); File getFile(String fileName); File getFileUnchecked(String fileName); void delete(String fileName); String getStorageDir();  }