Return-Path: Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: (qmail 48917 invoked from network); 19 May 2009 13:34:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 19 May 2009 13:34:08 -0000 Received: (qmail 82690 invoked by uid 500); 19 May 2009 13:34:07 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 82574 invoked by uid 500); 19 May 2009 13:34:07 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 82564 invoked by uid 99); 19 May 2009 13:34:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 May 2009 13:34:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 May 2009 13:34:05 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 8883D234C004 for ; Tue, 19 May 2009 06:33:45 -0700 (PDT) Message-ID: <185392167.1242740025544.JavaMail.jira@brutus> Date: Tue, 19 May 2009 06:33:45 -0700 (PDT) From: "Marek Zawirski (JIRA)" To: issues@commons.apache.org Subject: [jira] Updated: (VFS-259) Http and Webdav FIleContentInfoFactory: undress to AbstractFileObject before casting In-Reply-To: <934093327.1242739906127.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/VFS-259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Marek Zawirski updated VFS-259: ------------------------------- Attachment: FileContentInfoFactory_undress_AbstractFileObject.patch Patch for HttpFileContentInfoFactory/WebdavFileContentInfoFactory: use FileObjectUtils.getAbstractFileObject() before casting > Http and Webdav FIleContentInfoFactory: undress to AbstractFileObject before casting > ------------------------------------------------------------------------------------ > > Key: VFS-259 > URL: https://issues.apache.org/jira/browse/VFS-259 > Project: Commons VFS > Issue Type: Improvement > Affects Versions: 2.0 > Reporter: Marek Zawirski > Fix For: 2.0 > > Attachments: FileContentInfoFactory_undress_AbstractFileObject.patch > > > HttpFileContentInfoFactory and WebdavFileContentInfoFactory assume that FileContent#getFile() will always return AbstractFileObject subclass for them. > However, it may be false assumption: HttpFileObject or WebdavFileObject may be decorated, so even AbstractFileObject#getFileContent() may be decorated, and this FileContent#getFile() too. > Patch proposal for HttpFileContentInfoFactory/WebdavFileContentInfoFactory: instead of direct casting FIleObject to AbstractFileObject subclass, use FileObjectUtils.getAbstractFileObject() before casting. This way it is non-intrusive: decorating FileObject#getFileContent() is allowed while no regression occurs. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.