[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-db/master] Always copy files to rsync/ and keep last modified time.



commit 81dd6f373afa9a0ea1af222ad900681ca632e890
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Sat Jan 14 11:29:45 2012 +0100

    Always copy files to rsync/ and keep last modified time.
---
 src/org/torproject/ernie/db/RsyncDataProvider.java |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/src/org/torproject/ernie/db/RsyncDataProvider.java b/src/org/torproject/ernie/db/RsyncDataProvider.java
index 1f0d68f..455d6dd 100644
--- a/src/org/torproject/ernie/db/RsyncDataProvider.java
+++ b/src/org/torproject/ernie/db/RsyncDataProvider.java
@@ -123,9 +123,6 @@ public class RsyncDataProvider {
   }
 
   private void copyFile(File from, File to) {
-    if (to.exists()) {
-      return;
-    }
     try {
       to.getParentFile().mkdirs();
       FileInputStream fis = new FileInputStream(from);
@@ -138,6 +135,7 @@ public class RsyncDataProvider {
       }
       bis.close();
       fos.close();
+      to.setLastModified(from.lastModified());
     } catch (IOException e) {
       e.printStackTrace();
     }

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits