[
https://issues.apache.org/jira/browse/VFS-259?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ralph Goers resolved VFS-259.
-----------------------------
Resolution: Fixed
Patch applied. Please verify and close.
> 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.