Create a directory

This snippet shows how to create new directories in groovy.


Create a directory with the name “new”.

new File("new").mkdir()

Created a nested directory structure.

new File("dir/sub").mkdirs()