commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mario Ivankovits <ma...@ops.co.at>
Subject Re: [vfs] File system creation documentation/tutorial
Date Mon, 14 Nov 2005 09:13:31 GMT
Hi Robert!
>I recently needed to create a VFS file system implementation for the
>JCommander project. I managed to get something working but it is far from a
>complete implementation. I looked for some documentation on how to do this
>but I couldn't find any.
>  
No documentation available for now.

In short its:

*) Create a FileProvider derived from AbstractOriginatingFileProvider
**) set the capabilities
**) create a filename parser (derive from URLFileNameParser if its url 
based) and setup it in your fileProvider constructor
**) override doCreateFileSystem

*) Create a FileSystem derived from AbstractFileSystem
**) override createFile
**) if you need to handle a connection this is the right place to do 
(see o.a.c.v.p.sftp)
**) implement doCloseCommunicationLink() to close such connections of 
free resources

*) Create a FileObject derived from AbstractFileObject
**) override the do* methods as needed
**) doAttach is meant to attach the object to the resource
**) doDetach is the opposite

*) If you have to deal with options create a config builder derived from 
FileSystemConfigBuilder
**) see SftpFileSystemConfigBuilder as example
**) its idea is to provide a type safe view of the configuration
**) a DelegatingFileSystemOptionsBuilder exists to convert a 
string-key/string-value pair to the correct datatypes if you have to 
process a configuration file or so - see its javadoc for details please


I know, this is a very brief (and maybe useless, though I hope not) 
documentation, but if you take the providers for SFTP and SMB as 
template you might see its not that complicated.

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