commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ima...@apache.org>
Subject Re: [VFS] How to resolve all local files relative to a chroot dir ?
Date Tue, 09 Nov 2004 09:10:42 GMT
info wrote:

>is there anyone can give me some hints how to resolve all absolute
>and relative paths versus a chroot (jail) directory with VFS ?
>  
>
Looks like I was not quite true what I told you in my last post.

You can use the VirtualFileSystem to archive this behaviour:

        FileSystemManager sm = VFS.getManager();
        FileObject fo = sm.resolveFile("file:/home/im/projects");
        FileObject foVirt = sm.createVirtualFileSystem(fo);

If you try to resolve using a relative Path outside "fo" you get an 
"FileSystemException: Invalid relative file name."

Hope this helps!

-- 
Mario


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message