Skip to end of metadata
Go to start of metadata

 Groovy recipes for every day!

 Today is the File Day !

List my imported packages

Today: I get a list of imported package into my old groovy scripts !

Output

D:\groovy getImports.groovy
d:\scripts\testCom.groovy
   org.codehaus.groovy.scriptom.ActiveXProxy
d:\scripts\testDurableSubscriber.groovy
   javax.jms.*;
   org.apache.activemq.ActiveMQConnectionFactory;
   org.apache.activemq.command.ActiveMQTopic;
d:\scripts\testJmsBroker.groovy
   javax.jms.*;
   org.apache.activemq.ActiveMQConnectionFactory;
   org.apache.activemq.command.ActiveMQTopic;

Clean old files

 today: Oh jeez! I get on my SysAdmin's nerves, file System /data is full!  ..  I have to clean all these useless daily reports !

Saved! My SysAdmin loves me, it's sure (smile)

Recursively deleting files and directories.

Today is a recursive day ! We have a bunch of files and directories to delete, let's go!

the Ant way

Don't forget this old java swiss knife...

the Groovy Way

An Even Groovier Way

Using the Groovy JDK extensions to File