[Yanel-commits] rev 24393 - public/yanel/trunk/src/core/java/org/wyona/yanel/core/map

michi at wyona.com michi at wyona.com
Sat May 12 17:04:12 CEST 2007


Author: michi
Date: 2007-05-12 17:04:11 +0200 (Sat, 12 May 2007)
New Revision: 24393

Modified:
   public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmConfiguration.java
Log:
resolve config path fixed such that it also works for relative paths

Modified: public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmConfiguration.java
===================================================================
--- public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmConfiguration.java	2007-05-12 14:40:08 UTC (rev 24392)
+++ public/yanel/trunk/src/core/java/org/wyona/yanel/core/map/RealmConfiguration.java	2007-05-12 15:04:11 UTC (rev 24393)
@@ -51,7 +51,7 @@
 import org.xml.sax.SAXException;
 
 /**
- *
+ * Class managing registration of realms (adding, updating, copying, deleting, ...)
  */
 public class RealmConfiguration {
 
@@ -245,18 +245,16 @@
     /**
      * If the given file has a relative path, resolve it relative to the given dir.
      * If dir is in fact a file, the resolving will use the parent dir of that file.  
-     * @param file
-     * @param dir
+     * @param file Realm configuration specified within realms.xml
+     * @param dir Path of realms.xml
      */
     protected File resolveFile(File file, File dir) {
         // TODO: Replace this method by some method from org.wyona.commons.io.FileUtil ...
         if (!file.isAbsolute()) {
             if (dir.isDirectory()) {
-                //file = FileUtil.file(dir.getAbsolutePath(), file.toString());
-                file = new File(dir, file.getPath());
+                file = new File(org.apache.commons.io.FilenameUtils.concat(dir.getAbsolutePath(), file.getPath()));
             } else {
-                //file = FileUtil.file(dir.getParentFile().getAbsolutePath(), file.toString());
-                file = new File(dir.getParentFile(), file.getPath());
+                file = new File(org.apache.commons.io.FilenameUtils.concat(dir.getParent(), file.getPath()));
             }
         }
         return file;




More information about the Yanel-commits mailing list