userSession.addMetaData("email", email);
userSessionManager.save(userSession);
youTubeApi.setAuthSubToken(authSubToken);
FormUploadToken token = youTubeApi.getFormUploadToken(newEntry);
if (token == null) {
throw new IllegalArgumentException("Upload token returned from YouTube API is null. "
+ "Please make sure that all request parameters are valid.");
}
String uploadToken = token.getToken();
String uploadUrl = token.getUrl();
JSONObject responseJsonObj = new JSONObject();
responseJsonObj.put("uploadToken", uploadToken);
responseJsonObj.put("uploadUrl", uploadUrl);