Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4247

New method: File.renameTo(String path)

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.4, 1.8-beta-1
    • Component/s: groovy-jdk
    • Labels:
      None

      Description

      Currently File's renameTo takes in a File object. I think it would be groovier to allow a String to be passed in representing the rename - having to create a File to rename to seems a little strange.

      Something like,

      public boolean renameTo(String path)
      {
      return this.renameTo(new File(path))
      }

      Calling code now becomes,

      file.renameTo("/somewhere/file.txt")

      instead of

      file.renameTo(new File("/somewhere/file.txt"))

        Attachments

          Activity

            People

            • Assignee:
              roshandawrani Roshan Dawrani
              Reporter:
              sproaty Steven Sproat
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 20m
                20m
                Remaining:
                Remaining Estimate - 20m
                20m
                Logged:
                Time Spent - Not Specified
                Not Specified