[jboss-cvs] JBossAS SVN: r93651 - projects/spring-int/branches/1_0/vfs/src/main/java/org/jboss/spring/vfs.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 17 11:04:01 EDT 2009


Author: marius.bogoevici
Date: 2009-09-17 11:04:01 -0400 (Thu, 17 Sep 2009)
New Revision: 93651

Modified:
   projects/spring-int/branches/1_0/vfs/src/main/java/org/jboss/spring/vfs/VFSResource.java
Log:
Relative path resolution for ../ and ./

Modified: projects/spring-int/branches/1_0/vfs/src/main/java/org/jboss/spring/vfs/VFSResource.java
===================================================================
--- projects/spring-int/branches/1_0/vfs/src/main/java/org/jboss/spring/vfs/VFSResource.java	2009-09-17 15:02:57 UTC (rev 93650)
+++ projects/spring-int/branches/1_0/vfs/src/main/java/org/jboss/spring/vfs/VFSResource.java	2009-09-17 15:04:01 UTC (rev 93651)
@@ -157,7 +157,11 @@
    @SuppressWarnings("deprecation")
    public Resource createRelative(String relativePath) throws IOException
    {
-      return new VFSResource(file.findChild(relativePath));
+      //VFSFile.findChild() will find only children
+      if (relativePath.startsWith("."))
+         return new VFSResource(VFS.getRoot(new URL(getURL(), relativePath)));
+      else
+         return new VFSResource(file.findChild(relativePath));
    }
 
    public String getFilename()




More information about the jboss-cvs-commits mailing list