[tor-commits] [metrics-db/master] Add @type annotation and Downloaded line to exit lists.

karsten at torproject.org karsten at torproject.org
Thu May 31 13:57:54 UTC 2012


commit b920fb0798759d063786762eac3a5f8c7e7df617
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Thu May 31 15:44:52 2012 +0200

    Add @type annotation and Downloaded line to exit lists.
---
 .../torproject/ernie/db/ExitListDownloader.java    |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/org/torproject/ernie/db/ExitListDownloader.java b/src/org/torproject/ernie/db/ExitListDownloader.java
index 82bde11..01a554f 100644
--- a/src/org/torproject/ernie/db/ExitListDownloader.java
+++ b/src/org/torproject/ernie/db/ExitListDownloader.java
@@ -40,11 +40,18 @@ public class ExitListDownloader {
       SimpleDateFormat printFormat =
           new SimpleDateFormat("yyyy/MM/dd/yyyy-MM-dd-HH-mm-ss");
       printFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+      Date downloadedDate = new Date();
       File exitListFile = new File("exitlist/" + printFormat.format(
-          new Date()));
+          downloadedDate));
       exitListFile.getParentFile().mkdirs();
+      SimpleDateFormat dateTimeFormat =
+          new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+      dateTimeFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
       BufferedWriter bw = new BufferedWriter(new FileWriter(
           exitListFile));
+      bw.write("@type tordnsel 1.0\n");
+      bw.write("Downloaded " + dateTimeFormat.format(downloadedDate)
+          + "\n");
       int len;
       byte[] data = new byte[1024];
       while ((len = in.read(data, 0, 1024)) >= 0) {



More information about the tor-commits mailing list