I am trying to read a specific line of an `html` file in a Jenkins `stage` with `Groovy` and save its contents to an environment variable. The problem is, `File` and `readLines()` are not allowed.

I am able to load a file with

```
env.WORKSPACE = pwd()
def file = readFile "${env.WORKSPACE}/file.html"

```

[Provided in this answer](https://stackoverflow.com/a/38679858/5047630)

But how can I access instantly to the contents of line `n`? I am using `Jenkins 2.32`