[tor-commits] [metrics-db/master] Always copy files to rsync/ and keep last modified time.
karsten at torproject.org
karsten at torproject.org
Sat Jan 14 10:30:23 UTC 2012
commit 81dd6f373afa9a0ea1af222ad900681ca632e890
Author: Karsten Loesing <karsten.loesing at gmx.net>
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();
}
More information about the tor-commits
mailing list