[jboss-cvs] JBossAS SVN: r66232 - projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/memory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 18 06:38:13 EDT 2007


Author: kabir.khan at jboss.com
Date: 2007-10-18 06:38:13 -0400 (Thu, 18 Oct 2007)
New Revision: 66232

Modified:
   projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/memory/MemoryContextHandler.java
Log:
Make sure we populatre the vfsURL

Modified: projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/memory/MemoryContextHandler.java
===================================================================
--- projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/memory/MemoryContextHandler.java	2007-10-18 08:38:09 UTC (rev 66231)
+++ projects/vfs/trunk/src/main/java/org/jboss/virtual/plugins/context/memory/MemoryContextHandler.java	2007-10-18 10:38:13 UTC (rev 66232)
@@ -25,6 +25,8 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collections;
@@ -99,7 +101,7 @@
       return entryChildren;
    }
 
-   public boolean isLeaf() throws IOException
+   public boolean isLeaf()
    {
       return contents != null;
    }
@@ -168,4 +170,23 @@
       return new ByteArrayInputStream(new byte[0]);
    }
 
+   @Override
+   public URL toVfsUrl() throws MalformedURLException, URISyntaxException
+   {
+      if (super.vfsUrl == null)
+      {
+         if (isLeaf())
+         {
+            super.vfsUrl = getURL();
+         }
+         else
+         {
+            String vfsString = getURL().toString(); 
+            if (!vfsString.endsWith("/"));
+            super.vfsUrl = new URL(vfsString + "/");
+         }
+      }
+      return super.vfsUrl;
+   }
+   
 }




More information about the jboss-cvs-commits mailing list