/*
 * @(#)ArchiveDecompresssedEvent.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;
import java.util.EventObject;

/**
 * Fired when a archive file is decompressed.
 */
public class ArchiveDecompressedEvent
        extends EventObject {

    /**
     * The serial version.
     */
    private static final long serialVersionUID = -2669016231815638504L;
    /**
     * The instance of the decompressed file.
     */
    private File file;

    /**
     * Creates <code>ArchiveDecompressedEvent</code>.
     *
     * @param source the source of the event
     * @param file   the decompressed file.
     */
    public ArchiveDecompressedEvent(final Object source, final File file) {
        super(source);
        this.file = file;
    }

    /**
     * Gets the decompressed file.
     *
     * @return File the instance of the decompressed file.
     */
    public File getFile() {
        return this.file;
    }

    /**
     * Method accept.
     *
     * @param listener listener
     */
    public void accept(final ArchiveListener listener) {
        if (listener != null) {
            listener.decompressed(this);
        }
    }
}
