if (f.exists() && f.isDirectory()) {
// Requested url is a directory
// We first look if we have a redirect file
String forward = getForward(ref);
if (forward != null) {
throw new URLRedirectException(forward);
}
// There is no redirection, we look for standard files to show (index.html, ...)
contentReader = getStandardFileReader(f);
if (contentReader==null) {
if (ref.getReferencePath().endsWith("/")) {
contentReader = getDirectoryReader(ref, f);
} else {
throw new UnknwownContentException(f.getName() + " , it doesn't end with a trailing slash");
}
}
if (contentReader==null) {
contentReader = getErrorNoContentReader(ref, f);
}
} else {
if (ref.getReferencePath().endsWith("/")) {
// in case we are looking for javadocs or sources that do not exists
contentReader = getErrorNoContentReader(ref, f);
} else if (!f.exists()) {
// we check if we have a forward instruction
String forward = getForward(ref);
if (forward != null) {
throw new URLRedirectException(forward);
} else {
LOGGER.info("File " + fileToRead + " doesn't exist in this server, we dispatch.");
dispatch.dispatch(uak, ref, redirected);
}
} else {