File Compression

14 / Feb / 2011 by Anshul Sharma 0 comments

Creating a zip file using AntBuilder.

        def ant = new AntBuilder()
        ant.zip(
                destfile: destPath,
                basedir: basePath,
                includes: includeFiles, // Comma seperated file names
                excludes: excludeFiles, // Comma seperated file names
                level: 9     // maximum compression
        )

 
For unzipping the file:

        def ant = new AntBuilder();
        ant.unzip(
		src: srcPath,
                dest: destDir,
                overwrite: "true"
	)

 

Hope this helped!

Cheers!

Anshul Sharma

Tag -

FOUND THIS USEFUL? SHARE IT

Leave a comment -