/*
 * @(#)FileTransferDeleteDirEvent.java
 *
 * Copyright (c) 1999-2007 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.filetransfer;

/**
 * Fired when directory is deleted on server.
 */
public class FileTransferDeleteDirEvent
        extends FileTransferEvent {

    private final String directory;
    private final String path;

    /**
     * Creates <code>FileTransferDeleteDirEvent</code>.
     *
     * @param source    the source of the event
     * @param directory the directory deleted on server
     * @param path      the directory path the directory was deleted from
     */
    public FileTransferDeleteDirEvent(FileTransfer source, String directory, String path) {
        super(source);

        this.directory = directory;

        this.path = path;
    }

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

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

    /**
     * {@inheritDoc}
     */
    public void accept(FileTransferListener listener) {
        listener.deleteDir(this);
    }

    @Override
    public String toString() {
        return "FileTransferDeleteDirEvent {"
                + "directory='" + this.directory + '\''
                + ", path='" + this.path + '\''
                + '}';
    }
}
