public PhotoList < Photo > getPhotos ( String groupId , String userId , String [ ] tags , Set < String > extras , 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 ( "group_id" , groupId ) ; if ( userId != null ) { parameters . put ( "user_id" , userId ) ; } if ( tags != null ) { parameters . put ( "tags" , StringUtilities . join ( tags , " " ) ) ; } if ( perPage > 0 ) { parameters . put ( "per_page" , String . valueOf ( perPage ) ) ; } if ( page > 0 ) { parameters . put ( "page" , String . valueOf ( page ) ) ; } if ( extras != null ) { StringBuffer sb = new StringBuffer ( ) ; Iterator < String > it = extras . iterator ( ) ; for ( int i = 0 ; it . hasNext ( ) ; i ++ ) { if ( i > 0 ) { sb . append ( "," ) ; } sb . append ( it . next ( ) ) ; } parameters . put ( Extras . KEY_EXTRAS , sb . toString ( ) ) ; } Response response = transport . get ( transport . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element photosElement = response . getPayload ( ) ; photos . setPage ( photosElement . getAttribute ( "page" ) ) ; photos . setPages ( photosElement . getAttribute ( "pages" ) ) ; photos . setPerPage ( photosElement . getAttribute ( "perpage" ) ) ; photos . setTotal ( photosElement . getAttribute ( "total" ) ) ; NodeList photoNodes = photosElement . getElementsByTagName ( "photo" ) ; for ( int i = 0 ; i < photoNodes . getLength ( ) ; i ++ ) { Element photoElement = ( Element ) photoNodes . item ( i ) ; photos . add ( PhotoUtils . createPhoto ( photoElement ) ) ; } return photos ; }
Get the photos for the specified group pool optionally filtering by taf .