Perform getCanonicalFile() immediately when creating hopHome in main method

of Server instead of only doing it when needed.
This commit is contained in:
hns 2002-08-06 14:47:30 +00:00
parent 1f6e49e791
commit 65bef92295
2 changed files with 7 additions and 1 deletions

View file

@ -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());

View file

@ -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()