commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felipe Crochik <felipecroc...@gmail.com>
Subject Re: [VFS] access the same file in different file systems with a relative path
Date Fri, 30 Sep 2005 13:45:38 GMT
Mario,
 I did not want to create a new provider. I wanted to verify if that was a
way to define a "root" for the provider in the providers.xml file. I would
also need to define default user and password for some of them. Something
like:

<provider class-name="org.apache.commons.vfs.provider.ftp.FtpFileProvider">
 <username="username"/>
 <password="password"/>
 <root="/root/"/>
<scheme name="SCHEMA1"/>
<if-available class-name="org.apache.commons.net.ftp.FTPFile"/>
</provider>

I don't know if you have any way to do that. Is there any?
 Thanks for the reply
Felipe
 On 9/30/05, Mario Ivankovits <mario@ops.co.at> wrote:
>
> Felipe Crochik wrote:
> >resolveFile("SCHEMA1:somefolder/somefile.someextension") and have the
> >SCHEMA1 defined in the providers.xml
> Sure, you can create your own FileProvider which then routes to the real
> FileProvider. See: ResourceFileProvider.java
>
>
> But isnt it a little bit of overkill?
>
> You could also simply resolve the root-folder:
>
> FileObject foRoot = VFS.getManager().resolveFile("http://path/to/root/");
>
> and then use this root to resolve all relative paths:
>
> FileObject fo = foRoot.resolveFile("path/from/database/file.txt");
>
>
> ---
> Mario
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message