commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marek Zawirski (JIRA)" <j...@apache.org>
Subject [jira] Created: (VFS-259) Http and Webdav FIleContentInfoFactory: undress to AbstractFileObject before casting
Date Tue, 19 May 2009 13:31:46 GMT
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


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.


Mime
View raw message