Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6895012

(fs spec) Re-visit Path.copyTo/moveTo spec for case that target exists and is non-empty directory

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P3 P3
    • 7
    • 7
    • core-libs
    • None
    • generic
    • generic

      As noted on the nio-discuss mailing lists, the moveTo method specifies that FileAlreadyExistsException is thrown if:

      "the target file exists and cannot be replaced because the REPLACE_EXISTING option is not specified, or the target file is a non-empty directory"

      The second part covers the "source.moveTo(target, REPLACE_EXISTING)" case and the target is a directory that cannot be replaced because it contains files. This statement should be re-examined. It would be more logical to list DirectoryNotEmptyException as an optional exception for this case. The copyTo method has the same issue.

            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: