/*
 * @(#)FtpCommandEvent.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;

/**
 * Fired when command is sent to FTP server
 */
public class FtpCommandEvent
        extends FtpEvent {

    private String command;

    /**
     * Creates FtpCommandEvent.
     *
     * @param source  the source of the event
     * @param command the command sent to FTP server
     */
    public FtpCommandEvent(Object source, String command) {
        super(source);
        this.command = command;
    }

    /**
     * Gets command sent to FTP server.
     *
     * @return the command sent to FTP server
     */
    public String getCommand() {
        return command;
    }

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

}
