Grails

Using Category in groovy

In one of my projects, I needed to save file from a particular url. I found a groovier way of doing this using category. [java] class FileBinaryCategory { def static leftShift(File file, URL url) { url.withInputStream {is -> file.withOutputStream {os -> def bs = new BufferedOutputStream(os) bs << is } } } } [/java] Here, […]

raj
raj
Read
Services