Skip to content

Commit

Permalink
Update StaticResourceHandlerBuilder.java
Browse files Browse the repository at this point in the history
  • Loading branch information
SentryMan committed Nov 25, 2024
1 parent 8eb546e commit bf14f9d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, File> fileLoader) {
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit bf14f9d

Please sign in to comment.