[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: JBoss with spaces in the directory name

adrian@jboss.org do-not-reply at jboss.com
Thu Jul 24 07:59:15 EDT 2008


No, we don't want to decode the path unless it is really necessary.
getChild() is already slow enough in parsing the path, see PathTokenizer
on a different thread.

Anyway, I don't know exactly what is going on with the error above.
Try booting jboss-head with the latest jboss-common-core
and you'll see the error message, but dom4j is eating the stacktrace.

If I had to guess, it would be something like the second part of this code,
but this shows another bug (this code loops until it eventually consumes
all heap memory!)

I basically did:
cd ~
mkdir -p temp/spaces\ test
touch temp/spaces\ test/file.txt


  | import java.io.File;
  | import java.net.URI;
  | import java.net.URL;
  | 
  | import org.jboss.virtual.VFS;
  | import org.jboss.virtual.VirtualFile;
  | 
  | public class Test
  | {
  |    public static void main(String[] args) throws Exception
  |    {
  |       File temp = new File("/home/ejort/temp/");
  |       URI uri = temp.toURI();
  |       VirtualFile vf = VFS.getRoot(uri);
  |       System.out.println("vf=" + vf.getChild("spaces test/file.txt"));
  |       
  |       URL url = vf.toURL();
  |       URL file = new URL(url, "spaces%20test/file.txt");
  |       System.out.println("url=" + file);
  |       System.out.println("stream=" + file.openStream());
  |    }
  | }
  | 



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4166390#4166390

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4166390



More information about the jboss-dev-forums mailing list