Detecting groovy version
Determine the groovy version in a script.
(more…)
Opening an URL with a proxy
Set proxy config.
Save URL to file
Simple example how to save an image from the net to a local file.
(more…)
Command line interface with CommandLine Builder
Simple example of the groovy commandline builder.
Search in zipfile
This example will search for 1.txt in the zipfile test.zip and print out the result.
Examples of using range or a list in a switch statement
This are two examples of using ranges in switch statements.
Connect to a MySQL database
Simple snippet for a connection to a MySQL database.
List the methods of a groovy class
This snippet show how to get a list of all methods in a groovy class.
(more…)
CSV parser with groovy categories
This shows how categories in groovy can be used to create a simple csv parser.
(more…)
Measure execution time with a closure
Measures the execution time with a closure.
(more…)