[jboss-user] [JBoss Microcontainer Development] New message: "Re: Issues with vfs30 MountHandle"

Thomas Diesler do-not-reply at jboss.com
Tue Mar 16 12:53:16 EDT 2010


User development,

A new message was posted in the thread "Issues with vfs30 MountHandle":

http://community.jboss.org/message/532322#532322

Author  : Thomas Diesler
Profile : http://community.jboss.org/people/thomas.diesler@jboss.com

Message:
--------------------------------------------------------------
John says:
 
> When
> a URL points to a directory, you can not call InputStream.read and
> expect to get bytes back. Once the JAR is mounted in VFS it becomes a
> directory. 
> 
> 
> 
> 
> If you need this to act as a File, then either:
> 
> 
> 1.  Don't mount and use a JarFile
> 
> 
> 2.  When mounting, retain the MountHandle and call getMountSource to get a handle to the actual file 
> 
> 
> 
> 
> 
> 
>     
>     
>     [ https://jira.jboss.org/jira/browse/JBVFS-147 ]
>     
> 
>     
>                 https://jira.jboss.org/jira/secure/ViewProfile.jspa?name=johnbailey - 15/Mar/10 09:56 AM
> When a URL points to a directory, you can not call InputStream.read and
> expect to get bytes back. Once the JAR is mounted in VFS it becomes a
> directory. If you need this to act as a File, then either:
> 1. Don't mount and use a JarFile
> 2. When mounting, retain the MountHandle and call getMountSource to get
> a handle to the actual file 
>     
> 
> 
> 
> 
> 
> 
>             
>         
>             
>             
> This needs to be handled correctly by the caller. 
> 
> 
 
Did you consider the case where I might not be the first who sees the file? 
 
 In case of the structure deployer processing there might be an AbstractVFSArchiveStructureDeployer processing the vfile before my AbstractVFSStructureDeployer sees it. When I see the vfile it might already be mounted. In that case how do I get hold of the MountHandle? 
 
Generally, I believe that vfile.getChild(), vfile.openStream() and friends should behave in a deterministic way independent of what processing another component did previously. 
 
 One possible way out of this might be to always provide access to the "virgin" source of the vfile.
 
David says
> If
> you're not the first, then you do not have the right to access the
> archive, period. It's indistinguishable from a directory, and should be
> treated as such IMO. 
> 
> 
> 
> 
> 
> 
>     
>     
>     [ https://jira.jboss.org/jira/browse/JBVFS-147 ]
>     
> 
>     
>                 https://jira.jboss.org/jira/secure/ViewProfile.jspa?name=david.lloyd%40jboss.com - 15/Mar/10 11:15 AM
> If you're not the first, then you do not have the right to access the
> archive, period. It's indistinguishable from a directory, and should be
> treated as such IMO. 
>     
> 
 
AFAICS, I cannot control whether I am the first (nor should I). In case I am not the first, the deployment may already have been transformed into a directory and I cannot access the archive any more.
 
This seem to be a general issue of who comes fist + mounting prevents access to original archive.
[ https://jira.jboss.org/jira/browse/JBVFS-147 ]
https://jira.jboss.org/jira/secure/ViewProfile.jspa?name=david.lloyd%40jboss.com - 15/Mar/10 11:15 AM If you're not the first, then you do not have the right to access the archive, period. It's indistinguishable from a directory, and should be treated as such IMO.

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/532322#532322




More information about the jboss-user mailing list