return null;
}
public String createPlaylist(String title, String description) throws ServiceException {
PlaylistLinkEntry newEntry = new PlaylistLinkEntry();
newEntry.setTitle(new PlainTextConstruct(title));
newEntry.setSummary(new PlainTextConstruct(description));
try {
PlaylistLinkEntry createdEntry;
try {
createdEntry = service.insert(new URL(PLAYLIST_FEED_URL), newEntry);
} catch(InvalidEntryException e) {
// If the first attempt to create the playlist fails with this exception,
// it's most likely due to a duplicate playlist title.
// So let's make the title unique and try again.
String newTitle = title + " - " + DateTime.now().toUiString();
log.info(String.format("Playlist with title '%s' already exists. Attempting to create " +
"playlist with title '%s'.", title, newTitle));
newEntry.setTitle(new PlainTextConstruct(newTitle));
createdEntry = service.insert(new URL(PLAYLIST_FEED_URL), newEntry);
}
String id = createdEntry.getPlaylistId();
log.info(String.format("Created new playlist with id '%s'.", id));
return id;
} catch (MalformedURLException e) {
log.log(Level.WARNING, "", e);