public ResultsMap < String , List < String > > getTimezones ( ) throws MovieDbException { URL url = new ApiUrl ( apiKey , MethodBase . TIMEZONES ) . subMethod ( MethodSub . LIST ) . buildUrl ( ) ; String webpage = httpTools . getRequest ( url ) ; List < Map < String , List < String > > > tzList ; try { tzList = MAPPER . readValue ( webpage , new TypeReference < List < Map < String , List < String > > > > ( ) { } ) ; } catch ( IOException ex ) { throw new MovieDbException ( ApiExceptionType . MAPPING_FAILED , "Failed to get timezone list" , url , ex ) ; } ResultsMap < String , List < String > > timezones = new ResultsMap <> ( ) ; for ( Map < String , List < String > > tzMap : tzList ) { for ( Map . Entry < String , List < String > > x : tzMap . entrySet ( ) ) { timezones . put ( x . getKey ( ) , x . getValue ( ) ) ; } } return timezones ; }
Get the list of supported timezones for the API methods that support them