use of se.michaelthelin.spotify.exceptions.SpotifyWebApiException in project spotify-web-api-java by spotify-web-api-java.
the class GetCurrentUsersProfileExample method getCurrentUsersProfile_Sync.
public static void getCurrentUsersProfile_Sync() {
try {
final User user = getCurrentUsersProfileRequest.execute();
System.out.println("Display name: " + user.getDisplayName());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
use of se.michaelthelin.spotify.exceptions.SpotifyWebApiException in project spotify-web-api-java by spotify-web-api-java.
the class GetPlaylistExample method getPlaylist_Sync.
public static void getPlaylist_Sync() {
try {
final Playlist playlist = getPlaylistRequest.execute();
System.out.println("Name: " + playlist.getName());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
use of se.michaelthelin.spotify.exceptions.SpotifyWebApiException in project spotify-web-api-java by spotify-web-api-java.
the class RemoveItemsFromPlaylistExample method removeItemsFromPlaylist_Sync.
public static void removeItemsFromPlaylist_Sync() {
try {
final SnapshotResult snapshotResult = removeItemsFromPlaylistRequest.execute();
System.out.println("Snapshot ID: " + snapshotResult.getSnapshotId());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
use of se.michaelthelin.spotify.exceptions.SpotifyWebApiException in project spotify-web-api-java by spotify-web-api-java.
the class SearchItemExample method searchItem_Sync.
public static void searchItem_Sync() {
try {
final SearchResult searchResult = searchItemRequest.execute();
System.out.println("Total tracks: " + searchResult.getTracks().getTotal());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
use of se.michaelthelin.spotify.exceptions.SpotifyWebApiException in project spotify-web-api-java by spotify-web-api-java.
the class GetAudioAnalysisForTrackExample method getAudioAnalysisForTrack_Sync.
public static void getAudioAnalysisForTrack_Sync() {
try {
final AudioAnalysis audioAnalysis = getAudioAnalysisForTrackRequest.execute();
System.out.println("Track duration: " + audioAnalysis.getTrack().getDuration());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
Aggregations