/*
 * @(#)SftpUploadEvent.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 file is uploaded to the SSH server.
 */
public class SftpUploadEvent
        extends SftpTransferCompleteEvent {

    /**
     * Creates a new event instance.
     *
     * @param source     the source of the event
     * @param fileName   the file name
     * @param path       the remote path the file was uploaded to
     * @param localPath  the local file path
     * @param fileSize   the file size in bytes
     * @param uploadTime total download time
     */
    public SftpUploadEvent(Sftp source,
                           String fileName,
                           String path,
                           String localPath,
                           long fileSize,
                           long uploadTime) {
        super(source, fileName, path, localPath, fileSize, uploadTime);
    }

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

}
