@Test public void doReadBackup_Failed_OnInvalidPath() throws IOException { Files.createDirectories(BACKUP_PATH); exceptionRule.expect(IBackupUploader.BackupException.class); exceptionRule.expectMessage( "Error with reading backup file"); localBackupUploader.doReadBackup("no_file"); }
@Override public InputStream doReadBackup(String uniqueFileName) throws BackupException { try { return Files.newInputStream(Paths.get(getUploadFilePath(), uniqueFileName)); } catch (IOException ex) { throw new BackupException("Error with reading backup file : " + ex.getMessage(), ex); } }
LocalBackupUploader extends AbstractBackupUploader { @Override public InputStream doReadBackup(String uniqueFileName) throws BackupException { try { return Files.newInputStream(Paths.get(getUploadFilePath(), uniqueFileName)); } catch (IOException ex) { throw new BackupException("Error with reading backup file : " + ex.getMessage(), ex); } } }
LocalBackupUploader extends AbstractBackupUploader { @Override public InputStream doReadBackup(String uniqueFileName) throws BackupException { try { return Files.newInputStream(Paths.get(getUploadFilePath(), uniqueFileName)); } catch (IOException ex) { throw new BackupException("Error with reading backup file : " + ex.getMessage(), ex); } } LocalBackupUploader(String uploadFilePath); }
LocalBackupUploader extends AbstractBackupUploader { @Override public InputStream doReadBackup(String uniqueFileName) throws BackupException { try { return Files.newInputStream(Paths.get(getUploadFilePath(), uniqueFileName)); } catch (IOException ex) { throw new BackupException("Error with reading backup file : " + ex.getMessage(), 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 InputStream doReadBackup(String uniqueFileName) throws BackupException { try { return Files.newInputStream(Paths.get(getUploadFilePath(), uniqueFileName)); } catch (IOException ex) { throw new BackupException("Error with reading backup file : " + ex.getMessage(), ex); } } LocalBackupUploader(String uploadFilePath); @Override void doWriteBackup(InputStream inputStream, String uniqueFileName); @Override InputStream doReadBackup(String uniqueFileName); @Override void doRemoveBackup(String uniqueFileName);  }