Java provides standard Zip and GZip Outputstream using which you can compress the files. Or, you can go for 3rd Party libraries like Apache Commons Compress.