本文整理汇总了Java中org.eclipse.che.plugin.pullrequest.client.vcs.hosting.ServiceUtil类的典型用法代码示例。如果您正苦于以下问题:Java ServiceUtil类的具体用法?Java ServiceUtil怎么用?Java ServiceUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ServiceUtil类属于org.eclipse.che.plugin.pullrequest.client.vcs.hosting包,在下文中一共展示了ServiceUtil类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: authenticate
import org.eclipse.che.plugin.pullrequest.client.vcs.hosting.ServiceUtil; //导入依赖的package包/类
@Override
public Promise<HostUser> authenticate(final CurrentUser user) {
final Workspace workspace = this.appContext.getWorkspace();
if (workspace == null) {
return reject(JsPromiseError.create("Error accessing current workspace"));
}
String oauthPath =
"https://bitbucket.org".equals(bitbucketEndpoint)
? "/oauth/authenticate?oauth_provider=bitbucket&userId="
: "/oauth/1.0/authenticate?oauth_provider=bitbucket-server&request_method=post&signature_method=rsa&userId=";
final String authUrl =
baseUrl
+ oauthPath
+ user.getProfile().getUserId()
+ "&redirect_after_login="
+ Window.Location.getProtocol()
+ "//"
+ Window.Location.getHost()
+ "/ws/"
+ workspace.getConfig().getName();
return ServiceUtil.performWindowAuth(this, authUrl, securityTokenProvider);
}
示例2: authenticate
import org.eclipse.che.plugin.pullrequest.client.vcs.hosting.ServiceUtil; //导入依赖的package包/类
@Override
public Promise<HostUser> authenticate(CurrentUser user) {
final Workspace workspace = this.appContext.getWorkspace();
if (workspace == null) {
return Promises.reject(JsPromiseError.create("Error accessing current workspace"));
}
final String authUrl =
baseUrl
+ "/oauth/authenticate?oauth_provider=microsoft&userId="
+ user.getProfile().getUserId()
+ "&scope=vso.code_manage%20vso.code_status&redirect_after_login="
+ Window.Location.getProtocol()
+ "//"
+ Window.Location.getHost()
+ "/ws/"
+ workspace.getConfig().getName();
return ServiceUtil.performWindowAuth(this, authUrl, securityTokenProvider);
}
示例3: authenticate
import org.eclipse.che.plugin.pullrequest.client.vcs.hosting.ServiceUtil; //导入依赖的package包/类
@Override
public Promise<HostUser> authenticate(final CurrentUser user) {
final Workspace workspace = this.appContext.getWorkspace();
if (workspace == null) {
return Promises.reject(JsPromiseError.create("Error accessing current workspace"));
}
final String authUrl =
baseUrl
+ "/oauth/authenticate?oauth_provider=github&userId="
+ user.getId()
+ "&scope=user,repo,write:public_key&redirect_after_login="
+ Window.Location.getProtocol()
+ "//"
+ Window.Location.getHost()
+ "/ws/"
+ workspace.getConfig().getName();
return ServiceUtil.performWindowAuth(this, authUrl, securityTokenProvider);
}