Zippy Direct
Zippy Direct
Zippy Direct
BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class ZippingDirectory
{
static final int BUFFER = 1024;
// Source folder which has to be zipped
static final String FOLDER = "C:\\Users\\Anubhav\\Desktop\\demo folder";
List<File> fileList = new ArrayList<File>();
public static void main(String[] args)
{
ZippingDirectory zf = new ZippingDirectory();
// get list of files
List<File> fileList = zf.getFileList(new File(FOLDER));
//go through the list of files and zip them
zf.zipFiles(fileList);
}