[jboss-cvs] JBossAS SVN: r101606 - projects/snowdrop/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
Sat Feb 27 14:44:02 EST 2010


Author: marius.bogoevici
Date: 2010-02-27 14:44:01 -0500 (Sat, 27 Feb 2010)
New Revision: 101606

Modified:
   projects/snowdrop/branches/1_0/vfs/src/main/java/org/jboss/spring/vfs/VFSResource.java
Log:
SNOWDROP-10

Modified: projects/snowdrop/branches/1_0/vfs/src/main/java/org/jboss/spring/vfs/VFSResource.java
===================================================================
--- projects/snowdrop/branches/1_0/vfs/src/main/java/org/jboss/spring/vfs/VFSResource.java	2010-02-27 19:33:29 UTC (rev 101605)
+++ projects/snowdrop/branches/1_0/vfs/src/main/java/org/jboss/spring/vfs/VFSResource.java	2010-02-27 19:44:01 UTC (rev 101606)
@@ -157,11 +157,22 @@
    @SuppressWarnings("deprecation")
    public Resource createRelative(String relativePath) throws IOException
    {
-      //VFSFile.findChild() will find only children
-      if (relativePath.startsWith(".") || relativePath.indexOf("/")==-1 )
+      // if it's a known relative path findChild() won't work 
+      if (relativePath.startsWith(".") || relativePath.indexOf("/") == -1)
+      {
          return new VFSResource(VFS.getRoot(new URL(getURL(), relativePath)));
+      }
       else
-         return new VFSResource(file.findChild(relativePath));
+      {
+         try
+         {
+            return new VFSResource(file.findChild(relativePath));
+         }
+         catch (IOException e)
+         {
+            return new VFSResource(VFS.getRoot(new URL(getURL(), relativePath)));
+         }
+      }
    }
 
    public String getFilename()




More information about the jboss-cvs-commits mailing list