| | |
| | | return repository; |
| | | } |
| | | |
| | | private BorgRepoConfig getBorgRepoConfig(String name) { |
| | | for (BorgRepoConfig repoConfig : ConfigurationHandler.getConfiguration().getRepoConfigs()) { |
| | | if (StringUtils.equals(repoConfig.getRepo(), name)) |
| | | return repoConfig; |
| | | } |
| | | log.error("Repo config with name '" + name + "' not found."); |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * @return the list of all repositories without the list of archives. |
| | | */ |
| | |
| | | } |
| | | |
| | | public void clearAllCaches() { |
| | | this.repoCacheAccess.clear(); |
| | | log.info("Clearing repositories cache (with included archives)..."); |
| | | this.repoArchivesCacheAccess.clear(); |
| | | clearRepoCacheAccess(); |
| | | clearRepoArchicesCacheAccess(); |
| | | log.info("Clearing cache with file lists of archives..."); |
| | | this.archiveFilelistCache.removeAllCacheFiles(); |
| | | } |
| | |
| | | this.repoCacheAccess.clear(); |
| | | } |
| | | |
| | | public void clearRepoArchicesCacheAccess() { |
| | | log.info("Clearing repositories cache (with included archives)..."); |
| | | this.repoArchivesCacheAccess.clear(); |
| | | } |
| | | |
| | | /** |
| | | * @param idOrName |
| | | * @return The repository including all archives. |
| | |
| | | if (repository != null) { |
| | | return repository; |
| | | } |
| | | repository = BorgCommands.list(getBorgRepoConfig(masterRepository.getName()), masterRepository); |
| | | BorgRepoConfig repoConfig = ConfigurationHandler.getConfiguration().getRepoConfig(masterRepository.getName()); |
| | | repository = BorgCommands.list(repoConfig, masterRepository); |
| | | if (repository == null) return null; |
| | | repoArchivesCacheAccess.put(repository.getName(), repository); |
| | | return repository; |
| | | } |