/*
 * @(#)FileTransferDeleteFileEvent.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 a file is deleted on server.
 */
public class FileTransferDeleteFileEvent
        extends FileTransferEvent {

    private final String file;
    private final String path;

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

        this.file = file;

        this.path = path;
    }

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

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

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

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