From 458e511ce2f2b47fd216f68c0e385fc06a5f1d2f Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 27 Sep 2013 13:37:00 +1000 Subject: [PATCH] 418014 Handle NTFS canonical exceptions during alias check --- .../jetty/util/resource/FileResource.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java index d2f25028757..a3440a2286e 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/FileResource.java @@ -32,6 +32,8 @@ import java.nio.channels.ReadableByteChannel; import java.nio.file.StandardOpenOption; import java.security.Permission; +import javax.management.RuntimeErrorException; + import org.eclipse.jetty.util.IO; import org.eclipse.jetty.util.URIUtil; import org.eclipse.jetty.util.log.Log; @@ -148,9 +150,19 @@ public class FileResource extends Resource } catch(IOException e) { - LOG.warn(e); + LOG.warn("bad alias for {}: {}",file,e.toString()); + LOG.debug(e); + try + { + return new URL("http://eclipse.org/bad/canonical/alias"); + } + catch(Exception e2) + { + LOG.ignore(e2); + throw new RuntimeException(e); + } } - + return null; }