[jboss-jira] [JBoss JIRA] Commented: (JBVFS-147) Cannot read from vfs: protocol URL

John Bailey (JIRA) jira-events at lists.jboss.org
Tue Mar 9 09:40:58 EST 2010


    [ https://jira.jboss.org/jira/browse/JBVFS-147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12518930#action_12518930 ] 

John Bailey commented on JBVFS-147:
-----------------------------------

As mentioned in JBVFS-142, this will not work for a mounted JAR.  Once a JAR is mounted into VFS, it becomes a directory in VFS.  So the you will not be read it will a conventional InputStream.  You will actually be getting a VirtualJarInputStream, which functions as a JarInputStream, so you would need to cast the input stream call getNextEntry for each entry.  For the code you have written in the description, you could make it work by just using a file: URL in place of the vfs: ULR.  This will delegate to the real filesytem, and you should be able to read the JAR in as a standard file.

> Cannot read from vfs: protocol URL
> ----------------------------------
>
>                 Key: JBVFS-147
>                 URL: https://jira.jboss.org/jira/browse/JBVFS-147
>             Project: JBoss VFS
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.0.0.CR3
>            Reporter: Thomas Diesler
>            Assignee: John Bailey
>             Fix For: 3.0.0.CR4
>
>
> Cannot read bytes from vfs: protocol URL
> URL url = new URL("vfs:/home/tdiesler/svn/jboss-osgi/projects/testing/trunk/target/test-libs/example-simple.jar/");
> URLConnection con = (URLConnection)url.openConnection();
> InputStream inputStream = con.getInputStream();
> int read = inputStream.read();
> read is -1

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list