The Zip package provides services for compressing and decompressing files. The major functionalities offered in the Zip Package are the following:

  • Compress() Compress a file or directory to a archive file.
  • Decompress() Decompress a archive file to a directory.

  • Class Attributes Index

     o ERROR
    Unknown error constant .
     o FILENOTFOUND
    File not found error constant.
     o NOTAFILE
    The input file for Decompress is not a file error constant.
     o NOWRITEPERMISSION
    The output archive file for Compress does not have write permission error constant.
     o OK
    Success return constant.

    Class Methods Index

     o Compress( String outFilename, String inFilename )
    Compress inFilename to an archive file outFilename. inFilename can be a valid file or directory
     o Decompress( String outDirname, String inFilename )
    Decompress archive file,inFilename, to directory, outDirname.

    Class Attributes

     o ERROR
     Error ERROR
    

    Unknown error constant.

     o FILENOTFOUND
     Error FILENOTFOUND
    

    File not found error constant.

     o NOTAFILE
     Error NOTAFILE
    

    The input file for Decompress() is not a file error constant.

     o NOWRITEPERMISSION
     Error NOWRITEPERMISSION
    

    The output archive file for Compress() does not have write permission error constant .

     o OK
     Integer OK
    

    Success return constant.

    Class Methods

     o Compress
     Integer Compress(
                String outFilename,
                String inFilename )
    

    Compress file or directory, inFilename, to an archive file, outFilename.

    Parameters:
    outFilename  -  Name of target archive file.
    inFilename  -  Name of source file or directory to be compressed.
    Returns:
    An Integer indicating the return status. Possible values are:

    OK Compression successful
    FILENOTFOUND inFilename does not exist
    NOWRITEPERMISSION outFilename does not have write permission
    ERROR any other errors
     o Decompress
     Integer Decompress(
                String outDirname,
                String inFilename )
    

    Decompress an archive file, inFilename, to directory, outDirname.

    Parameters:
    outDirname  -  Name of target directory where decompression will occur. If outDirname does not exist then it will be created.
    inFilename  -  Name of source archive file to be decompressed.
    Returns:
    An Integer indicating the return status. Possible values are:

    OK Decompression was successful
    FILENOTFOUND inFilename does not exist
    ERROR any other errors