@Test public void doWriteBackupWithBackupPathCreation() throws IOException { localBackupUploader.doWriteBackup(getInputStreamFromBytes(BYTE_SEQ_1), UNIQUE_FILE_NAME_1); assertThat(Files.exists(UNIQUE_FILE_PATH_1)).isTrue(); assertThat(Files.readAllBytes(UNIQUE_FILE_PATH_1)).isEqualTo(BYTE_SEQ_1); }
@Override public void doWriteBackup(InputStream inputStream, String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Files.createDirectories(Paths.get(getUploadFilePath())); Files.copy(inputStream, Paths.get(getUploadFilePath(), uniqueFileName), StandardCopyOption.REPLACE_EXISTING); } catch (IOException ex) { throw new BackupException("Error with writing backup file.", ex); } }
LocalBackupUploader extends AbstractBackupUploader { @Override public void doWriteBackup(InputStream inputStream, String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Files.createDirectories(Paths.get(getUploadFilePath())); Files.copy(inputStream, Paths.get(getUploadFilePath(), uniqueFileName), StandardCopyOption.REPLACE_EXISTING); } catch (IOException ex) { throw new BackupException("Error with writing backup file.", ex); } } }
LocalBackupUploader extends AbstractBackupUploader { @Override public void doWriteBackup(InputStream inputStream, String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Files.createDirectories(Paths.get(getUploadFilePath())); Files.copy(inputStream, Paths.get(getUploadFilePath(), uniqueFileName), StandardCopyOption.REPLACE_EXISTING); } catch (IOException ex) { throw new BackupException("Error with writing backup file.", ex); } } LocalBackupUploader(String uploadFilePath); }
LocalBackupUploader extends AbstractBackupUploader { @Override public void doWriteBackup(InputStream inputStream, String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Files.createDirectories(Paths.get(getUploadFilePath())); Files.copy(inputStream, Paths.get(getUploadFilePath(), uniqueFileName), StandardCopyOption.REPLACE_EXISTING); } catch (IOException ex) { throw new BackupException("Error with writing backup file.", ex); } } LocalBackupUploader(String uploadFilePath); @Override void doWriteBackup(InputStream inputStream, String uniqueFileName); @Override InputStream doReadBackup(String uniqueFileName); @Override void doRemoveBackup(String uniqueFileName); }
LocalBackupUploader extends AbstractBackupUploader { @Override public void doWriteBackup(InputStream inputStream, String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Files.createDirectories(Paths.get(getUploadFilePath())); Files.copy(inputStream, Paths.get(getUploadFilePath(), uniqueFileName), StandardCopyOption.REPLACE_EXISTING); } catch (IOException ex) { throw new BackupException("Error with writing backup file.", ex); } } LocalBackupUploader(String uploadFilePath); @Override void doWriteBackup(InputStream inputStream, String uniqueFileName); @Override InputStream doReadBackup(String uniqueFileName); @Override void doRemoveBackup(String uniqueFileName);  }