From 0a7181d0d1f040a3aff9f41256171a7b1b7ba3da Mon Sep 17 00:00:00 2001
From: Kai Reinhard <K.Reinhard@micromata.de>
Date: Sat, 08 Dec 2018 23:02:28 +0000
Subject: [PATCH] ...
---
borgbutler-core/src/main/java/de/micromata/borgbutler/cache/ButlerCache.java | 19 +++++++------------
1 files changed, 7 insertions(+), 12 deletions(-)
diff --git a/borgbutler-core/src/main/java/de/micromata/borgbutler/cache/ButlerCache.java b/borgbutler-core/src/main/java/de/micromata/borgbutler/cache/ButlerCache.java
index 8664817..f9e9789 100644
--- a/borgbutler-core/src/main/java/de/micromata/borgbutler/cache/ButlerCache.java
+++ b/borgbutler-core/src/main/java/de/micromata/borgbutler/cache/ButlerCache.java
@@ -1,6 +1,7 @@
package de.micromata.borgbutler.cache;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -13,8 +14,11 @@
public static final String CACHE_DIR_NAME = ".borgbutler";
private static ButlerCache instance = new ButlerCache();
+ @Getter
private RepoInfoCache repoInfoCache;
+ @Getter
private RepoListCache repoListCache;
+ private ArchiveListCache archiveListCache;
private List<AbstractCache> caches;
@JsonIgnore
@@ -24,14 +28,6 @@
return instance;
}
- public static RepoInfoCache getRepoInfoCache() {
- return instance.repoInfoCache;
- }
-
- public static RepoListCache getRepoListCache() {
- return instance.repoListCache;
- }
-
public void read() {
for (AbstractCache cache : caches) {
cache.read();
@@ -67,10 +63,9 @@
log.info("Creating cache dir: " + cacheDir.getAbsolutePath());
cacheDir.mkdir();
}
- repoInfoCache = new RepoInfoCache(cacheDir);
- repoListCache = new RepoListCache(cacheDir);
caches = new ArrayList<>();
- caches.add(repoInfoCache);
- caches.add(repoListCache);
+ caches.add(repoInfoCache = new RepoInfoCache(cacheDir));
+ caches.add(repoListCache = new RepoListCache(cacheDir));
+ caches.add(archiveListCache = new ArchiveListCache(cacheDir));
}
}
--
Gitblit v1.10.0