public ReplyObject getReplyList ( String topicId , int perPage , int page ) throws FlickrException { ReplyList < Reply > reply = new ReplyList < Reply > ( ) ; TopicList < Topic > topic = new TopicList < Topic > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_REPLIES_GET_LIST ) ; parameters . put ( "topic_id" , topicId ) ; if ( perPage > 0 ) { parameters . put ( "per_page" , "" + perPage ) ; } if ( page > 0 ) { parameters . put ( "page" , "" + page ) ; } Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element replyElements = response . getPayload ( ) ; ReplyObject ro = new ReplyObject ( ) ; NodeList replyNodes = replyElements . getElementsByTagName ( "reply" ) ; for ( int i = 0 ; i < replyNodes . getLength ( ) ; i ++ ) { Element replyNodeElement = ( Element ) replyNodes . item ( i ) ; // Element replyElement = XMLUtilities.getChild(replyNodeElement, "reply"); reply . add ( parseReply ( replyNodeElement ) ) ; ro . setReplyList ( reply ) ; } NodeList topicNodes = replyElements . getElementsByTagName ( "topic" ) ; for ( int i = 0 ; i < topicNodes . getLength ( ) ; i ++ ) { Element replyNodeElement = ( Element ) replyNodes . item ( i ) ; // Element topicElement = XMLUtilities.getChild(replyNodeElement, "topic"); topic . add ( parseTopic ( replyNodeElement ) ) ; ro . setTopicList ( topic ) ; } return ro ; }
Get list of replies