From 38501a9e978335c63ed52555f8b6d2d8e4f138f8 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Fri, 1 Aug 2014 14:34:21 -0700 Subject: [PATCH] On alias resolution in PathResource, ignore NoSuchFileException (its a valid and common path for 404 requested resources) --- .../java/org/eclipse/jetty/util/resource/PathResource.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java index 0a5812d0a0f..da48349e719 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/PathResource.java @@ -32,6 +32,7 @@ import java.nio.file.DirectoryStream; import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.LinkOption; +import java.nio.file.NoSuchFileException; import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.nio.file.attribute.FileTime; @@ -71,6 +72,10 @@ public class PathResource extends Resource return realUri; } } + catch (NoSuchFileException e) + { + // Ignore + } catch (IOException e) { // TODO: reevaluate severity level