In this chapter, we will cover:
Groovy offers many shortcuts for dealing with files and directories. Mundane tasks such as listing, copying, renaming, and deleting files are elegantly executed by Groovy, thanks to the methods added to the standard JDK classes such as java.io.File
. This chapter's recipes are all about I/O with Groovy, from simple cases such as reading a file to more complex endeavors, such as mining data from a PDF file or an Excel spreadsheet. The Java build tool Ant makes a cameo appearance in this chapter as well. Groovy and Ant are tightly integrated and we will discover some of the tasks made available through this marriage.