/*
 * @(#)FtpListingEvent.java
 *
 * Copyright (c) 2001-2002 JScape
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * 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.inet.ftp;

import java.util.Enumeration;

/**
 * Fired when directory listing is retrieved from FTP server.
 */
public class FtpListingEvent
        extends FtpEvent {

    private Enumeration listing;

    /**
     * Creates FtpListingEvent.
     *
     * @param source  the source of the event
     * @param listing an Enumeration of <code>FtpFile</code>
     *
     * @see FtpFile
     */
    public FtpListingEvent(Object source, Enumeration listing) {
        super(source);
        this.listing = listing;
    }

    /**
     * Gets listing.
     *
     * @return an Enumeration of <code>FtpFile</code>
     *
     * @see FtpFile
     */
    public Enumeration getListing() {
        return listing;
    }

    public void accept(FtpListener listener) {
        if (listener != null) {
            listener.listing(this);
        }
    }

}
