RbCoreMessages.getString("ERROR_USERNAMEPASSWORD_0"));
return false;
}
}
IReviewboardClientRepository rbClientRepository = ReviewboardClientRepository.getSingletonInstance();
if( !txtServer.getText().trim().isEmpty() ){
String serverUrl = ReviewboardUtil.norminateRepositoryUrl( txtServer.getText().trim() ) ;
if( !txtUserId.getText().trim().isEmpty() && !txtPassword.getText().trim().isEmpty() ){
if( null == rbClientRepository ){
return false;
}
IReviewboardClient reviewboardClient = rbClientRepository.getClientFromUrlToClientMap();
if( null == reviewboardClient || null == reviewboardClient.getServerUrl()
|| !reviewboardClient.getServerUrl().trim().equalsIgnoreCase(serverUrl.trim()) ){
reviewboardClient = rbClientRepository.getClient( false, serverUrl,
txtUserId.getText().trim(), txtPassword.getText().trim(), CHARACTER_ENCODING );
}
if( null == reviewboardClient ){
reviewboardClient = rbClientRepository.getClient( false, serverUrl,
txtUserId.getText().trim(), txtPassword.getText().trim(), CHARACTER_ENCODING );
}
IReviewboardService reviewboardService = new ReviewboardServiceImpl( reviewboardClient );
//验证用户名和密码是否正确
boolean isSuccess = reviewboardService.validCredentials( txtUserId.getText().trim(), txtPassword.getText().trim(), null );