- use Connection interface instead of Impl

- final's on local vars
This commit is contained in:
Shikhar Bhushan
2010-03-09 02:01:36 +01:00
parent ac7ee3e0b3
commit b32ee34b8a

View File

@@ -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");