mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-08 08:10:55 +03:00
- use Connection interface instead of Impl
- final's on local vars
This commit is contained in:
@@ -124,7 +124,7 @@ public class SSHClient
|
|||||||
protected final UserAuth auth;
|
protected final UserAuth auth;
|
||||||
|
|
||||||
/** {@code ssh-connection} service */
|
/** {@code ssh-connection} service */
|
||||||
protected final ConnectionImpl conn;
|
protected final Connection conn;
|
||||||
|
|
||||||
/** Default constructor. Initializes this object using {@link DefaultConfig}. */
|
/** Default constructor. Initializes this object using {@link DefaultConfig}. */
|
||||||
public SSHClient() {
|
public SSHClient() {
|
||||||
@@ -198,7 +198,7 @@ public class SSHClient
|
|||||||
public void auth(String username, Iterable<AuthMethod> methods)
|
public void auth(String username, Iterable<AuthMethod> methods)
|
||||||
throws UserAuthException, TransportException {
|
throws UserAuthException, TransportException {
|
||||||
assert isConnected();
|
assert isConnected();
|
||||||
auth.authenticate(username, conn, methods);
|
auth.authenticate(username, (Service) conn, methods);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -453,9 +453,9 @@ public class SSHClient
|
|||||||
*/
|
*/
|
||||||
public KeyProvider loadKeys(String location, PasswordFinder passwordFinder)
|
public KeyProvider loadKeys(String location, PasswordFinder passwordFinder)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
File loc = new File(location);
|
final File loc = new File(location);
|
||||||
FileKeyProvider.Format format = KeyProviderUtil.detectKeyFileFormat(loc);
|
final FileKeyProvider.Format format = KeyProviderUtil.detectKeyFileFormat(loc);
|
||||||
FileKeyProvider fkp = Factory.Named.Util.create(trans.getConfig().getFileKeyProviderFactories(), format
|
final FileKeyProvider fkp = Factory.Named.Util.create(trans.getConfig().getFileKeyProviderFactories(), format
|
||||||
.toString());
|
.toString());
|
||||||
if (fkp == null)
|
if (fkp == null)
|
||||||
throw new SSHException("No provider available for " + format + " key file");
|
throw new SSHException("No provider available for " + format + " key file");
|
||||||
|
|||||||
Reference in New Issue
Block a user