@Test public void doReadBackup_Failed_OnEmptyUniqueFileName() throws IBackupUploader.BackupException { exceptionRule.expect(IBackupUploader.BackupException.class); exceptionRule.expectMessage("Invalid upload path, parameter - unique file name is blank."); gcpBackupUploader.doReadBackup( ""); }
@Override public InputStream doReadBackup(String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Blob blob = storage.get(BlobId.of(bucketName, getFullUploadObject(uniqueFileName))); ReadChannel channel = blob.reader(); return Channels.newInputStream(channel); } catch (Exception e) { throw new BackupException("Error with reading backup file: " + e.getMessage(), e); } }
GcpBackupUploader extends AbstractBackupUploader { @Override public InputStream doReadBackup(String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Blob blob = storage.get(BlobId.of(bucketName, getFullUploadObject(uniqueFileName))); ReadChannel channel = blob.reader(); return Channels.newInputStream(channel); } catch (Exception e) { throw new BackupException("Error with reading backup file: " + e.getMessage(), e); } } }
GcpBackupUploader extends AbstractBackupUploader { @Override public InputStream doReadBackup(String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Blob blob = storage.get(BlobId.of(bucketName, getFullUploadObject(uniqueFileName))); ReadChannel channel = blob.reader(); return Channels.newInputStream(channel); } catch (Exception e) { throw new BackupException("Error with reading backup file: " + e.getMessage(), e); } } GcpBackupUploader(String uploadFilePath, String gcpProjectId, Storage storage);  GcpBackupUploader(String uploadFilePath, String gcpProjectId, String oauthScopes); }
GcpBackupUploader extends AbstractBackupUploader { @Override public InputStream doReadBackup(String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Blob blob = storage.get(BlobId.of(bucketName, getFullUploadObject(uniqueFileName))); ReadChannel channel = blob.reader(); return Channels.newInputStream(channel); } catch (Exception e) { throw new BackupException("Error with reading backup file: " + e.getMessage(), e); } } GcpBackupUploader(String uploadFilePath, String gcpProjectId, Storage storage);  GcpBackupUploader(String uploadFilePath, String gcpProjectId, String oauthScopes); @Override void doWriteBackup(InputStream backupData, String uniqueFileName); @Override InputStream doReadBackup(String uniqueFileName); @Override void doRemoveBackup(String uniqueFileName); String getProjectId(); String getBucketName(); String getUploadFolder(); Credentials getCredential(String oauthScopes); }
GcpBackupUploader extends AbstractBackupUploader { @Override public InputStream doReadBackup(String uniqueFileName) throws BackupException { try { validatePathParameter(uniqueFileName, "unique file name"); Blob blob = storage.get(BlobId.of(bucketName, getFullUploadObject(uniqueFileName))); ReadChannel channel = blob.reader(); return Channels.newInputStream(channel); } catch (Exception e) { throw new BackupException("Error with reading backup file: " + e.getMessage(), e); } } GcpBackupUploader(String uploadFilePath, String gcpProjectId, Storage storage);  GcpBackupUploader(String uploadFilePath, String gcpProjectId, String oauthScopes); @Override void doWriteBackup(InputStream backupData, String uniqueFileName); @Override InputStream doReadBackup(String uniqueFileName); @Override void doRemoveBackup(String uniqueFileName); String getProjectId(); String getBucketName(); String getUploadFolder(); Credentials getCredential(String oauthScopes);  }