当前位置: 首页>>代码示例>>Java>>正文


Java ServiceUtil类代码示例

本文整理汇总了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);
}
 
开发者ID:codenvy,项目名称:codenvy,代码行数:24,代码来源:BitbucketHostingService.java

示例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);
}
 
开发者ID:codenvy,项目名称:codenvy,代码行数:19,代码来源:MicrosoftHostingService.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:GitHubHostingService.java


注:本文中的org.eclipse.che.plugin.pullrequest.client.vcs.hosting.ServiceUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。