/*
 * @(#)FtpResponseEvent.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 response is received from FTP server
 */
public class FtpResponseEvent
        extends FtpEvent {

    private String response;

    /**
     * Creates FtpResponseEvent.
     *
     * @param source   the source of the event
     * @param response the response received from FTP server
     */
    public FtpResponseEvent(Object source, String response) {
        super(source);
        this.response = response;
    }

    /**
     * Gets response received from FTP server
     *
     * @return the response received from FTP server
     */
    public String getResponse() {
        return response;
    }

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

}
