title: Reactive way to read and parse file from resources using WebFlux?
body: <p>I wonder what is the correct way to read, parse and serve a file from resources.</p>
  
  <p>Currently, I do something like this:</p>
  
  <pre><code>fun getFile(request: ServerRequest): Mono&lt;ServerResponse&gt; {
      val parsedJson =
          objectMapper.readValue(readFile("fileName.json"), JsonModel::class.java)
  
      // modify parsed json
  
      return ok().contentType(APPLICATION_JSON).bodyValue(parsedJson)
  }
  
  private fun readFile(fileName: String) =
      DefaultResourceLoader()
          .getResource(fileName)
          .inputStream.bufferedReader().use { it.readText() }
  </code></pre>
  
  <p>I've noticed <a href="https://netty.io/4.1/api/io/netty/handler/codec/json/JsonObjectDecoder.html" rel="nofollow noreferrer">JsonObjectDecoder</a> class in Netty, but I don't know if can be applied to my use case.</p>
  
  <p>What is the reactive way to do read/parse resource file then?</p>