From 65bef9229558fb03d37b4636b7148ccb2689c8b0 Mon Sep 17 00:00:00 2001 From: hns Date: Tue, 6 Aug 2002 14:47:30 +0000 Subject: [PATCH] Perform getCanonicalFile() immediately when creating hopHome in main method of Server instead of only doing it when needed. --- src/helma/main/ApplicationManager.java | 2 +- src/helma/main/Server.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/helma/main/ApplicationManager.java b/src/helma/main/ApplicationManager.java index 0d553d8f..ce0ae37c 100644 --- a/src/helma/main/ApplicationManager.java +++ b/src/helma/main/ApplicationManager.java @@ -182,7 +182,7 @@ public class ApplicationManager { } if (server.http != null) { // add handler for static files. - File staticContent = new File (server.getHopHome(), "static").getCanonicalFile(); + File staticContent = new File (server.getHopHome(), "static"); Server.getLogger().log("Serving static content from "+staticContent.getAbsolutePath()); HandlerContext context = server.http.addContext ("/static/*"); context.setResourceBase (staticContent.getAbsolutePath()); diff --git a/src/helma/main/Server.java b/src/helma/main/Server.java index bedc6c54..be803144 100644 --- a/src/helma/main/Server.java +++ b/src/helma/main/Server.java @@ -162,6 +162,12 @@ import org.mortbay.util.*; // create hopHome File object hopHome = new File (homeDir); + // try to transform hopHome directory to its cononical representation + try { + hopHome = hopHome.getCanonicalFile (); + } catch (IOException iox) { + System.err.println ("Error calling getCanonicalFile() on hopHome: "+iox); + } // from now on it's safe to call getLogger()