JBoss development,
A new message was posted in the thread "VFS3 and symlinks":
http://community.jboss.org/message/528926#528926
Author : Jason Greene
Profile :
http://community.jboss.org/people/jason.greene@jboss.com
Message:
--------------------------------------------------------------
johnbailey wrote:
After discussing with Jason on IRC, it seems any behavior related to symbolic link
support would really have to rely in the FileSystem instances. The FileSystem instances
may need to support symbolic links in different ways, or not at all. Handling symbolic
links in the VFS or VirtualFile classes would break certain functionality allowing
FileSystems to be mounted at any path.
Ex.
RealPath --> /real/path/to/archive.jar
SymLinkedPath --> /link/to/archive.jar ('link' is symlink to /real/path)
If you mount mount any FileSystem (maybe real, zip, assembled ...) at '/link' in
the VFS, regardless of if it has anything to do with 'archive.jar', it would not
be possible to get to the contents of the FileSystem if you force paths to be canonical
in the VFS or VirtualFile layer. It would take the VFS path and convert it to the
canonical path, and never get to the mounted FileSystem. In essence, the FileSystem does
not exist in the VFS.
What would make sense is if you asked a RealFileSystem for a specific path and it does
the JDK File based canonical path conversion automatically. There may not necessarily be
any other FileSystem that supports it, but there is nothing stopping a specific FileSystem
from adding support.
So I think it just makes sense to make sure we aren't switching between path types,
and just leave it to the FileSystems to support it.
Where symlinks on vfs really
break down is relative paths. If you have a symlink in a mount's root that points to
"../sibling.jar", then it should refer to the parent of the mount in VFS.
Unfortunately we don't know what a symlink points to since java doesn't know. If
we could, however, read the link (say via an lstat call), it would be possible to
canonicalize them correctly. We could bundle a JNI module that would allow for
RealFileSystem to pull the link info, however, that would be a big effort for an uncommon
feature. IMO we should wait to see if there is demand for it, and add it later.
--------------------------------------------------------------
To reply to this message visit the message page:
http://community.jboss.org/message/528926#528926