summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriwakeh <iwakeh@torproject.org>2018-03-20 08:31:46 +0000
committeriwakeh <iwakeh@torproject.org>2018-03-20 08:31:46 +0000
commit5d2bdbb8ca615551264d21e801499f8720d2709b (patch)
tree0f37dc754afc3bc8f10d0f5ae8db3fb0d23c4cfc
parent770f55cf82a1281e5081de7731adc9e36a916622 (diff)
Add 'contrib' directory to index.json.task-25624
-rw-r--r--src/main/java/org/torproject/collector/conf/Key.java1
-rw-r--r--src/main/java/org/torproject/collector/index/CreateIndexJson.java1
-rw-r--r--src/main/resources/collector.properties2
-rw-r--r--src/test/java/org/torproject/collector/conf/ConfigurationTest.java2
4 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/torproject/collector/conf/Key.java b/src/main/java/org/torproject/collector/conf/Key.java
index 6454009..5e91e3e 100644
--- a/src/main/java/org/torproject/collector/conf/Key.java
+++ b/src/main/java/org/torproject/collector/conf/Key.java
@@ -19,6 +19,7 @@ public enum Key {
ExitlistUrl(URL.class),
InstanceBaseUrl(String.class),
ArchivePath(Path.class),
+ ContribPath(Path.class),
RecentPath(Path.class),
OutputPath(Path.class),
IndexPath(Path.class),
diff --git a/src/main/java/org/torproject/collector/index/CreateIndexJson.java b/src/main/java/org/torproject/collector/index/CreateIndexJson.java
index fb693a7..49bfb11 100644
--- a/src/main/java/org/torproject/collector/index/CreateIndexJson.java
+++ b/src/main/java/org/torproject/collector/index/CreateIndexJson.java
@@ -92,6 +92,7 @@ public class CreateIndexJson extends CollecTorMain {
basePath = config.getProperty(Key.InstanceBaseUrl.name());
indexedDirectories = new File[] {
config.getPath(Key.ArchivePath).toFile(),
+ config.getPath(Key.ContribPath).toFile(),
config.getPath(Key.RecentPath).toFile() };
writeIndex(indexDirectories());
} catch (Exception e) {
diff --git a/src/main/resources/collector.properties b/src/main/resources/collector.properties
index 2aa556d..0fe6924 100644
--- a/src/main/resources/collector.properties
+++ b/src/main/resources/collector.properties
@@ -62,6 +62,8 @@ InstanceBaseUrl = https://collector.torproject.org
IndexPath = index
# The top-level directory for archived descriptors.
ArchivePath = archive
+# The top-level directory for third party data.
+ContribPath = contrib
# The top-level directory for the recent descriptors that were
# published in the last 72 hours.
RecentPath = recent
diff --git a/src/test/java/org/torproject/collector/conf/ConfigurationTest.java b/src/test/java/org/torproject/collector/conf/ConfigurationTest.java
index fcaa71f..e408109 100644
--- a/src/test/java/org/torproject/collector/conf/ConfigurationTest.java
+++ b/src/test/java/org/torproject/collector/conf/ConfigurationTest.java
@@ -40,7 +40,7 @@ public class ConfigurationTest {
public void testKeyCount() throws Exception {
assertEquals("The number of properties keys in enum Key changed."
+ "\n This test class should be adapted.",
- 52, Key.values().length);
+ 53, Key.values().length);
}
@Test()