Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-259

Http and Webdav FIleContentInfoFactory: undress to AbstractFileObject before casting

    XMLWordPrintableJSON

Details

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

      Attachments

        Activity

          People

            Unassigned Unassigned
            mzawirski Marek Zawirski
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: