List of usage examples for org.springframework.social.facebook.api Reference getName
public String getName()
From source file:org.easit.core.controllers.facebook.FacebookFriendsController.java
@RequestMapping(value = "/facebook/addFriend/{userId}", method = RequestMethod.POST) public String addFriend(@PathVariable("userId") String userId, HttpSession session) { String web_name = session.getAttribute("web_name").toString(); String listId = null;// w w w.j ava 2 s . c om List<Reference> fl = facebook.friendOperations().getFriendLists(); for (Reference fl_exists : fl) { if (fl_exists.getName().equals(web_name)) { listId = fl_exists.getId(); break; } } if (listId == null) { listId = facebook.friendOperations().createFriendList(web_name); } facebook.friendOperations().addToFriendList(listId, userId); return "redirect:/facebook/friends"; }