You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2006/02/11 09:46:28 UTC

svn commit: r376955 - /incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java

Author: gnodet
Date: Sat Feb 11 00:46:26 2006
New Revision: 376955

URL: http://svn.apache.org/viewcvs?rev=376955&view=rev
Log:
Use canonical file names in the EnvironmentContext

Modified:
    incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java

Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java?rev=376955&r1=376954&r2=376955&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/container/EnvironmentContext.java Sat Feb 11 00:46:26 2006
@@ -530,30 +530,37 @@
         if (container.isEmbedded()) {
             return;
         }
-        if (!jbiRootDir.exists()) {
-            if (!jbiRootDir.mkdirs()) {
-            	throw new JBIException("Directory could not be created: "+jbiRootDir.getAbsolutePath());
+        try {
+            jbiRootDir = jbiRootDir.getCanonicalFile();
+            if (!jbiRootDir.exists()) {
+                if (!jbiRootDir.mkdirs()) {
+                	throw new JBIException("Directory could not be created: "+jbiRootDir.getCanonicalFile());
+                }
+            } else if (!jbiRootDir.isDirectory()) {
+            	throw new JBIException("Not a directory: " + jbiRootDir.getCanonicalFile());
+            }         
+            if (installationDir == null){
+                installationDir = FileUtil.getDirectoryPath(jbiRootDir, "install");
             }
-        } else if (!jbiRootDir.isDirectory()) {
-        	throw new JBIException("Not a directory: " + jbiRootDir.getAbsolutePath());
-        }         
-        if (installationDir == null){
-            installationDir = FileUtil.getDirectoryPath(jbiRootDir, "install");
-        }
-        if (deploymentDir == null){
-            deploymentDir = FileUtil.getDirectoryPath(jbiRootDir, "deploy");
+            installationDir = installationDir.getCanonicalFile();
+            if (deploymentDir == null){
+                deploymentDir = FileUtil.getDirectoryPath(jbiRootDir, "deploy");
+            }
+            deploymentDir = deploymentDir.getCanonicalFile();
+            componentsDir = FileUtil.getDirectoryPath(jbiRootDir, "components").getCanonicalFile();
+            tmpDir = FileUtil.getDirectoryPath(jbiRootDir, "tmp").getCanonicalFile();
+            sharedLibDir = FileUtil.getDirectoryPath(jbiRootDir, "sharedlibs").getCanonicalFile();
+            serviceAssembiliesDirectory = FileUtil.getDirectoryPath(jbiRootDir,"service-assemblies").getCanonicalFile();
+            //actually create the sub directories
+            FileUtil.buildDirectory(installationDir);
+            FileUtil.buildDirectory(deploymentDir);
+            FileUtil.buildDirectory(componentsDir);
+            FileUtil.buildDirectory(tmpDir);
+            FileUtil.buildDirectory(sharedLibDir);
+            FileUtil.buildDirectory(serviceAssembiliesDirectory);
+        } catch (IOException e) {
+            throw new JBIException(e);
         }
-        componentsDir = FileUtil.getDirectoryPath(jbiRootDir, "components");
-        tmpDir = FileUtil.getDirectoryPath(jbiRootDir, "tmp");
-        sharedLibDir = FileUtil.getDirectoryPath(jbiRootDir, "sharedlibs");
-        serviceAssembiliesDirectory = FileUtil.getDirectoryPath(jbiRootDir,"service-assemblies");
-        //actually create the sub directories
-        FileUtil.buildDirectory(installationDir);
-        FileUtil.buildDirectory(deploymentDir);
-        FileUtil.buildDirectory(componentsDir);
-        FileUtil.buildDirectory(tmpDir);
-        FileUtil.buildDirectory(sharedLibDir);
-        FileUtil.buildDirectory(serviceAssembiliesDirectory);
     }
 
     private void scheduleStatsTimer() {