[jboss-jira] [JBoss JIRA] (AS7-4607) Cannot get bytes from InputStream for DEPLOYMENT_ROOT VirtualFile.openStream() on second call
Thomas Diesler (JIRA)
jira-events at lists.jboss.org
Tue Apr 24 11:04:18 EDT 2012
[ https://issues.jboss.org/browse/AS7-4607?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Diesler updated AS7-4607:
--------------------------------
Description:
The effect is that the copy of a installed OSGi bundle is 0bytes in the data/osgi-store area
Digging into this shows that during the first call isDirectory() is false and the file gets mounted. The returned stream works fine. For the second call isDirectory() is true and e read() on the returned InputStream returns -1
{code}
public InputStream openStream() throws IOException {
if(isDirectory()) {
return new VirtualJarInputStream(this);
}
final VFS.Mount mount = VFS.getMount(this);
return mount.getFileSystem().openInputStream(mount.getMountPoint(), this);
}
{code}
I assume that the root VirtualFile
{code}
VirtualFile virtualFile = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
{code}
should be readable twice.
was:
The effect is that the copy of a installed OSGi bundle is 0bytes in the data/osgi-store area
Digging into this shows that during the first call isDirectory() is false and the file gets mounted. The returned stream works fine. For the second call isDirectory() is true and e read() on the returned InputStream returns -1
{code}
public InputStream openStream() throws IOException {
if(isDirectory()) {
return new VirtualJarInputStream(this);
}
final VFS.Mount mount = VFS.getMount(this);
return mount.getFileSystem().openInputStream(mount.getMountPoint(), this);
}
{code}
> Cannot get bytes from InputStream for DEPLOYMENT_ROOT VirtualFile.openStream() on second call
> ---------------------------------------------------------------------------------------------
>
> Key: AS7-4607
> URL: https://issues.jboss.org/browse/AS7-4607
> Project: Application Server 7
> Issue Type: Bug
> Components: OSGi, Server
> Reporter: Thomas Diesler
> Assignee: Jason Greene
>
> The effect is that the copy of a installed OSGi bundle is 0bytes in the data/osgi-store area
> Digging into this shows that during the first call isDirectory() is false and the file gets mounted. The returned stream works fine. For the second call isDirectory() is true and e read() on the returned InputStream returns -1
> {code}
> public InputStream openStream() throws IOException {
> if(isDirectory()) {
> return new VirtualJarInputStream(this);
> }
> final VFS.Mount mount = VFS.getMount(this);
> return mount.getFileSystem().openInputStream(mount.getMountPoint(), this);
> }
> {code}
> I assume that the root VirtualFile
> {code}
> VirtualFile virtualFile = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT).getRoot();
> {code}
> should be readable twice.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list