From bf14f9d0cd635fd0c01fa70b0d17839e958701a7 Mon Sep 17 00:00:00 2001 From: Josiah Noel <32279667+SentryMan@users.noreply.github.com> Date: Mon, 25 Nov 2024 00:06:13 -0500 Subject: [PATCH] Update StaticResourceHandlerBuilder.java --- .../java/io/avaje/jex/StaticResourceHandlerBuilder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/avaje-jex/src/main/java/io/avaje/jex/StaticResourceHandlerBuilder.java b/avaje-jex/src/main/java/io/avaje/jex/StaticResourceHandlerBuilder.java index d645dc7..09f86eb 100644 --- a/avaje-jex/src/main/java/io/avaje/jex/StaticResourceHandlerBuilder.java +++ b/avaje-jex/src/main/java/io/avaje/jex/StaticResourceHandlerBuilder.java @@ -145,8 +145,8 @@ private String appendSlash(String s) { return s.endsWith("/") ? s : s + "/"; } - private boolean isJrtPath(URI uri) { - return uri.getScheme().startsWith("jrt"); + private boolean nonFilePath(URI uri) { + return !uri.getScheme().startsWith("file"); } private ExchangeHandler fileLoader(Function fileLoader) { @@ -190,7 +190,7 @@ private ExchangeHandler classPathHandler() { if (directoryIndex != null) { try { var uri = loaderFunc.apply(root.transform(this::appendSlash) + directoryIndex); - if (isJrtPath(uri)) { + if (nonFilePath(uri)) { var dirIndex = Paths.get(uri).toRealPath(); return new JrtResourceHandler( path, @@ -215,7 +215,7 @@ private ExchangeHandler classPathHandler() { try { var uri = loaderFunc.apply(root); - if (isJrtPath(uri)) { + if (nonFilePath(uri)) { var singleFile = Paths.get(uri).toRealPath(); return new JrtResourceHandler( path,