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

Kai Reinhard
21.56.2018 0bdefbf053beb80736eff0a13fe8b90618c8d6dc
borgbutler-core/src/main/java/de/micromata/borgbutler/config/Configuration.java
@@ -17,26 +17,28 @@
     * Default dir name for restoring archives.
     */
    private static final String RESTORE_DIRNAME = "restore";
    @JsonIgnore
    private File workingDir;
    @Getter
    private String borgCommand = "borg";
    /**
     * Default is 100 MB (approximately).
     */
    @Getter
    @JsonProperty("max_archive_ontent_cache_capacity_mb")
    private int maxArchiveContentCacheCapacityMb = 100;
    /**
     * Default is restore inside BorgButler's home dir (~/.borgbutler/restore).
     */
    @Getter
    @JsonProperty("restore_dir")
    @JsonProperty("restoreDir")
    private String restoreDirPath;
    @JsonIgnore
    private File restoreHomeDir;
    @Getter
    @JsonProperty("repo-configs")
    private List<BorgRepoConfig> repoConfigs = new ArrayList<>();
    public void add(BorgRepoConfig repoConfig) {
@@ -60,7 +62,7 @@
            if (StringUtils.isNotBlank(restoreDirPath)) {
                restoreHomeDir = new File(restoreDirPath);
            } else {
                restoreHomeDir = new File(ConfigurationHandler.getInstance().getWorkingDir(), RESTORE_DIRNAME);
                restoreHomeDir = new File(workingDir, RESTORE_DIRNAME);
            }
            if (!restoreHomeDir.exists()) {
                log.info("Creating dir '" + restoreHomeDir.getAbsolutePath() + "' for restoring backup files and directories.");
@@ -68,4 +70,9 @@
        }
        return restoreHomeDir;
    }
    public void copyFrom(Configuration other) {
        this.borgCommand = other.borgCommand;
        this.maxArchiveContentCacheCapacityMb = other.maxArchiveContentCacheCapacityMb;
    }
}