Return-Path: X-Original-To: apmail-commons-user-archive@www.apache.org Delivered-To: apmail-commons-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B117910B97 for ; Sun, 5 May 2013 17:00:20 +0000 (UTC) Received: (qmail 21103 invoked by uid 500); 5 May 2013 17:00:19 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 21003 invoked by uid 500); 5 May 2013 17:00:19 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 20995 invoked by uid 99); 5 May 2013 17:00:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 May 2013 17:00:19 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: local policy) Received: from [212.227.126.171] (HELO moutng.kundenserver.de) (212.227.126.171) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 05 May 2013 17:00:13 +0000 Received: from [192.168.178.21] (dslb-088-069-254-166.pools.arcor-ip.net [88.69.254.166]) by mrelayeu.kundenserver.de (node=mreu3) with ESMTP (Nemesis) id 0MKgdv-1UXeZT1tXr-001xsA; Sun, 05 May 2013 18:59:20 +0200 Message-ID: <51868FE7.9060004@oliver-heger.de> Date: Sun, 05 May 2013 18:59:19 +0200 From: Oliver Heger User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 MIME-Version: 1.0 To: Commons Users List Subject: Re: [configuration] Intenttion of class "FileBased" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:u+IlaDsDR8DJirKi/FMqxoLbPgwsap7GVtI+iOVhflk P0HQ/0VW1SXEReN/cOTAocNoPCIiVLTsBeXoYB1QTHqn4cOECh 7V2dZumt1Oob+n8gnNZUVO8ryskksd+owqQJOVb8u40tJTMCxZ hrtDE1D5aK+yHvlmT1lh99LnAKpkDdv0espUHgpIfFS4/yYIK1 xpNchzaAO/MwhYTNh8CVGH4yhTsWRjo0r8XM6SGpOQ+0SM4mL8 FLSSq+JhR64e0lNTYw9RzMse8PxKt6gxjQObYpBd3R7mAq5Jxz oTYeF9bYRweKQTJg5pywjWvNrl200Ry1IPc9Cnl+8JX/kccdEe 4sFdy/CqtWcWnfoaVUrw= X-Virus-Checked: Checked by ClamAV on apache.org Hi Oliver, great to get some feedback on the new re-designed trunk! Am 05.05.2013 01:17, schrieb Oliver Kopp: > Hi, > > I'm working with the trunk version of apache.commons.configuration. There, > FileHandler allows to have passed a "FileBased" object in the constructor. > I thought, I could implement that interface to provide an abstraction to > the underlying file system. However, if I do it htat way, there is an > exception "No file name has been set!". When going through the code, it > seems that this object is the internal data storage for the configuration > and not the external file storage. > > Possibly, just the header comments of this constructor should be updated. > Like sort of saying "this constructor is for internal use only". The purpose of FileHandler is to manage a file description in various formats (File, URL, file name, etc.). It can be associated with a FileBased object which has a read() and a write() method and thus more or less defines the content of the file. The typical usage scenario is that you create a FileHandler and associate it with a FileBased object (all file-based configurations now implement this interface). Then you use some of the set() methods to define the file name. Finally, you can call load() to get the FileBased object loaded. Alternatively, you can use one of the load() methods expecting a parameter (again various parameter types are supported). There is still the FileSystem class which provides an abstraction over concrete file operations. So this is probably the class you are after. (Note: I plan to move this class also into the io package. And maybe it can be a bit simplified.) HTH Oliver > > Cheers, > > Oliver > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org