提交 7360f45d 编写于 作者: K Kohsuke Kawaguchi

this breaks in Java5 so at least giving the user better message

上级 03275ac6
......@@ -497,13 +497,17 @@ public class CLI {
}
private static String askForPasswd(String filePath){
Console cons = System.console();
String passwd = null;
if (cons != null){
char[] p = cons.readPassword("%s", "Enter passphrase for "+filePath+":");
passwd = String.valueOf(p);
try {
Console cons = System.console();
String passwd = null;
if (cons != null){
char[] p = cons.readPassword("%s", "Enter passphrase for "+filePath+":");
passwd = String.valueOf(p);
}
return passwd;
} catch (LinkageError e) {
throw new Error("Your private key is encrypted, but we need Java6 to ask you password safely",e);
}
return passwd;
}
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册