[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [metrics-web/master] Fix a regression in the legacy module.
commit 96f5fbe520e052ac62f2f99c2bbce7e92e03ac0f
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Thu Jun 29 21:30:42 2017 +0200
Fix a regression in the legacy module.
---
.../main/java/org/torproject/ernie/cron/Configuration.java | 12 ++++++------
.../ernie/cron/RelayDescriptorDatabaseImporter.java | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/modules/legacy/src/main/java/org/torproject/ernie/cron/Configuration.java b/modules/legacy/src/main/java/org/torproject/ernie/cron/Configuration.java
index e0d753f..12409cd 100644
--- a/modules/legacy/src/main/java/org/torproject/ernie/cron/Configuration.java
+++ b/modules/legacy/src/main/java/org/torproject/ernie/cron/Configuration.java
@@ -23,7 +23,7 @@ public class Configuration {
private boolean importDirectoryArchives = false;
- private List<String> directoryArchivesDirectories = new ArrayList<>();
+ private List<File> directoryArchivesDirectories = new ArrayList<>();
private boolean keepDirectoryArchiveImportHistory = false;
@@ -75,7 +75,7 @@ public class Configuration {
this.importDirectoryArchives = Integer.parseInt(
line.split(" ")[1]) != 0;
} else if (line.startsWith("DirectoryArchivesDirectory")) {
- this.directoryArchivesDirectories.add(line.split(" ")[1]);
+ this.directoryArchivesDirectories.add(new File(line.split(" ")[1]));
} else if (line.startsWith("KeepDirectoryArchiveImportHistory")) {
this.keepDirectoryArchiveImportHistory = Integer.parseInt(
line.split(" ")[1]) != 0;
@@ -140,12 +140,12 @@ public class Configuration {
}
/** Returns directories containing archived descriptors. */
- public List<String> getDirectoryArchivesDirectories() {
+ public List<File> getDirectoryArchivesDirectories() {
if (this.directoryArchivesDirectories.isEmpty()) {
String prefix = "../../shared/in/recent/relay-descriptors/";
- return Arrays.asList(
- (prefix + "consensuses/," + prefix + "server-descriptors/,"
- + prefix + "extra-infos/").split(","));
+ return Arrays.asList(new File(prefix + "consensuses/"),
+ new File(prefix + "server-descriptors/"),
+ new File(prefix + "extra-infos/"));
} else {
return this.directoryArchivesDirectories;
}
diff --git a/modules/legacy/src/main/java/org/torproject/ernie/cron/RelayDescriptorDatabaseImporter.java b/modules/legacy/src/main/java/org/torproject/ernie/cron/RelayDescriptorDatabaseImporter.java
index 82fb70f..0e69389 100644
--- a/modules/legacy/src/main/java/org/torproject/ernie/cron/RelayDescriptorDatabaseImporter.java
+++ b/modules/legacy/src/main/java/org/torproject/ernie/cron/RelayDescriptorDatabaseImporter.java
@@ -181,7 +181,7 @@ public final class RelayDescriptorDatabaseImporter {
private boolean writeRawImportFiles;
- private List<String> archivesDirectories;
+ private List<File> archivesDirectories;
private File statsDirectory;
@@ -192,7 +192,7 @@ public final class RelayDescriptorDatabaseImporter {
* preparing statements.
*/
public RelayDescriptorDatabaseImporter(String connectionUrl,
- String rawFilesDirectory, List<String> archivesDirectories,
+ String rawFilesDirectory, List<File> archivesDirectories,
File statsDirectory, boolean keepImportHistory) {
if (archivesDirectories == null || statsDirectory == null) {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits