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 07:06:59 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 ?
>  
>
Currently VFS do not provide a "chroot" functionallity.

The only thing you can do is setting a "baseFile" on the FileSystemManager.

        StandardFileSystemManager sm = new StandardFileSystemManager();
        sm.init();
        sm.setBaseFile(new File("/home/im"));
        FileObject fo = sm.resolveFile("projects");
        System.err.println(fo.getName().getURI());

Now the resolveFile resolves by taking the baseFile into account, but 
the user can break out of the jail.

-- 
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