Skip to content

Commit

Permalink
Undertow warning instead of error if not found
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Apr 18, 2023
1 parent 329adf7 commit 621f427
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<String> files;
Expand Down Expand Up @@ -144,10 +148,12 @@ public List<Resource> 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.warnv(
"Unable to get listed resource {0} from directory '{1}' for path '{2}' from underlying manager {3}",
i, path, slashPath, underlying);
} else {
ret.add(resource);
}
ret.add(resource);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
Expand Down

0 comments on commit 621f427

Please sign in to comment.