public Collection < Blog > getList ( ) throws FlickrException { List < Blog > blogs = new ArrayList < Blog > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_LIST ) ; Response response = transportAPI . post ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element blogsElement = response . getPayload ( ) ; NodeList blogNodes = blogsElement . getElementsByTagName ( "blog" ) ; for ( int i = 0 ; i < blogNodes . getLength ( ) ; i ++ ) { Element blogElement = ( Element ) blogNodes . item ( i ) ; Blog blog = new Blog ( ) ; blog . setId ( blogElement . getAttribute ( "id" ) ) ; blog . setName ( blogElement . getAttribute ( "name" ) ) ; blog . setNeedPassword ( "1" . equals ( blogElement . getAttribute ( "needspassword" ) ) ) ; blog . setUrl ( blogElement . getAttribute ( "url" ) ) ; blogs . add ( blog ) ; } return blogs ; }
Get the collection of configured blogs for the calling user .