[jboss-cvs] JBossAS SVN: r101476 - in projects/vfs/branches/Branch_2_2/src: main/java/org/jboss/virtual/plugins/registry and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Feb 25 10:03:20 EST 2010


Author: alesj
Date: 2010-02-25 10:03:19 -0500 (Thu, 25 Feb 2010)
New Revision: 101476

Modified:
   projects/vfs/branches/Branch_2_2/src/main/java/org/jboss/virtual/VFSUtils.java
   projects/vfs/branches/Branch_2_2/src/main/java/org/jboss/virtual/plugins/registry/DefaultVFSRegistry.java
   projects/vfs/branches/Branch_2_2/src/test/java/org/jboss/test/virtual/test/SymlinkTestCase.java
Log:
[JBVFS-137]; simplify to-canonical call.
Shorten the const.

Modified: projects/vfs/branches/Branch_2_2/src/main/java/org/jboss/virtual/VFSUtils.java
===================================================================
--- projects/vfs/branches/Branch_2_2/src/main/java/org/jboss/virtual/VFSUtils.java	2010-02-25 15:02:59 UTC (rev 101475)
+++ projects/vfs/branches/Branch_2_2/src/main/java/org/jboss/virtual/VFSUtils.java	2010-02-25 15:03:19 UTC (rev 101476)
@@ -107,7 +107,7 @@
    /**
     * Key used to force canonical lookup
     */
-   public static final String FORCE_CANONICAL_LOOKUP = "jboss.vfs.forceCanonicalLookup";
+   public static final String FORCE_CANONICAL = "jboss.vfs.forceCanonical";
 
    /**
     * Key used to turn on memory optimizations - less cache use at the expense of performance

Modified: projects/vfs/branches/Branch_2_2/src/main/java/org/jboss/virtual/plugins/registry/DefaultVFSRegistry.java
===================================================================
--- projects/vfs/branches/Branch_2_2/src/main/java/org/jboss/virtual/plugins/registry/DefaultVFSRegistry.java	2010-02-25 15:02:59 UTC (rev 101475)
+++ projects/vfs/branches/Branch_2_2/src/main/java/org/jboss/virtual/plugins/registry/DefaultVFSRegistry.java	2010-02-25 15:03:19 UTC (rev 101476)
@@ -108,19 +108,11 @@
    {
       if (forceCanonical)
       {
-         StringBuilder path = new StringBuilder();
          File file = new File(uri.getPath());
-         while(file.exists() == false)
-         {
-            path.insert(0, file.getName());
-            path.insert(0, File.separator);
-            file = file.getParentFile();
-         }
          file = file.getCanonicalFile();
-         path.insert(0, file.getPath());
          try
          {
-            return new URI(uri.getScheme(), uri.getHost(), path.toString(), uri.getQuery(), uri.getFragment());
+            return new URI(uri.getScheme(), uri.getHost(), file.getPath(), uri.getQuery(), uri.getFragment());
          }
          catch (URISyntaxException e)
          {
@@ -203,7 +195,7 @@
    {
       public Boolean run()
       {
-         String forceString = System.getProperty(VFSUtils.FORCE_CANONICAL_LOOKUP, "false");
+         String forceString = System.getProperty(VFSUtils.FORCE_CANONICAL, "false");
          return Boolean.valueOf(forceString);
       }
    }

Modified: projects/vfs/branches/Branch_2_2/src/test/java/org/jboss/test/virtual/test/SymlinkTestCase.java
===================================================================
--- projects/vfs/branches/Branch_2_2/src/test/java/org/jboss/test/virtual/test/SymlinkTestCase.java	2010-02-25 15:02:59 UTC (rev 101475)
+++ projects/vfs/branches/Branch_2_2/src/test/java/org/jboss/test/virtual/test/SymlinkTestCase.java	2010-02-25 15:03:19 UTC (rev 101476)
@@ -77,7 +77,7 @@
       super.setUp();
 
       // enable force canonical
-      System.setProperty(VFSUtils.FORCE_CANONICAL_LOOKUP, "true");
+      System.setProperty(VFSUtils.FORCE_CANONICAL, "true");
 
       // setup symlink dir and test path!
 




More information about the jboss-cvs-commits mailing list