Perform getCanonicalFile() immediately when creating hopHome in main method
of Server instead of only doing it when needed.
This commit is contained in:
parent
1f6e49e791
commit
65bef92295
2 changed files with 7 additions and 1 deletions
|
@ -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());
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue