/*
 * @(#)SftpPermissionDeniedException.java
 *
 * Copyright (c) 2001-2002 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;

import com.jscape.util.SuppressObfuscation;

/**
 * Exception thrown when trying to create or access a resource with insufficient permissions.
 */
@SuppressObfuscation
public class SftpAuthenticationException
        extends SftpException {

    private String hostname;
    private String username;

    /**
     * Creates new SftpAuthenticationException instance
     *
     * @param hostname the hostname of sftp server
     * @param username the username of sftp user
     */
    public SftpAuthenticationException(String hostname, String username) {
        super(String.format("Failed to authenticate to host '%s' with user '%s'.", hostname, username));
        this.hostname = hostname;
        this.username = username;
    }

    /**
     * Gets hostname of sftp server
     *
     * @return the hostname
     */
    public String getHostname() {
        return hostname;
    }

    /**
     * Gets username of sftp user
     *
     * @return the username
     */
    public String getUsername() {
        return username;
    }
}
