| | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import de.micromata.borgbutler.demo.DemoRepos; |
| | | import lombok.AccessLevel; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | |
| | | @Getter |
| | | private int maxArchiveContentCacheCapacityMb = 100; |
| | | |
| | | @Getter |
| | | @Setter |
| | | private boolean showDemoRepos = true; |
| | | |
| | | /** |
| | | * Default is restore inside BorgButler's home dir (~/.borgbutler/restore). |
| | | */ |
| | |
| | | @JsonIgnore |
| | | private File restoreHomeDir; |
| | | |
| | | @Getter |
| | | private List<BorgRepoConfig> repoConfigs = new ArrayList<>(); |
| | | |
| | | public void add(BorgRepoConfig repoConfig) { |
| | |
| | | if (idOrName == null) { |
| | | return null; |
| | | } |
| | | for (BorgRepoConfig repoConfig : repoConfigs) { |
| | | for (BorgRepoConfig repoConfig : getRepoConfigs()) { |
| | | if (StringUtils.equals(idOrName, repoConfig.getRepo()) || StringUtils.equals(idOrName, repoConfig.getId())) { |
| | | return repoConfig; |
| | | } |
| | |
| | | public void copyFrom(Configuration other) { |
| | | this.borgCommand = other.borgCommand; |
| | | this.maxArchiveContentCacheCapacityMb = other.maxArchiveContentCacheCapacityMb; |
| | | this.showDemoRepos = other.showDemoRepos; |
| | | } |
| | | |
| | | public List<BorgRepoConfig> getRepoConfigs() { |
| | | if (!ConfigurationHandler.getConfiguration().isShowDemoRepos()) { |
| | | return repoConfigs; |
| | | } |
| | | List<BorgRepoConfig> result = new ArrayList<>(); |
| | | result.addAll(repoConfigs); |
| | | DemoRepos.addDemoRepos(result); |
| | | return result; |
| | | } |
| | | |
| | | List<BorgRepoConfig> _getRepoConfigs() { |
| | | return repoConfigs; |
| | | } |
| | | } |