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

new Groovy stream methods

    XMLWordPrintableJSON

Details

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

    Description

      text = InputStream.readText()
      InputStream.eachLine

      { line | ... }
      InputStream.withReader { reader | ... }
      OutputStream.withwriter { writer | ... }

      This would mean for process execution stuff we could do

      process = "ls -l".execute()
      process.outputStream.eachLine { line | ... }

      process.errorStream.eachLine

      { line | ... }

      In addition it'd be useful to have a helper method on Process

      waitForOrKill(long timeout)

      which would try wait for a certain period of time or kill the given process.

      I hope you don't mind me assiging this one to you Guillaume, by all means assign it back to me or unassign it if you don't fancy doing it.

      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: