List all directories with a specific name

This groovy snippet lists all directories named “bar” in the “test” directory.
(more…)

List files recursively

The following groovy example shows how to recursively list all *.txt files in a directory.
(more…)

Listing a directory the Java way

List the contents of a directory with groovy using the built in methods of Java. The groovy way is described in the following snippetsList files of a specific type, List directory contents and list files recursively.
(more…)

Count lines

Howto count all lines from stdin or a file in groovy.
(more…)

List directory contents with AntBuilder

This shows how to list the content of a directory with AntBuilder.
(more…)

Creating a Zipfile with AntBuilder

This is an example of the groovy antbuilder to create a zipfile.
(more…)

Determine the size of a file

The lengt function prints out the size of a file.

(more…)

Create a directory with AntBuilder

This creates a directory with the groovy AntBuilder.
(more…)

Create a zipfile

Creating a zipfile in groovy is pretty simple.
(more…)

Filter lines

The filterLine returns those lines where the closure returns true.
(more…)