Andrey Hihlovskiy

Professional blog on groovy, gradle, Java, Javascript and other stuff.

Tag Archives: software

Gretty 0.0.8 is out!

I released Gretty version 0.0.8!

New: support of “jetty.xml” and “jetty-env.xml”.

Gretty is gradle plugin for running web-applications under jetty 7, 8 and 9 and servlet API 2.5, 3.0.1 and 3.1.0. It greatly simplifies and accelerates web-application development by providing:

  • hot-deployment
  • war-overlays
  • java debugger support
  • jetty security realms support
  • jetty.xml and jetty-env.xml support
  • slf4j/logback support

The complete sources and documentation are available at https://github.com/akhikhl/gretty

The compiled jars are in maven central under group 'org.akhikhl.gretty'

Fun with groovy files

The following one-liner can copy very large files without running out of memory:

new File("test").withInputStream { new File("test2") << it }

Just tested it in groovy console – 1 GB file is copied in 5 seconds, memory consumption stays low.
The copy is binary, i.e. it copies bytes, not chars.
One particularity: left-shift operator rather appends than overwrites. If you need to overwrite the file, first need to delete it.