[VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

Carl Eric Codere
Greetings,                I am interested in using the VFS library for one of my projects, as it has almost everything I need, but i have some questions on it though.
My use case is as follows:* For the local file system, I use DESCRIPT.ION files to store attributes of files and directories, so I would need to override some methods of DefaultFileInfo() , mainly all the attribute related functions. How can I set my own FileInfo provider? I did not find any API in the interfaces to do this, maybe, i missed something.
* The same is true of FileContent, how can I set my own FileContentInfo provider in FileContent ? I would probably use a feature of JDK 1.6 (the FileTypeMap class) to override the default implementation.

Finally an unrelated question, why you do not use the DataSource interface in FileObject available in JDK 1.6, is it because of Android compatibility issues?
Thanks in advance for your help,Carl




 
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

garydgregory
Hi Carl,

Do you mean org.apache.commons.vfs2.impl.DefaultFileContentInfo
and org.apache.commons.vfs2.impl.FileContentInfo?

Ralph, do have issue as to make this pluggable?

Gary

On Mon, Sep 25, 2017 at 8:31 AM, Carl Eric Codere <[hidden email]
> wrote:

> Greetings,                I am interested in using the VFS library for one
> of my projects, as it has almost everything I need, but i have some
> questions on it though.
> My use case is as follows:* For the local file system, I use DESCRIPT.ION
> files to store attributes of files and directories, so I would need to
> override some methods of DefaultFileInfo() , mainly all the attribute
> related functions. How can I set my own FileInfo provider? I did not find
> any API in the interfaces to do this, maybe, i missed something.
> * The same is true of FileContent, how can I set my own FileContentInfo
> provider in FileContent ? I would probably use a feature of JDK 1.6 (the
> FileTypeMap class) to override the default implementation.
>
> Finally an unrelated question, why you do not use the DataSource interface
> in FileObject available in JDK 1.6, is it because of Android compatibility
> issues?
> Thanks in advance for your help,Carl
>
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

garydgregory
In reply to this post by Carl Eric Codere
Hi Carl,

WRT DataSource, this is a JDBC interface, which does not seem appropriate
for a file system. Or do you mean javax.activation.DataSource. Apache
Commons VFS was started a long time ago and not adapted to newer JREs in
this area (obviously.)

Gary


On Mon, Sep 25, 2017 at 8:31 AM, Carl Eric Codere <[hidden email]
> wrote:

> Greetings,                I am interested in using the VFS library for one
> of my projects, as it has almost everything I need, but i have some
> questions on it though.
> My use case is as follows:* For the local file system, I use DESCRIPT.ION
> files to store attributes of files and directories, so I would need to
> override some methods of DefaultFileInfo() , mainly all the attribute
> related functions. How can I set my own FileInfo provider? I did not find
> any API in the interfaces to do this, maybe, i missed something.
> * The same is true of FileContent, how can I set my own FileContentInfo
> provider in FileContent ? I would probably use a feature of JDK 1.6 (the
> FileTypeMap class) to override the default implementation.
>
> Finally an unrelated question, why you do not use the DataSource interface
> in FileObject available in JDK 1.6, is it because of Android compatibility
> issues?
> Thanks in advance for your help,Carl
>
>
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

Carl Eric Codere
In reply to this post by garydgregory
Greetings,             Thanks for your quick reply!  Yes, you are correct.  I would like to have a way to change the provider, I would subclass the implementation that you have and use that as content and contentInfo provider. Otherwise, if its not the case, currently i need to reimplement everything, right?
              
        Best regards,Carl

      From: Gary Gregory <[hidden email]>
 To: Commons Users List <[hidden email]>; Carl Eric Codere <[hidden email]>
 Sent: Monday, September 25, 2017 5:07 PM
 Subject: Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?
   
Hi Carl,

Do you mean org.apache.commons.vfs2.impl.DefaultFileContentInfo
and org.apache.commons.vfs2.impl.FileContentInfo?

Ralph, do have issue as to make this pluggable?

Gary

On Mon, Sep 25, 2017 at 8:31 AM, Carl Eric Codere <[hidden email]
> wrote:

> Greetings,                I am interested in using the VFS library for one
> of my projects, as it has almost everything I need, but i have some
> questions on it though.
> My use case is as follows:* For the local file system, I use DESCRIPT.ION
> files to store attributes of files and directories, so I would need to
> override some methods of DefaultFileInfo() , mainly all the attribute
> related functions. How can I set my own FileInfo provider? I did not find
> any API in the interfaces to do this, maybe, i missed something.
> * The same is true of FileContent, how can I set my own FileContentInfo
> provider in FileContent ? I would probably use a feature of JDK 1.6 (the
> FileTypeMap class) to override the default implementation.
>
> Finally an unrelated question, why you do not use the DataSource interface
> in FileObject available in JDK 1.6, is it because of Android compatibility
> issues?
> Thanks in advance for your help,Carl
>
>
>
>
>
>


   
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

Carl Eric Codere
In reply to this post by garydgregory
Greetings,
                 Yes, I was talking about javax.activation.DataSource, which seems to be consistent with what you are doing, but it does not seem to have available in Android i think, so it could be an issue, also same for FileTypeMap, thanks for the clarification.
Best regards,Carl

      From: Gary Gregory <[hidden email]>
 To: Commons Users List <[hidden email]>; Carl Eric Codere <[hidden email]>
 Sent: Monday, September 25, 2017 5:10 PM
 Subject: Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?
   
Hi Carl,

WRT DataSource, this is a JDBC interface, which does not seem appropriate
for a file system. Or do you mean javax.activation.DataSource. Apache
Commons VFS was started a long time ago and not adapted to newer JREs in
this area (obviously.)

Gary


On Mon, Sep 25, 2017 at 8:31 AM, Carl Eric Codere <[hidden email]
> wrote:

> Greetings,                I am interested in using the VFS library for one
> of my projects, as it has almost everything I need, but i have some
> questions on it though.
> My use case is as follows:* For the local file system, I use DESCRIPT.ION
> files to store attributes of files and directories, so I would need to
> override some methods of DefaultFileInfo() , mainly all the attribute
> related functions. How can I set my own FileInfo provider? I did not find
> any API in the interfaces to do this, maybe, i missed something.
> * The same is true of FileContent, how can I set my own FileContentInfo
> provider in FileContent ? I would probably use a feature of JDK 1.6 (the
> FileTypeMap class) to override the default implementation.
>
> Finally an unrelated question, why you do not use the DataSource interface
> in FileObject available in JDK 1.6, is it because of Android compatibility
> issues?
> Thanks in advance for your help,Carl
>
>
>
>
>
>


   
Reply | Threaded
Open this post in threaded view
|

Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

garydgregory
In reply to this post by Carl Eric Codere
I'm curious at what Ralph thinks. You could consider providing a PR to add
the feature to make the class pluggable and see how much code that
touches...

Gary

On Mon, Sep 25, 2017 at 10:23 AM, Carl Eric Codere <
[hidden email]> wrote:

> Greetings,             Thanks for your quick reply!  Yes, you are
> correct.  I would like to have a way to change the provider, I would
> subclass the implementation that you have and use that as content and
> contentInfo provider. Otherwise, if its not the case, currently i need to
> reimplement everything, right?
>
>         Best regards,Carl
>
>       From: Gary Gregory <[hidden email]>
>  To: Commons Users List <[hidden email]>; Carl Eric Codere <
> [hidden email]>
>  Sent: Monday, September 25, 2017 5:07 PM
>  Subject: Re: [VFS] How to override a FileContent / FileContentInfo
> provider for an existing filesystem?
>
> Hi Carl,
>
> Do you mean org.apache.commons.vfs2.impl.DefaultFileContentInfo
> and org.apache.commons.vfs2.impl.FileContentInfo?
>
> Ralph, do have issue as to make this pluggable?
>
> Gary
>
> On Mon, Sep 25, 2017 at 8:31 AM, Carl Eric Codere
> <[hidden email]
> > wrote:
>
> > Greetings,                I am interested in using the VFS library for
> one
> > of my projects, as it has almost everything I need, but i have some
> > questions on it though.
> > My use case is as follows:* For the local file system, I use DESCRIPT.ION
> > files to store attributes of files and directories, so I would need to
> > override some methods of DefaultFileInfo() , mainly all the attribute
> > related functions. How can I set my own FileInfo provider? I did not find
> > any API in the interfaces to do this, maybe, i missed something.
> > * The same is true of FileContent, how can I set my own FileContentInfo
> > provider in FileContent ? I would probably use a feature of JDK 1.6 (the
> > FileTypeMap class) to override the default implementation.
> >
> > Finally an unrelated question, why you do not use the DataSource
> interface
> > in FileObject available in JDK 1.6, is it because of Android
> compatibility
> > issues?
> > Thanks in advance for your help,Carl
> >
> >
> >
> >
> >
> >
>
>
>