/*
 * @(#)SftpDeleteDirEvent.java
 *
 * Copyright (c) 2001-2004 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.sftp.events;

import com.jscape.inet.sftp.Sftp;

/**
 * This event is fired when directory is deleted from server.
 */
public class SftpDeleteDirEvent
        extends SftpEvent {

    private final String directory;
    private final String path;

    /**
     * Creates a new SftpDeleteDirEvent instance.
     *
     * @param source    the source of the event
     * @param directory the name of the directory deleted
     * @param path      the directory path the directory was deleted from
     */
    public SftpDeleteDirEvent(Sftp source, String directory, String path) {
        super(source);
        this.directory = directory;
        this.path = path;
    }

    /**
     * Gets name of directory deleted.
     *
     * @return the directory deleted.
     */
    public String getDirectory() {
        return this.directory;
    }

    /**
     * Gets the path the directory was deleted from
     *
     * @return path
     */
    public String getPath() {
        return this.path;
    }

    /**
     * The "backwards dispatching" support.
     *
     * @param listener the event listener
     */
    public void accept(SftpListener listener) {
        listener.deleteDir(this);
    }
}
