} else if (StringUtils.isNullOrEmpty(resourcePath) || "/".equals(resourcePath)) {
handleDirectoryRequest(routeContext, directory);
} else {
File file = requestedPath.toFile();
if (file.exists()) {
<BUG>if (file.isFile()) {
URL url = requestedPath.toUri().toURL();</BUG>
switch (routeContext.getRequestMethod()) {
case HttpConstants.Method.HEAD:
setResponseHeaders(url, routeContext);

} else if (StringUtils.isNullOrEmpty(resourcePath) || "/".equals(resourcePath)) {
handleDirectoryRequest(routeContext, directory);
} else {
File file = requestedPath.toFile();
if (file.exists()) {
if (file.isFile()) {
routeContext.getResponse().contentLength(file.length());
URL url = requestedPath.toUri().toURL();
switch (routeContext.getRequestMethod()) {
case HttpConstants.Method.HEAD:
setResponseHeaders(url, routeContext);
