Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 92077 invoked from network); 18 Mar 2004 10:30:40 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 18 Mar 2004 10:30:40 -0000 Received: (qmail 12650 invoked by uid 500); 18 Mar 2004 10:30:10 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 12606 invoked by uid 500); 18 Mar 2004 10:30:10 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 12586 invoked from network); 18 Mar 2004 10:30:10 -0000 Received: from unknown (HELO smtp.ops.co.at) (194.152.182.4) by daedalus.apache.org with SMTP; 18 Mar 2004 10:30:10 -0000 Received: by smtp.ops.co.at (Postfix, from userid 65534) id 0FE6C23C0AB; Thu, 18 Mar 2004 11:30:21 +0100 (CET) Received: from ops.co.at (ts1.int.ops.co.at [172.27.1.101]) by smtp.ops.co.at (Postfix) with ESMTP id B8C1B23C0A4 for ; Thu, 18 Mar 2004 11:30:09 +0100 (CET) Message-ID: <40597A95.3010609@ops.co.at> Date: Thu, 18 Mar 2004 11:31:49 +0100 From: Mario Ivankovits User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: de-de, de-at, de, en-us, en MIME-Version: 1.0 To: Jakarta Commons Developers List Subject: [VFS] Pass down configuration to the file-system layer. Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on smtp.ops.co.at X-Spam-Level: X-Spam-Status: No, hits=0.1 required=5.0 tests=AWL autolearn=ham version=2.61 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Hello ! I implementd the "move file" function into VFS. If the file is on the _SAME_ filesystem a _"RENAME"_ is issued, otherwise the file is copied to the destination and then deleted at the source. I know, if the delete failes, the file is duplicated, but this is the way like some other filemanager work. Before i add the patch to Bugzilla, i would like to solve another problem: The way how the clients within the FileSystem can be configured, they cant now. If you dont want to read all the stuff, jump to my preferred Solution3. Solution1: Add a addConfigurationParameter(String, Object) to the FileSystem object. That way it should be possible to configure e.g. the FTPFileEntryParser in the FTPFileSystem. But the drawback is, that this has to be done at every "FileSystemManager.resolveFile" e.g. FileObject fo = myFileSystemManager.resolveFile("ftp://server/file"); fo.getFileSystem().addConfigurationParameter("FILE_ENTRY_PARSER", myFileEntryParser); Due to the resolveFile does not do anything with the filesystem this works, but this isnt a contract and therefore a very bad design. Solution 2: Add a properties parameter to resolveFile and pass this collection down to the filesystem. Properties properties = new Properties(); FileObject fo = myFileSystemManager.resolveFile("ftp://server/file", properties); The drawback here is: If the filesystem is already created we can not (and should not) change the properies. Solution 3: Add a FileSystemClientFactory interface with the following Method Object FileSystemClientFactory.createClient(FileObject rootURI) An instance of the Factory could be added to the FileSystemManager FileSystemManager fsm = new FileSystemManager(); fsm.setFileSystemClientFactory(new MyFileSystemClientFactory()) FileObject fo = fsm.resolveFile("ftp://server/file"); That way, you could create a FileSystemClientFactory based on the complexity you would like to have. Based on scheme (ftp, http, sftp, ...), server, , ... global, per instance or based on ApplicationThreadLocal. What do you think? Ciao, Mario --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org