This are the codes that i use to zip up folders but it does not zip up folders and no .zip folder is created.Can someone please help mi to find a solutions.Thanks!Please email mi as soon as possible.or if anyone knows another ways to code for zip folder pls reply mi.

import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
 
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import java.util.zip.ZipException;
 
 
 
 
/**
 * Demo for using the Zip facilities to compress data
 */
 
public class ZipDemo
{
    /** Default buffer size */
    private static final int DEFAULT_BUFFER_SIZE = 4096;
 
 
 
 
    /**
     * Compress a string
     * @param uncompressed string
     * @return byte array containing compressed data
     * @throws IOException if the deflation fails
     */
 
    public static final byte [] compress(final String uncompressed) throws IOException
    {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        GZIPOutputStream zos = new GZIPOutputStream(baos);
 
        byte [] uncompressedBytes = uncompressed.getBytes();
 
        zos.write(uncompressedBytes, 0, uncompressedBytes.length);
        zos.close();
 
        return baos.toByteArray();
    }
 
 
 
 
    /**
     * Uncompress a previously compressed string;
     * this method is the inverse of the compress method.
     * @param byte array containing compressed data
     * @return uncompressed string
     * @throws IOException if the inflation fails
     */
 
    public static final String uncompress(final byte [] compressed) throws IOException
    {
        String uncompressed = "";
 
        try
        {
            ByteArrayInputStream bais = new ByteArrayInputStream(compressed);
            GZIPInputStream zis = new GZIPInputStream(bais);
 
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            int numBytesRead = 0;
            byte [] tempBytes = new byte[DEFAULT_BUFFER_SIZE];
            while ((numBytesRead = zis.read(tempBytes, 0, tempBytes.length)) != -1)
            {
                baos.write(tempBytes, 0, numBytesRead);
            }
 
            uncompressed = new String(baos.toByteArray());
        }
        catch (ZipException e)
        {
            e.printStackTrace(System.err);
        }
 
        return uncompressed;
    }
 
 
 
 
    /**
     * Uncompress a previously compressed string;
     * this method is the inverse of the compress method.
     * Implemented in terms of the byte array version.
     * @param string containing compressed data
     * @return uncompressed string
     * @throws IOException if the inflation fails
     */
 
    public static final String uncompress(final String compressed) throws IOException
    {
        return ZipDemo.uncompress(compressed.getBytes());
    }
 
 
 
    /**
     * Main driver class for ZipDemo
     * @param command line arguments - either string or file name to compress
     */
 
    public static void main(String [] args)
    {
        try
        {
            for (int i = 0; i < args.length; ++i)
            {
                String uncompressed = "";
                File f = new File(args[i]);
 
                if (f.exists())
                {
                    BufferedReader br = new BufferedReader(new FileReader(f));
 
                    String line = "";
                    StringBuffer buffer = new StringBuffer();
 
                    while ((line = br.readLine()) != null)
                        buffer.append(line);
 
                    br.close();
 
                    uncompressed = buffer.toString();
                }
                else
                {
                    uncompressed = args[i];
                }
 
                System.out.println("length before compression: " + uncompressed.length());
 
                byte [] compressed = ZipDemo.compress(uncompressed);
 
                System.out.println("length after compression : " + compressed.length);
 
                String compressedAsString = new String(compressed);
                System.out.println("length of compressed str : " + compressedAsString.length());
 
                byte [] bytesFromCompressedAsString = compressedAsString.getBytes();
 
                boolean isTheSameAs = bytesFromCompressedAsString.equals(compressed);
                System.out.println("compressed bytes are " + (isTheSameAs ? "" : "not ") + "the same as from String");
                System.out.println("length of bytesFrom...: " + bytesFromCompressedAsString.length);
 
                String restored = ZipDemo.uncompress(compressed);
 
                System.out.println("length after decompress : " + restored.length());
 
                isTheSameAs = restored.equals(uncompressed);
                System.out.println("original is " + (isTheSameAs ? "" : "not ") + "the same as the restored");
 
                String restoredFromString = ZipDemo.uncompress(compressedAsString);
                isTheSameAs = restoredFromString.equals(uncompressed);
                System.out.println("original is " + (isTheSameAs ? "" : "not ") + "the same as the restored from string");
            }
        }
        catch (Exception e)
        {
            e.printStackTrace(System.err);
        }
    }
}