use of org.apache.hc.core5.http.ParseException 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 org.apache.hc.core5.http.ParseException 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 org.apache.hc.core5.http.ParseException 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());
}
}
use of org.apache.hc.core5.http.ParseException in project spotify-web-api-java by spotify-web-api-java.
the class AuthorizationCodeRefreshExample method authorizationCodeRefresh_Sync.
public static void authorizationCodeRefresh_Sync() {
try {
final AuthorizationCodeCredentials authorizationCodeCredentials = authorizationCodeRefreshRequest.execute();
// Set access and refresh token for further "spotifyApi" object usage
spotifyApi.setAccessToken(authorizationCodeCredentials.getAccessToken());
System.out.println("Expires in: " + authorizationCodeCredentials.getExpiresIn());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
use of org.apache.hc.core5.http.ParseException in project spotify-web-api-java by spotify-web-api-java.
the class GetArtistExample method getArtist_Sync.
public static void getArtist_Sync() {
try {
final Artist artist = getArtistRequest.execute();
System.out.println("Name: " + artist.getName());
} catch (IOException | SpotifyWebApiException | ParseException e) {
System.out.println("Error: " + e.getMessage());
}
}
Aggregations