Updated generating adminToken in data folder (#598).
Change-Id: I73e045016d14d8b82921b382a8415c90d7063545
diff --git a/Changes b/Changes
index 17eb04a..45f26fe 100644
--- a/Changes
+++ b/Changes
@@ -8,6 +8,8 @@
- Changed loading external kustvakt.conf and jdbc.properties
to use /data folder (#598)
- Added KoralQuery check when updating VC (solved #676)
+- Setup vc-cache in the data folder (#598)
+- Changed generating adminToken in the data folder (#598).
# version 0.73
diff --git a/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java b/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
index 9ad1334..eb09557 100644
--- a/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
+++ b/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
@@ -27,7 +27,6 @@
import org.springframework.web.context.support.XmlWebApplicationContext;
import de.ids_mannheim.korap.config.KustvaktConfiguration;
-import de.ids_mannheim.korap.dao.AnnotationDao;
import de.ids_mannheim.korap.encryption.RandomCodeGenerator;
import de.ids_mannheim.korap.exceptions.KustvaktException;
import lombok.Getter;
@@ -114,11 +113,11 @@
}
String adminToken = "";
- File f = new File("adminToken");
+ File f = new File("data/adminToken");
if (!f.exists()) {
RandomCodeGenerator random = new RandomCodeGenerator();
adminToken = random.createRandomCode(config);
- FileOutputStream fos = new FileOutputStream(new File("adminToken"));
+ FileOutputStream fos = new FileOutputStream(f);
OutputStreamWriter writer = new OutputStreamWriter(fos,
StandardCharsets.UTF_8.name());
writer.append("token=");