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

    XMLWordPrintable

Details

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

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: