Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undertow warning instead of error if not found #32727

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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