From e116f999c5f24bf6eac6a3f8c31e0e75fcba29bd Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Sat, 17 Oct 2020 23:21:26 +0200 Subject: [PATCH] Some fixes in FilePage --- src/zutil/net/http/page/HttpFilePage.java | 39 ++++++++++++----------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/src/zutil/net/http/page/HttpFilePage.java b/src/zutil/net/http/page/HttpFilePage.java index 21b40ea..3597055 100755 --- a/src/zutil/net/http/page/HttpFilePage.java +++ b/src/zutil/net/http/page/HttpFilePage.java @@ -82,20 +82,19 @@ public class HttpFilePage implements HttpPage{ // Is the root only one file or a folder if (resource_root.isFile()) { deliverFileWithCache(headers, resource_root, out); - } - else { // Resource root is a folder + } else { // Resource root is a folder File file = new File(resource_root, headers.getRequestURL()); - if(file.getCanonicalPath().startsWith(resource_root.getCanonicalPath())){ + if (file.getCanonicalPath().startsWith(resource_root.getCanonicalPath())) { // Web Gui - if(file.isDirectory() && showFolders){ + if (file.isDirectory() && showFolders) { File indexFile = new File(file, "index.html"); // Redirect to index.html - if(redirectToIndex && indexFile.isFile()) { + if (redirectToIndex && indexFile.isFile()) { deliverFile(indexFile, out); } // Show folder contents - else if(showFolders){ + else if (showFolders) { out.println("

Directory: " + headers.getRequestURL() + "

"); out.println("