This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static final String PROFILE_PICTURE_URL = "https://graph.facebook.com/%s/picture?type=large&access_token=%s"; | |
private String downloadFacebookProfilePicture(String uid, String accessToken, String username) throws MalformedURLException, IOException { | |
//Get the picture url | |
HttpURLConnection.setFollowRedirects(false); | |
String profilePictureUrlString = new URL(String.format(PROFILE_PICTURE_URL, uid, accessToken)).openConnection().getHeaderField( | |
"location"); | |
//Set up temp location for picture | |
String fileExtension = StringUtils.substring(profilePictureUrlString, |
NewerOlder