[
https://jira.jboss.org/jira/browse/JBVFS-147?page=com.atlassian.jira.plug...
]
John Bailey edited comment on JBVFS-147 at 3/9/10 9:45 AM:
-----------------------------------------------------------
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 you will not be able to read it as 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 (with the VFS trunk).
This will delegate to the real filesytem, and you should be able to read the JAR in as a
standard file.
was (Author: johnbailey):
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