Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0
-
None
Description
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.