From 170de3fd12264b0463aac5697b20febdc2a532bc Mon Sep 17 00:00:00 2001 From: kohsuke Date: Fri, 10 Aug 2007 16:00:06 +0000 Subject: [PATCH] simplified a bit. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4191 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/WebAppMain.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/hudson/WebAppMain.java b/core/src/main/java/hudson/WebAppMain.java index c39f6bdbe3..b6c84bb745 100644 --- a/core/src/main/java/hudson/WebAppMain.java +++ b/core/src/main/java/hudson/WebAppMain.java @@ -56,7 +56,7 @@ public class WebAppMain implements ServletContextListener { installLogger(); - File home = getHomeDir(event); + File home = getHomeDir(event).getAbsoluteFile(); home.mkdirs(); System.out.println("hudson home directory: "+home); @@ -159,7 +159,7 @@ public class WebAppMain implements ServletContextListener { Context env = (Context) new InitialContext().lookup("java:comp/env"); String value = (String) env.lookup("HUDSON_HOME"); if(value!=null && value.trim().length()>0) - return new File(value.trim()).getAbsoluteFile(); + return new File(value.trim()); } catch (NamingException e) { // ignore } @@ -172,7 +172,7 @@ public class WebAppMain implements ServletContextListener { // finally check the system property String sysProp = System.getProperty("HUDSON_HOME"); if(sysProp!=null) - return new File(sysProp.trim()).getAbsoluteFile(); + return new File(sysProp.trim()); // otherwise pick a place by ourselves @@ -183,11 +183,11 @@ public class WebAppMain implements ServletContextListener { // Hudson <1.42 used to prefer this before ~/.hudson, so // check the existence and if it's there, use it. // otherwise if this is a new installation, prefer ~/.hudson - return ws.getAbsoluteFile(); + return ws; } // if for some reason we can't put it within the webapp, use home directory. - return new File(new File(System.getProperty("user.home")),".hudson").getAbsoluteFile(); + return new File(new File(System.getProperty("user.home")),".hudson"); } public void contextDestroyed(ServletContextEvent event) {