From b87db668c782eac31735592bb001e1f266a3a4e9 Mon Sep 17 00:00:00 2001 From: joakim Date: Fri, 1 May 2015 14:49:45 -0700 Subject: [PATCH] Fixing PathWatcher root path handling on Windows --- .../main/java/org/eclipse/jetty/util/PathWatcher.java | 11 ++++++++--- .../src/test/resources/jetty-logging.properties | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/PathWatcher.java b/jetty-util/src/main/java/org/eclipse/jetty/util/PathWatcher.java index c095f488b53..5a48684b27b 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/PathWatcher.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/PathWatcher.java @@ -376,11 +376,16 @@ public class PathWatcher extends AbstractLifeCycle implements Runnable boolean needDelim = false; // Add root (aka "C:\" for Windows) - if (path.getRoot() != null) + Path root = path.getRoot(); + if (root != null) { - for (char c : path.getRoot().toString().toCharArray()) + if (NOISY_LOG.isDebugEnabled()) { - if (c != '\\') + NOISY_LOG.debug("Path: {} -> Root: {}",path,root); + } + for (char c : root.toString().toCharArray()) + { + if (c == '\\') { s.append(PATTERN_SEP); } diff --git a/jetty-util/src/test/resources/jetty-logging.properties b/jetty-util/src/test/resources/jetty-logging.properties index 0e3f8af5906..76035ea1ee8 100644 --- a/jetty-util/src/test/resources/jetty-logging.properties +++ b/jetty-util/src/test/resources/jetty-logging.properties @@ -2,4 +2,4 @@ org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog #org.eclipse.jetty.util.LEVEL=DEBUG -org.eclipse.jetty.util.PathWatcher.Noisy.LEVEL=OFF +#org.eclipse.jetty.util.PathWatcher.Noisy.LEVEL=OFF