From e9caa13ee37c81163acaef5a4cda58ba2b17d947 Mon Sep 17 00:00:00 2001 From: Melloware Date: Tue, 25 Apr 2023 10:38:05 -0400 Subject: [PATCH] Update KnownPathResourceManager.java Undertow warning instead of error if not found --- .../undertow/runtime/KnownPathResourceManager.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/extensions/undertow/runtime/src/main/java/io/quarkus/undertow/runtime/KnownPathResourceManager.java b/extensions/undertow/runtime/src/main/java/io/quarkus/undertow/runtime/KnownPathResourceManager.java index fe426c649bf77..f1c7077d526ec 100644 --- a/extensions/undertow/runtime/src/main/java/io/quarkus/undertow/runtime/KnownPathResourceManager.java +++ b/extensions/undertow/runtime/src/main/java/io/quarkus/undertow/runtime/KnownPathResourceManager.java @@ -16,6 +16,8 @@ import java.util.SortedSet; import java.util.TreeSet; +import org.jboss.logging.Logger; + import io.undertow.httpcore.OutputChannel; import io.undertow.server.HttpServerExchange; import io.undertow.server.handlers.resource.Resource; @@ -25,6 +27,8 @@ public class KnownPathResourceManager implements ResourceManager { + private static final Logger log = Logger.getLogger(KnownPathResourceManager.class); + public static final boolean IS_WINDOWS = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows"); private final NavigableSet files; @@ -144,10 +148,12 @@ public List list() { try { Resource resource = underlying.getResource(i); if (resource == null) { - throw new RuntimeException("Unable to get listed resource " + i + " from directory " + path - + " for path " + slashPath + " from underlying manager " + underlying); + log.errorv( + "Unable to get listed resource '{0}' from directory '{1}' for path '{2}'", + i, path, slashPath); + } else { + ret.add(resource); } - ret.add(resource); } catch (IOException e) { throw new UncheckedIOException(e); } @@ -212,4 +218,4 @@ public URL getUrl() { return null; } } -} \ No newline at end of file +}