title: How Groovy can save console output to file?
body: <p>i have a project in Soapui and a groovy code which run all tests of the project.
  The result can be seen in the output console.
  So what i want is to to save the content of the output ina file.</p>
  
  <p>in Java we can do this:</p>
  
  <pre><code>//create a buffered reader that connects to the console, we use it so we can read lines
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
  
        //read a line from the console
        String lineFromInput = in.readLine();
  
        //create an print writer for writing to a file
        PrintWriter out = new PrintWriter(new FileWriter("c:/temp7/output.txt"));
  
        //output to the file a line
        out.println(lineFromInput);
  
        //close the file 
        out.close();
  </code></pre>
  
  <p>Is there an equivalent code in groovy ?
  THank you</p>