[tor-commits] [collector/release] Add 'contrib' directory to index.json.

karsten at torproject.org karsten at torproject.org
Fri May 25 12:52:47 UTC 2018


commit 5d2bdbb8ca615551264d21e801499f8720d2709b
Author: iwakeh <iwakeh at torproject.org>
Date:   Tue Mar 20 08:31:46 2018 +0000

    Add 'contrib' directory to index.json.
---
 src/main/java/org/torproject/collector/conf/Key.java               | 1 +
 src/main/java/org/torproject/collector/index/CreateIndexJson.java  | 1 +
 src/main/resources/collector.properties                            | 2 ++
 src/test/java/org/torproject/collector/conf/ConfigurationTest.java | 2 +-
 4 files changed, 5 insertions(+), 1 deletion(-)

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()





More information about the tor-commits mailing list