[tor-commits] [collector/master] Move index.json* files to index/ subdirectory.

karsten at torproject.org karsten at torproject.org
Wed Oct 19 19:15:37 UTC 2016


commit 03978991666578f70affbb3d6f24a90e6495105a
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Wed Oct 19 19:43:15 2016 +0200

    Move index.json* files to index/ subdirectory.
    
    Implements #20408.
---
 src/main/java/org/torproject/collector/index/CreateIndexJson.java | 1 +
 src/main/resources/collector.properties                           | 2 +-
 src/main/webapp/index.html                                        | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/torproject/collector/index/CreateIndexJson.java b/src/main/java/org/torproject/collector/index/CreateIndexJson.java
index 5ec2014..f3fcc13 100644
--- a/src/main/java/org/torproject/collector/index/CreateIndexJson.java
+++ b/src/main/java/org/torproject/collector/index/CreateIndexJson.java
@@ -195,6 +195,7 @@ public class CreateIndexJson extends CollecTorMain {
   }
 
   private void writeIndex(IndexNode indexNode) throws IOException {
+    indexJsonFile.getParentFile().mkdirs();
     Gson gson = new GsonBuilder().create();
     String indexNodeString = gson.toJson(indexNode);
     Writer[] writers = new Writer[] {
diff --git a/src/main/resources/collector.properties b/src/main/resources/collector.properties
index 4441e1d..c8a9e2f 100644
--- a/src/main/resources/collector.properties
+++ b/src/main/resources/collector.properties
@@ -53,7 +53,7 @@ UpdateindexOffsetMinutes = 0
 InstanceBaseUrl = https://collector.torproject.org
 # The target location for index.json and its compressed
 # versions index.json.gz, index.json.bz2, and index.json.xz
-IndexPath = .
+IndexPath = index
 # The top-level directory for archived descriptors.
 ArchivePath = archive
 # The top-level directory for the recent descriptors that were
diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html
index 7ed9145..a1e5523 100644
--- a/src/main/webapp/index.html
+++ b/src/main/webapp/index.html
@@ -836,7 +836,7 @@ wget --recursive \                     # turn on recursive retrieving
 <h2 id="index-json" class="hover">Custom downloaders using provided <tt>index.json</tt>
 <a href="#index-json" class="hover">#</a></h2>
 
-<p>Another automated way to download descriptors is to develop a tool that uses the provided <a href="index.json"><tt>index.json</tt></a> file or one of its compressed versions <a href="index.json.gz"><tt>index.json.gz</tt></a>, <a href="index.json.bz2"><tt>index.json.bz2</tt></a>, or <a href="index.json.xz"><tt>index.json.xz</tt></a>.
+<p>Another automated way to download descriptors is to develop a tool that uses the provided <a href="index/index.json"><tt>index.json</tt></a> file or one of its compressed versions <a href="index/index.json.gz"><tt>index.json.gz</tt></a>, <a href="index/index.json.bz2"><tt>index.json.bz2</tt></a>, or <a href="index/index.json.xz"><tt>index.json.xz</tt></a>.
 These files contain a machine-readable representation of all descriptor files available on this site.
 Index files use the following custom JSON data format that might still be extended at a later time:</p>
 <ul>



More information about the tor-commits mailing list