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…)

List directory contents with AntBuilder

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

Create random integers in a specific range

For example you would like to create 10 pseudo random numbers between 0 and 10.
(more…)

Create random integers

This will create 10 random integers an put the in a list.
(more…)

Directory contents as Ascii tree

This shows how to print the contents of a directory as an Ascii tree. The output is similar to the ls -tree command under Unix/Linux.
(more…)

List the contents of a zip file

This snippets shows how to list the contents of a zip file.
(more…)