public Photo getListPhoto ( String photoId ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_LIST_PHOTO ) ; parameters . put ( "photo_id" , photoId ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element photoElement = response . getPayload ( ) ; Photo photo = new Photo ( ) ; photo . setId ( photoElement . getAttribute ( "id" ) ) ; List < Tag > tags = new ArrayList < Tag > ( ) ; Element tagsElement = ( Element ) photoElement . getElementsByTagName ( "tags" ) . item ( 0 ) ; NodeList tagElements = tagsElement . getElementsByTagName ( "tag" ) ; for ( int i = 0 ; i < tagElements . getLength ( ) ; i ++ ) { Element tagElement = ( Element ) tagElements . item ( i ) ; Tag tag = new Tag ( ) ; tag . setId ( tagElement . getAttribute ( "id" ) ) ; tag . setAuthor ( tagElement . getAttribute ( "author" ) ) ; tag . setAuthorName ( tagElement . getAttribute ( "authorname" ) ) ; tag . setRaw ( tagElement . getAttribute ( "raw" ) ) ; tag . setValue ( ( ( Text ) tagElement . getFirstChild ( ) ) . getData ( ) ) ; tags . add ( tag ) ; } photo . setTags ( tags ) ; return photo ; }
Get a list of tags for the specified photo .