Commons VFS
  1. Commons VFS
  2. VFS-259

Http and Webdav FIleContentInfoFactory: undress to AbstractFileObject before casting

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Labels:
      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.

        Activity

        Hide
        Marek Zawirski added a comment -

        Patch for HttpFileContentInfoFactory/WebdavFileContentInfoFactory: use FileObjectUtils.getAbstractFileObject() before casting

        Show
        Marek Zawirski added a comment - Patch for HttpFileContentInfoFactory/WebdavFileContentInfoFactory: use FileObjectUtils.getAbstractFileObject() before casting
        Hide
        Ralph Goers added a comment -

        Patch applied. Please verify and close.

        Show
        Ralph Goers added a comment - Patch applied. Please verify and close.

          People

          • Assignee:
            Unassigned
            Reporter:
            Marek Zawirski
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development