| | |
| | | private static Logger log = LoggerFactory.getLogger(BorgCommands.class); |
| | | |
| | | /** |
| | | * Executes borg --version |
| | | * |
| | | * @return version string. |
| | | */ |
| | | public static String version() { |
| | | BorgCommand command = new BorgCommand() |
| | | .setParams("--version") |
| | | .setDescription("Getting borg version."); |
| | | execute(command); |
| | | if (command.getResultStatus() != BorgCommand.ResultStatus.OK) { |
| | | return null; |
| | | } |
| | | String version = command.getResponse(); |
| | | log.info("Borg version: " + version); |
| | | return version; |
| | | } |
| | | |
| | | /** |
| | | * Executes borg info repository. |
| | | * |
| | | * @param repoConfig |
| | |
| | | |
| | | private static void execute(BorgCommand command) { |
| | | Validate.notNull(command); |
| | | Validate.notNull(command.getRepoConfig()); |
| | | BorgExecutorQueue.getQueue(command.getRepoConfig()).execute(command); |
| | | } |
| | | } |