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

new readText() and maybe writeText() methods on File, InputStream, Reader

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-beta-4
    • None
    • None

    Description

      How about readText()? We've already got this...

      file = new File("foo.txt")
      List list = file.readLines()

      maybe we should have this too

      String text = file.readText()

      Then you could do something simple like

      file = new File("foo.txt")
      text = file.readText()
      text.replace("foo", "bar")
      file.writeText(text)

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            jstrachan James Strachan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: