use of org.rstudio.studio.client.common.vcs.ShowPublicKeyDialog in project rstudio by rstudio.
the class Workbench method onVersionControlShowRsaKey.
@Handler
public void onVersionControlShowRsaKey() {
final ProgressIndicator indicator = new GlobalProgressDelayer(globalDisplay_, 500, "Reading RSA public key...").getIndicator();
// compute path to public key
String sshDir = session_.getSessionInfo().getDefaultSSHKeyDir();
final String keyPath = FileSystemItem.createDir(sshDir).completePath("id_rsa.pub");
// read it
server_.gitSshPublicKey(keyPath, new ServerRequestCallback<String>() {
@Override
public void onResponseReceived(String publicKeyContents) {
indicator.onCompleted();
new ShowPublicKeyDialog("RSA Public Key", publicKeyContents).showModal();
}
@Override
public void onError(ServerError error) {
String msg = "Error attempting to read key '" + keyPath + "' (" + error.getUserMessage() + ")";
indicator.onError(msg);
}
});
}
Aggregations