/*
 * @(#)Archive.java
 *
 * Copyright (c) JSCAPE LLC.
 *
 * This software is the confidential and proprietary information of
 * JSCAPE. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JSCAPE.
 */
package com.jscape.zip;

import java.io.File;

/**
 * Implements methods for compression and decompression of files.
 */
public interface Archive {

    /**
     * Compresses a file.
     *
     * @param file the file to compress.
     *
     * @throws ArchiveException ArchiveException
     */
    void compress(File file)
            throws ArchiveException;

    /**
     * Compress a file or directory and store to output file
     *
     * @param file   the input file.
     * @param output the output file.
     *
     * @throws ArchiveException
     */
    void compress(File file, File output)
            throws ArchiveException;

    /**
     * Decompress a file into current directory
     *
     * @param file the input file to decompress.
     *
     * @throws ArchiveException
     */
    void decompress(File file)
            throws ArchiveException;

    /**
     * Decompress a file and stores to output file or directory
     *
     * @param file   the archive file to decompress.
     * @param output the output directory or file to decompress to.
     *
     * @throws Exception
     */
    void decompress(File file, File output)
            throws ArchiveException;

    /**
     * Add listener.
     *
     * @param listener
     */
    void addArchiveListener(ArchiveListener listener);

    /**
     * Removes listener.
     *
     * @param listener
     */
    void removeArchiveListener(ArchiveListener listener);

}
