[jboss-cvs] JBossAS SVN: r91508 - projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 21 15:35:31 EDT 2009
Author: alesj
Date: 2009-07-21 15:35:31 -0400 (Tue, 21 Jul 2009)
New Revision: 91508
Modified:
projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java
Log:
Handle url via uri.
Modified: projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java
===================================================================
--- projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java 2009-07-21 19:30:45 UTC (rev 91507)
+++ projects/vfs/branches/dml-zip-rework/src/main/java/org/jboss/virtual/VFS.java 2009-07-21 19:35:31 UTC (rev 91508)
@@ -25,6 +25,7 @@
import java.io.IOException;
import java.net.URI;
import java.net.URL;
+import java.net.URISyntaxException;
import java.util.AbstractSet;
import java.util.Collection;
import java.util.Collections;
@@ -90,10 +91,20 @@
*
* @param url the url
* @return the file matching url
+ * @throws IOException if there is a problem accessing the VFS
*/
- public static VirtualFile getRoot(URL url)
+ public static VirtualFile getRoot(URL url) throws IOException
{
- return getInstance().getChild(url.getPath());
+ try
+ {
+ return getRoot(url.toURI());
+ }
+ catch (URISyntaxException e)
+ {
+ IOException ioe = new IOException();
+ ioe.initCause(e);
+ throw ioe;
+ }
}
/**
@@ -102,8 +113,9 @@
*
* @param uri the uri
* @return the file matching uri
+ * @throws IOException if there is a problem accessing the VFS
*/
- public static VirtualFile getRoot(URI uri)
+ public static VirtualFile getRoot(URI uri) throws IOException
{
return getInstance().getChild(uri.getPath());
}
@@ -170,13 +182,13 @@
*
* @param path the child path
* @return the child
- * @throws IOException for any problem accessing the VFS
* @throws IllegalArgumentException if the path is null
*/
public VirtualFile getChild(String path)
{
if (path == null)
throw new IllegalArgumentException("Null path");
+
return rootVirtualFile.getChild(path);
}
More information about the jboss-cvs-commits
mailing list