Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 4353 invoked from network); 14 Nov 2005 09:14:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Nov 2005 09:14:05 -0000 Received: (qmail 43231 invoked by uid 500); 14 Nov 2005 09:13:59 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 43195 invoked by uid 500); 14 Nov 2005 09:13:58 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 43184 invoked by uid 99); 14 Nov 2005 09:13:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2005 01:13:57 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of mario@ops.co.at designates 194.152.182.4 as permitted sender) Received: from [194.152.182.4] (HELO smtp.ops.co.at) (194.152.182.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2005 01:13:49 -0800 Received: by smtp.ops.co.at (Postfix, from userid 65534) id E959723C0AC; Mon, 14 Nov 2005 10:13:34 +0100 (CET) Received: from [172.27.1.102] (lints1.int.ops.co.at [172.27.1.102]) by smtp.ops.co.at (Postfix) with ESMTP id 7358F23C0AB for ; Mon, 14 Nov 2005 10:13:31 +0100 (CET) Message-ID: <4378553B.6010702@ops.co.at> Date: Mon, 14 Nov 2005 10:13:31 +0100 From: Mario Ivankovits User-Agent: Mozilla Thunderbird 1.0 (X11/20041207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: [vfs] File system creation documentation/tutorial References: <2e67829d0511140032h4c18984di715593c13f881adc@mail.gmail.com> In-Reply-To: <2e67829d0511140032h4c18984di715593c13f881adc@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.64 (2004-01-11) on smtp.ops.co.at X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, hits=-18.1 required=7.0 tests=AWL,BAYES_00,LOCAL_SPAMWORDS, LOCAL_WHITE_RECV_TS1,RATWR10_MESSID,SARE_TOCC_USER autolearn=ham version=2.64 X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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