| | |
| | | for (BorgRepoConfig repo : demoRepos) { |
| | | if (!repositoryList.contains(repo)) |
| | | repositoryList.add(repo); |
| | | } |
| | | // Remove duplicate entries (produced by former versions of BorgButler: |
| | | Set<String> set = new HashSet<>(); |
| | | Iterator<BorgRepoConfig> it = repositoryList.iterator(); |
| | | try { |
| | | while (it.hasNext()) { |
| | | BorgRepoConfig repoConfig = it.next(); |
| | | if (!StringUtils.startsWith(repoConfig.getRepo(), DEMO_IDENTIFIER)) { |
| | | continue; |
| | | } |
| | | if (set.contains(repoConfig.getRepo())) { |
| | | it.remove(); |
| | | } else { |
| | | set.add(repoConfig.getRepo()); |
| | | } |
| | | } |
| | | } catch (Exception ex) { |
| | | // ConcurrentException, ignore it, it's only for demo purposes. |
| | | } |
| | | } |
| | | |