public PhotoList < Photo > getPhotos ( String photosetId , Set < String > extras , int privacy_filter , int perPage , int page ) throws FlickrException { PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_PHOTOS ) ; parameters . put ( "photoset_id" , photosetId ) ; if ( perPage > 0 ) { parameters . put ( "per_page" , String . valueOf ( perPage ) ) ; } if ( page > 0 ) { parameters . put ( "page" , String . valueOf ( page ) ) ; } if ( privacy_filter > 0 ) { parameters . put ( "privacy_filter" , "" + privacy_filter ) ; } if ( extras != null && ! extras . isEmpty ( ) ) { parameters . put ( Extras . KEY_EXTRAS , StringUtilities . join ( extras , "," ) ) ; } Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element photoset = response . getPayload ( ) ; NodeList photoElements = photoset . getElementsByTagName ( "photo" ) ; photos . setPage ( photoset . getAttribute ( "page" ) ) ; photos . setPages ( photoset . getAttribute ( "pages" ) ) ; photos . setPerPage ( photoset . getAttribute ( "per_page" ) ) ; photos . setTotal ( photoset . getAttribute ( "total" ) ) ; for ( int i = 0 ; i < photoElements . getLength ( ) ; i ++ ) { Element photoElement = ( Element ) photoElements . item ( i ) ; photos . add ( PhotoUtils . createPhoto ( photoElement , photoset ) ) ; } return photos ; }
Get a collection of Photo objects for the specified Photoset .