--- system/src/main/org/jboss/system/server/ServerConfigImpl.java.sav	2006-02-17 18:56:57.000000000 -0500
+++ system/src/main/org/jboss/system/server/ServerConfigImpl.java	2006-08-08 10:54:19.000000000 -0400
@@ -237,6 +237,13 @@
          if (serverBaseDir == null)
          {
             serverBaseDir = new File(homeDir, ServerConfig.SERVER_BASE_DIR_SUFFIX);
+            try {
+               serverBaseDir = serverBaseDir.getCanonicalFile();
+            }
+            catch(IOException e)
+            {
+               serverBaseDir = new File(homeDir, ServerConfig.SERVER_BASE_DIR_SUFFIX);
+            }
             System.setProperty(ServerConfig.SERVER_BASE_DIR, serverBaseDir.toString());
          }
       }
@@ -256,6 +263,13 @@
          if (serverHomeDir == null)
          {
             serverHomeDir = new File(getServerBaseDir(), getServerName());
+            try {
+               serverHomeDir = serverHomeDir.getCanonicalFile();
+            }
+            catch(IOException e)
+            {
+               serverHomeDir = new File(getServerBaseDir(), getServerName());
+            }
             System.setProperty(ServerConfig.SERVER_HOME_DIR, serverHomeDir.toString());
          }
       }
@@ -278,6 +292,13 @@
          if (serverLogDir == null)
          {
             serverLogDir = new File(getServerHomeDir(), ServerConfig.SERVER_LOG_DIR_SUFFIX);
+            try {
+               serverLogDir = serverLogDir.getCanonicalFile();
+            }
+            catch(IOException e)
+            {
+               serverLogDir = new File(getServerHomeDir(), ServerConfig.SERVER_LOG_DIR_SUFFIX);
+            }
             System.setProperty(ServerConfig.SERVER_LOG_DIR, serverLogDir.toString());
          }
       }
@@ -298,6 +319,13 @@
          if (serverTempDir == null)
          {
             serverTempDir = new File(getServerHomeDir(), ServerConfig.SERVER_TEMP_DIR_SUFFIX);
+            try {
+               serverTempDir = serverTempDir.getCanonicalFile();
+            }
+            catch(IOException e)
+            {
+               serverTempDir = new File(getServerHomeDir(), ServerConfig.SERVER_TEMP_DIR_SUFFIX);
+            }
             System.setProperty(ServerConfig.SERVER_TEMP_DIR, serverTempDir.toString());
          }
       }
@@ -318,6 +346,13 @@
          if (serverDataDir == null)
          {
             serverDataDir = new File(getServerHomeDir(), ServerConfig.SERVER_DATA_DIR_SUFFIX);
+            try {
+               serverDataDir = serverDataDir.getCanonicalFile();
+            }
+            catch(IOException e)
+            {
+               serverDataDir = new File(getServerHomeDir(), ServerConfig.SERVER_DATA_DIR_SUFFIX);
+            }
             System.setProperty(ServerConfig.SERVER_DATA_DIR, serverDataDir.toString());
          }
       }
@@ -332,10 +367,28 @@
     */
    public File getServerNativeDir()
    {
+      File f = null;
       String fileName = System.getProperty(NATIVE_DIR_PROPERTY);
-      if (fileName != null)
-         return new File(fileName);
-      return new File(getServerTempDir(), "native");
+      if (fileName != null) {
+         f = new File(fileName);
+         try {
+            f = f.getCanonicalFile();
+         }
+         catch(IOException e)
+         {
+            f = new File(fileName);
+         }
+         return f;
+      }
+      f = new File(getServerTempDir(), "native");
+      try {
+         f = f.getCanonicalFile();
+      }
+      catch(IOException e)
+      {
+         f = new File(getServerTempDir(), "native");
+      }
+      return f;
    }
 
    /**
@@ -346,7 +399,15 @@
     */
    public File getServerTempDeployDir()
    {
-      return new File(getServerTempDir(), "deploy");
+      File f = new File(getServerTempDir(), "deploy");
+      try {
+         f = f.getCanonicalFile();
+      }
+      catch(IOException e)
+      {
+         f = new File(getServerTempDir(), "deploy");
+      }
+      return f;
    }
 
    /**
@@ -364,6 +425,13 @@
             if (serverBaseURL == null)
             {
                serverBaseURL = new URL(homeURL, ServerConfig.SERVER_BASE_URL_SUFFIX);
+               if (serverBaseURL.getProtocol().startsWith("file")) {
+                  File f = new File(serverBaseURL.getFile());
+                  try {
+                     serverBaseURL = f.getCanonicalFile().toURL();
+                  }
+                  catch(IOException e) {}
+               }
             }
             System.setProperty(ServerConfig.SERVER_BASE_URL, serverBaseURL.toString());
          }
@@ -390,6 +458,13 @@
             if (serverHomeURL == null)
             {
                serverHomeURL = new URL(getServerBaseURL(), getServerName() + "/");
+               if (serverHomeURL.getProtocol().startsWith("file")) {
+                  File f = new File(serverHomeURL.getFile());
+                  try {
+                     serverHomeURL = f.getCanonicalFile().toURL();
+                  }
+                  catch(IOException e) {}
+               }
             }
             System.setProperty(ServerConfig.SERVER_HOME_URL, serverHomeURL.toString());
          }
@@ -416,6 +491,13 @@
             if (serverLibraryURL == null)
             {
                serverLibraryURL = new URL(getServerHomeURL(), ServerConfig.LIBRARY_URL_SUFFIX);
+               if (serverLibraryURL.getProtocol().startsWith("file")) {
+                  File f = new File(serverLibraryURL.getFile());
+                  try {
+                     serverLibraryURL = f.getCanonicalFile().toURL();
+                  }
+                  catch(IOException e) {}
+               }
             }
             System.setProperty(ServerConfig.SERVER_LIBRARY_URL, serverLibraryURL.toString());
          }
@@ -442,6 +524,13 @@
             if (serverConfigURL == null)
             {
                serverConfigURL = new URL(getServerHomeURL(), ServerConfig.SERVER_CONFIG_URL_SUFFIX);
+               if (serverConfigURL.getProtocol().startsWith("file")) {
+                  File f = new File(serverConfigURL.getFile());
+                  try {
+                     serverConfigURL = f.getCanonicalFile().toURL();
+                  }
+                  catch(IOException e) {}
+               }
             }
             System.setProperty(ServerConfig.SERVER_CONFIG_URL, serverConfigURL.toString());
          }
@@ -645,7 +734,15 @@
       if (value != null)
       {
          if (!value.endsWith("/")) value += "/";
-         return new URL(value);
+         URL u = new URL(value);
+         if (u.getProtocol().startsWith("file")) {
+            File f = new File(u.getFile());
+            try {
+               u = f.getCanonicalFile().toURL();
+            }
+            catch(IOException e) {}
+         }
+         return u;
       }
 
       return null;
