/*
 * @(#)SftpErrorEvent.java
 *
 * Copyright (c) 2013 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 SftpErrorEvent
        extends SftpEvent {

    private final String fileName;
    private final String path;
    private final String localPath;
    private final int mode;

    /**
     * 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 mode      the transfer mode
     */
    public SftpErrorEvent(Sftp source,
                          String fileName,
                          String path,
                          String localPath,
                          int mode) {
        super(source);

        this.fileName = fileName;
        this.path = path;
        this.localPath = localPath;
        this.mode = mode;
    }

    /**
     * Obtains the file name.
     *
     * @return the file name
     */
    public String getFilename() {
        return this.fileName;
    }

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

    /**
     * Returns local file path.
     *
     * @return local file path
     */
    public String getLocalPath() {
        return this.localPath;
    }

    /**
     * Obtains the file size.
     *
     * @return the file size
     */
    public int getMode() {
        return this.mode;
    }

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