You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by pt...@apache.org on 2014/04/29 19:08:26 UTC
[3/5] git commit: switch to java.io.File for directory comparison
switch to java.io.File for directory comparison
Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/16c96798
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/16c96798
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/16c96798
Branch: refs/heads/master
Commit: 16c967981f4ebfe6d20ff2b86a8a7bc56227f74d
Parents: 6fd68a5
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Mon Apr 28 13:35:25 2014 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Mon Apr 28 13:35:25 2014 -0400
----------------------------------------------------------------------
storm-core/src/clj/backtype/storm/daemon/logviewer.clj | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/16c96798/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
index 7d8b7aa..ef6f349 100644
--- a/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
+++ b/storm-core/src/clj/backtype/storm/daemon/logviewer.clj
@@ -32,8 +32,10 @@
(defn tail-file [path tail root-dir]
(let [flen (.length (clojure.java.io/file path))
- skip (- flen tail)]
- (if (.startsWith path (.getCanonicalPath (File. root-dir)))
+ skip (- flen tail)
+ log-dir (File. root-dir)
+ log-file (File. path)]
+ (if (= log-dir (.getParentFile log-file))
(with-open [input (clojure.java.io/input-stream path)
output (java.io.ByteArrayOutputStream.)]
(if (> skip 0) (.skip input skip))