title: Is there a clean way to use Groovy's extension methods in Kotlin?
body: <p>For example, Groovy allows to get text of a file represented by <code>java.nio.file.Path</code> as follows:</p>
  
  
  
  <pre><code>// Groovy code
  import java.nio.file.Path
  import java.nio.file.Paths
  
  Path p = Paths.get("data.txt")
  String text = p.text
  </code></pre>
  
  <p>I would like to be able to reuse Groovy's <code>text</code> extension method in Kotlin.</p>
  
  <p><strong>Please note</strong>: I know <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io/java.io.-file/read-text.html" rel="nofollow">Kotlin has a related method</a> for this particular case. Still, there might be Groovy methods which are useful for Kotlin users.</p>