@Test public void removeBackup_Failed_OnInvalidPath() throws IOException { Files.createDirectories(BACKUP_PATH); exceptionRule.expect(IBackupUploader.BackupException.class); exceptionRule.expectMessage("Error with removing backup file."); localBackupUploader.doRemoveBackup("some_file"); }
@Override public void doRemoveBackup(String uniqueFileName) throws BackupException { try { Files.delete(Paths.get(getUploadFilePath(), uniqueFileName)); } catch (IOException e) { throw new BackupException("Error with removing backup file.", e); } }
LocalBackupUploader extends AbstractBackupUploader { @Override public void doRemoveBackup(String uniqueFileName) throws BackupException { try { Files.delete(Paths.get(getUploadFilePath(), uniqueFileName)); } catch (IOException e) { throw new BackupException("Error with removing backup file.", e); } } }
LocalBackupUploader extends AbstractBackupUploader { @Override public void doRemoveBackup(String uniqueFileName) throws BackupException { try { Files.delete(Paths.get(getUploadFilePath(), uniqueFileName)); } catch (IOException e) { throw new BackupException("Error with removing backup file.", e); } } LocalBackupUploader(String uploadFilePath); }
LocalBackupUploader extends AbstractBackupUploader { @Override public void doRemoveBackup(String uniqueFileName) throws BackupException { try { Files.delete(Paths.get(getUploadFilePath(), uniqueFileName)); } catch (IOException e) { throw new BackupException("Error with removing backup file.", e); } } 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 doRemoveBackup(String uniqueFileName) throws BackupException { try { Files.delete(Paths.get(getUploadFilePath(), uniqueFileName)); } catch (IOException e) { throw new BackupException("Error with removing backup file.", e); } } LocalBackupUploader(String uploadFilePath); @Override void doWriteBackup(InputStream inputStream, String uniqueFileName); @Override InputStream doReadBackup(String uniqueFileName); @Override void doRemoveBackup(String uniqueFileName);  }