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

...
Kai Reinhard
14.56.2018 19732b785f222871a76f931213587b2c04cc1e10
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package de.micromata.borgbutler.config;
 
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
 
import java.util.ArrayList;
import java.util.List;
 
public class Configuration {
    @Getter
    private String borgCommand = "borg";
    /**
     * Default is 100 MB (approximately).
     */
    @Getter
    @JsonProperty("cache_archive_content_max_disc_size_mb")
    private int cacheArchiveContentMaxDiscSizeMB = 100;
 
    @Getter
    @JsonProperty("repo-configs")
    private List<BorgRepoConfig> repoConfigs = new ArrayList<>();
 
    public void add(BorgRepoConfig repoConfig) {
        repoConfigs.add(repoConfig);
    }
 
    public BorgRepoConfig getRepoConfig(String name) {
        if (name == null) {
            return null;
        }
        for (BorgRepoConfig repoConfig : repoConfigs) {
            if (name.equals(repoConfig.getRepo())) {
                return repoConfig;
            }
        }
        return null;
    }
}