samyedit
Class Zip

java.lang.Object
  extended by samyedit.Zip

public class Zip
extends java.lang.Object

defines basic zip archive functions:

compress: create a zip file and store all files of a given directory into it
decompress: extract all files found in an zip file into a given directory

Author:
rayzyt

Constructor Summary
Zip()
           
 
Method Summary
static int compress(java.lang.String zipfile, java.lang.String directory)
          stores all file found in targetDir into the archive specified
static int decompress(java.lang.String archive, java.lang.String targetDir)
          extracts all file found in archive into the targetDir
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Zip

public Zip()
Method Detail

compress

public static int compress(java.lang.String zipfile,
                           java.lang.String directory)
stores all file found in targetDir into the archive specified

Parameters:
zipfile - file to be created
directory - directory of which all files will be compressed into the zipfile
Returns:
number of files stored in the archive

decompress

public static int decompress(java.lang.String archive,
                             java.lang.String targetDir)
extracts all file found in archive into the targetDir

Parameters:
archive - file to be extracted
targetDir - directory directory of which all files will be compressed into the zipfile
Returns:
number of files extracted off the archive