本文整理汇总了Java中org.springframework.social.connect.Connection.getImageUrl方法的典型用法代码示例。如果您正苦于以下问题:Java Connection.getImageUrl方法的具体用法?Java Connection.getImageUrl怎么用?Java Connection.getImageUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.social.connect.Connection
的用法示例。
在下文中一共展示了Connection.getImageUrl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSocialUser
import org.springframework.social.connect.Connection; //导入方法依赖的package包/类
/**
* Create new user.
* @param connection connection
* @param langKey lang key
*/
public void createSocialUser(Connection<?> connection, String langKey) {
if (connection == null) {
log.error("Cannot create social user because connection is null");
throw new IllegalArgumentException("Connection cannot be null");
}
UserProfile userProfile = connection.fetchUserProfile();
String providerId = connection.getKey().getProviderId();
String imageUrl = connection.getImageUrl();
User user = createUserIfNotExist(userProfile, langKey, imageUrl);
createSocialConnection(user.getUserKey(), connection);
mailService.sendSocialRegistrationValidationEmail(user, userProfile.getEmail(), providerId,
TenantContext.getCurrent().getTenant(), MDCUtil.getRid());
}
示例2: createSocialUser
import org.springframework.social.connect.Connection; //导入方法依赖的package包/类
public void createSocialUser(Connection<?> connection, String langKey) {
if (connection == null) {
log.error("Cannot create social user because connection is null");
throw new IllegalArgumentException("Connection cannot be null");
}
UserProfile userProfile = connection.fetchUserProfile();
String providerId = connection.getKey().getProviderId();
String imageUrl = connection.getImageUrl();
User user = createUserIfNotExist(userProfile, langKey, providerId, imageUrl);
createSocialConnection(user.getLogin(), connection);
mailService.sendSocialRegistrationValidationEmail(user, providerId);
}
示例3: connectionToUserSocialConnection
import org.springframework.social.connect.Connection; //导入方法依赖的package包/类
private SocialUserConnection connectionToUserSocialConnection(Connection<?> connection, Long rank) {
ConnectionData connectionData = connection.createData();
return new SocialUserConnection(userId, connection.getKey().getProviderId(), connection.getKey().getProviderUserId(),
rank, connection.getDisplayName(), connection.getProfileUrl(), connection.getImageUrl(), connectionData.getAccessToken(),
connectionData.getSecret(), connectionData.getRefreshToken(), connectionData.getExpireTime()
);
}
示例4: createSocialUser
import org.springframework.social.connect.Connection; //导入方法依赖的package包/类
public void createSocialUser(Connection<?> connection, String langKey) {
if (connection == null) {
log.error("Cannot create social user because connection is null");
throw new IllegalArgumentException("Connection cannot be null");
}
UserProfile userProfile = connection.fetchUserProfile();
String providerId = connection.getKey().getProviderId();
String imageUrl = connection.getImageUrl();
User user = createUserIfNotExist(userProfile, langKey, providerId, imageUrl);
createSocialConnection(user.getLogin(), connection);
mailService.sendSocialRegistrationValidationEmail(user, providerId);
}
示例5: getImageUrl
import org.springframework.social.connect.Connection; //导入方法依赖的package包/类
/**
* Retrieve the image URL resized
* @param connection
* @param height
* @param width
* @return URL as a {@link String} of where the resized profile image is located
*/
private String getImageUrl(Connection<Facebook> connection, int height, int width) {
return connection.getImageUrl() + "?height=x&width=y".replaceAll("x", new Integer(height).toString()).replace("y", new Integer(width).toString());
}
开发者ID:kevindeyne,项目名称:simple-facebook-integration-spring-sec,代码行数:11,代码来源:CustomConnectInterceptor.java