org.apache.hc.core5.http.ParseException Java Examples

The following examples show how to use org.apache.hc.core5.http.ParseException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GetSeveralTracksExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getSeveralTracks_Sync() {
  try {
    final Track[] tracks = getSeveralTracksRequest.execute();

    System.out.println("Length: " + tracks.length);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #2
Source File: GetEpisodeExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getEpisode_Sync() {
  try {
    final Episode episode = getEpisodeRequest.execute();

    System.out.println("Name: " + episode.getName());
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #3
Source File: GetPlaylistExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
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());
  }
}
 
Example #4
Source File: GetListOfCurrentUsersPlaylistsExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getListOfCurrentUsersPlaylists_Sync() {
  try {
    final Paging<PlaylistSimplified> playlistSimplifiedPaging = getListOfCurrentUsersPlaylistsRequest.execute();

    System.out.println("Total: " + playlistSimplifiedPaging.getTotal());
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #5
Source File: GetArtistExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
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());
  }
}
 
Example #6
Source File: GetCurrentUsersProfileExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
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());
  }
}
 
Example #7
Source File: GetPlaylistsItemsExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getPlaylistsItems_Sync() {
  try {
    final Paging<PlaylistTrack> playlistTrackPaging = getPlaylistsItemsRequest.execute();

    System.out.println("Total: " + playlistTrackPaging.getTotal());
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #8
Source File: GetShowsEpisodesExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getShowsEpisodes_Sync() {
  try {
    final Paging<EpisodeSimplified> episodeSimplifiedPaging = getShowsEpisodesRequest.execute();

    System.out.println("Total: " + episodeSimplifiedPaging.getTotal());
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #9
Source File: GetSeveralEpisodesExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getSeveralEpisodes_Sync() {
  try {
    final Episode[] episodes = getSeveralEpisodesRequest.execute();

    System.out.println("Length: " + episodes.length);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #10
Source File: SearchShowsExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void searchShows_Sync() {
  try {
    final Paging<ShowSimplified> showSimplifiedPaging = searchShowsRequest.execute();

    System.out.println("Total: " + showSimplifiedPaging.getTotal());
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #11
Source File: ToggleShuffleForUsersPlaybackExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void toggleShuffleForUsersPlayback_Sync() {
  try {
    final String string = toggleShuffleForUsersPlaybackRequest.execute();

    System.out.println("Null: " + string);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #12
Source File: PauseUsersPlaybackExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void pauseUsersPlayback_Sync() {
  try {
    final String string = pauseUsersPlaybackRequest.execute();

    System.out.println("Null: " + string);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #13
Source File: AddItemToUsersPlaybackQueueExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void addItemToUsersPlaybackQueue_Sync() {
  try {
    final String string = addItemToUsersPlaybackQueueRequest.execute();

    System.out.println("Null: " + string);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #14
Source File: SeekToPositionInCurrentlyPlayingTrackExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void seekToPositionInCurrentlyPlayingTrack_Sync() {
  try {
    final String string = seekToPositionInCurrentlyPlayingTrackRequest.execute();

    System.out.println("Null: " + string);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #15
Source File: GetUsersTopTracksExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getUsersTopTracks_Sync() {
  try {
    final Paging<Track> trackPaging = getUsersTopTracksRequest.execute();

    System.out.println("Total: " + trackPaging.getTotal());
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #16
Source File: GetEpisodeRequest.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
/**
 * Get an episode
 *
 * @return An {@link Episode}.
 * @throws IOException            In case of networking issues.
 * @throws SpotifyWebApiException The Web API returned an error further specified in this exception's root cause.
 */
@Override
public Episode execute() throws
  IOException,
  SpotifyWebApiException,
  ParseException {
  return new Episode.JsonUtil().createModelObject(getJson());
}
 
Example #17
Source File: GetAudioFeaturesForSeveralTracksExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getAudioFeaturesForSeveralTracks_Sync() {
  try {
    final AudioFeatures[] audioFeatures = getAudioFeaturesForSeveralTracksRequest.execute();

    System.out.println("Length: " + audioFeatures.length);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #18
Source File: GetTrackExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getTrack_Sync() {
  try {
    final Track track = getTrackRequest.execute();

    System.out.println("Name: " + track.getName());
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #19
Source File: GetAudioAnalysisForTrackExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
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());
  }
}
 
Example #20
Source File: UnfollowArtistsOrUsersExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void unfollowArtistsOrUsers_Sync() {
  try {
    final String string = unfollowArtistsOrUsersRequest.execute();

    System.out.println("Null: " + string);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #21
Source File: ClientCredentialsExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void clientCredentials_Sync() {
  try {
    final ClientCredentials clientCredentials = clientCredentialsRequest.execute();

    // Set access token for further "spotifyApi" object usage
    spotifyApi.setAccessToken(clientCredentials.getAccessToken());

    System.out.println("Expires in: " + clientCredentials.getExpiresIn());
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #22
Source File: GetListOfCategoriesExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getListOfCategories_Sync() {
  try {
    final Paging<Category> categoryPaging = getListOfCategoriesRequest.execute();

    System.out.println("Total: " + categoryPaging.getTotal());
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #23
Source File: GetCategorysPlaylistsExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getCategorysPlaylists_Sync() {
  try {
    final Paging<PlaylistSimplified> playlistSimplifiedPaging = getCategoryRequest.execute();

    System.out.println("Total: " + playlistSimplifiedPaging.getTotal());
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #24
Source File: GetRecommendationsExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getRecommendations_Sync() {
  try {
    final Recommendations recommendations = getRecommendationsRequest.execute();

    System.out.println("Length: " + recommendations.getTracks().length);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #25
Source File: SaveShowsForCurrentUserRequest.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
/**
 * Save one or more shows.
 *
 * @return A string. <b>Note:</b> This endpoint doesn't return something in its response body.
 * @throws IOException            In case of networking issues.
 * @throws SpotifyWebApiException The Web API returned an error further specified in this exception's root cause.
 */
@Override
public String execute() throws
  IOException,
  SpotifyWebApiException,
  ParseException {
  return putJson();
}
 
Example #26
Source File: GetAvailableGenreSeedsExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void getAvailableGenreSeeds_Sync() {
  try {
    final String[] strings = getAvailableGenreSeedsRequest.execute();

    System.out.println("Length: " + strings.length);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #27
Source File: SaveTracksForUserExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void saveTracksForUser_Sync() {
  try {
    final String string = saveTracksForUserRequest.execute();

    System.out.println("Null: " + string);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #28
Source File: CheckUsersSavedTracksExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void checkUsersSavedTracks_Sync() {
  try {
    final Boolean[] booleans = checkUsersSavedTracksRequest.execute();

    System.out.println("Length: " + booleans.length);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #29
Source File: CheckUsersSavedAlbumsExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void checkUsersSavedAlbums_Sync() {
  try {
    final Boolean[] booleans = checkUsersSavedAlbumsRequest.execute();

    System.out.println("Length: " + booleans.length);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}
 
Example #30
Source File: SaveShowsForCurrentUserExample.java    From spotify-web-api-java with MIT License 5 votes vote down vote up
public static void saveShowsForCurrentUser_Sync() {
  try {
    final String string = saveShowsForCurrentUserRequest.execute();

    System.out.println("Null: " + string);
  } catch (IOException | SpotifyWebApiException | ParseException e) {
    System.out.println("Error: " + e.getMessage());
  }
}