Add lock id to device, adding download of backups

This commit is contained in:
BWS Systems
2019-06-10 16:35:10 -05:00
parent a05b933e43
commit e86b700e93
8 changed files with 174 additions and 102 deletions

View File

@@ -92,4 +92,21 @@ public abstract class BackupHandler {
return theFilenames;
}
public String downloadBackup(String aFilename) {
Path filePath = FileSystems.getDefault().getPath(repositoryPath.getParent().toString(), aFilename);
String content = null;
if (Files.notExists(filePath) || !Files.isReadable(filePath)) {
log.warn("Error reading the file: {} - Does not exist or is not readable. continuing...", aFilename);
return null;
}
try {
content = new String(Files.readAllBytes(filePath));
} catch (IOException e) {
log.error("Error reading the file: {} message: {}", aFilename, e.getMessage(), e);
}
return content;
}
}