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

AbstractFileObject canRenameTo method is incorrect

    XMLWordPrintableJSON

    Details

      Description

      AbstractFileObject is written like this:

      public boolean canRenameTo(FileObject newfile)
      {
      if (getFileSystem() == newfile.getFileSystem())

      { return true; }

      return false;
      }

      So when you move a File inside the same filesystem, Apache VFS thinks it is on another filesystem.

      Thus, the file is copied instead of being moved.

      getFileSystem().equals(newFile.getFileSystem()) should be used instead.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pyfourmond P-Y Fourmond
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: