mirror of https://github.com/micromata/borgbackup-butler.git

...
Kai Reinhard
09.02.2018 0a7181d0d1f040a3aff9f41256171a7b1b7ba3da
borgbutler-core/src/main/java/de/micromata/borgbutler/BorgCommands.java
@@ -4,7 +4,6 @@
import de.micromata.borgbutler.config.Configuration;
import de.micromata.borgbutler.config.ConfigurationHandler;
import de.micromata.borgbutler.json.JsonUtils;
import de.micromata.borgbutler.json.borg.Archive1;
import de.micromata.borgbutler.json.borg.ArchiveList;
import de.micromata.borgbutler.json.borg.RepoInfo;
import de.micromata.borgbutler.json.borg.RepoList;
@@ -45,8 +44,8 @@
     * @param archive
     * @return
     */
    public static ArchiveList info(BorgRepoConfig repoConfig, Archive1 archive) {
        String json = execute(repoConfig, "info", repoConfig.getRepo() + "::" + archive.getArchive(), "--json");
    public static ArchiveList info(BorgRepoConfig repoConfig, String archive) {
        String json = execute(repoConfig, "info", repoConfig.getRepo() + "::" + archive, "--json");
        if (json == null) {
            return null;
        }
@@ -65,6 +64,17 @@
        return repoList;
    }
    public static String list(BorgRepoConfig repoConfig, String archive) {
        String json = execute(repoConfig, "list", repoConfig.getRepo() + "::" + archive,
                "--json-lines");
        if (json == null) {
            return null;
        }
       // RepoList repoList = JsonUtils.fromJson(RepoList.class, json);
       // repoList.setOriginalJson(json);
        return json;
    }
    private static String execute(BorgRepoConfig repoConfig, String command, String repoOrArchive, String... args) {
        CommandLine cmdLine = new CommandLine(ConfigurationHandler.getConfiguration().getBorgCommand());
        cmdLine.addArgument(command);