garydgregory commented on a change in pull request #60: VFS-609: VFS SFTP
doesn't support a private key as byte array
URL: https://github.com/apache/commons-vfs/pull/60#discussion_r278897374
##########
File path:
commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
##########
@@ -195,11 +195,17 @@ private static void setConfigRepository(final JSch jsch,
final File sshDir, fina
}
}
- private static void addIndentity(final JSch jsch, final IdentityInfo info)
throws FileSystemException {
+ private static void addIdentity(final JSch jsch, final IdentityInfo info)
throws FileSystemException {
try {
- final String privateKeyFile = info.getPrivateKey() != null ?
info.getPrivateKey().getAbsolutePath() : null;
- final String publicKeyFile = info.getPublicKey() != null ?
info.getPublicKey().getAbsolutePath() : null;
- jsch.addIdentity(privateKeyFile, publicKeyFile,
info.getPassPhrase());
+ if (info.getPrivateKey() != null) {
Review comment:
It is confusing if more than one setting is used but one overrides the other
silently. Wouldn't throwing an IllegalStateException be clearer?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services