本文整理匯總了Java中org.eclipse.che.api.git.UserCredential類的典型用法代碼示例。如果您正苦於以下問題:Java UserCredential類的具體用法?Java UserCredential怎麽用?Java UserCredential使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
UserCredential類屬於org.eclipse.che.api.git包,在下文中一共展示了UserCredential類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getUserCredential
import org.eclipse.che.api.git.UserCredential; //導入依賴的package包/類
@Override
public UserCredential getUserCredential() throws GitException {
try {
OAuthToken token =
oAuthTokenProvider.getToken(
OAUTH_PROVIDER_NAME, EnvironmentContext.getCurrent().getSubject().getUserId());
if (token != null) {
return new UserCredential(token.getToken(), "x-oauth-basic", OAUTH_PROVIDER_NAME);
}
} catch (IOException e) {
LOG.warn(e.getLocalizedMessage());
}
return null;
}
示例2: getUserCredential
import org.eclipse.che.api.git.UserCredential; //導入依賴的package包/類
@Override
public UserCredential getUserCredential() throws GitException {
try {
final OAuthToken token =
oAuthTokenProvider.getToken(
OAUTH_PROVIDER_NAME, EnvironmentContext.getCurrent().getSubject().getUserId());
if (token != null) {
return new UserCredential("x-token-auth", token.getToken(), OAUTH_PROVIDER_NAME);
}
} catch (IOException e) {
LOG.warn(e.getLocalizedMessage());
}
return null;
}
示例3: getUserCredential
import org.eclipse.che.api.git.UserCredential; //導入依賴的package包/類
@Override
public UserCredential getUserCredential() throws GitException {
try {
OAuthToken token =
oAuthTokenProvider.getToken(
OAUTH_PROVIDER_NAME, EnvironmentContext.getCurrent().getSubject().getUserId());
if (token != null) {
return new UserCredential(token.getToken(), token.getToken(), OAUTH_PROVIDER_NAME);
}
} catch (IOException ioEx) {
LOG.warn(ioEx.getLocalizedMessage());
}
return null;
}
示例4: getUserCredential
import org.eclipse.che.api.git.UserCredential; //導入依賴的package包/類
@Override
public UserCredential getUserCredential() throws GitException {
try {
OAuthToken token =
oAuthTokenProvider.getToken(
OAUTH_PROVIDER_NAME, EnvironmentContext.getCurrent().getSubject().getUserId());
if (token != null) {
return new UserCredential(token.getToken(), token.getToken(), OAUTH_PROVIDER_NAME);
}
} catch (IOException e) {
LOG.warn(e.getLocalizedMessage());
}
return null;
}