public static String getText(Path path, Charset charset) throws IOException {
    try(BufferedReader buffered = Files.newBufferedReader(path, charset)) {
      return readFully(buffered);
    }
  }
Returns the text read from the given reader as a String.
Closes the given reader upon return.
spock-core/src/main/java/org/spockframework/util/IoUtil.java