public User findByEmail ( String email ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_FIND_BY_EMAIL ) ; parameters . put ( "find_email" , email ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } Element userElement = response . getPayload ( ) ; User user = new User ( ) ; user . setId ( userElement . getAttribute ( "nsid" ) ) ; user . setUsername ( XMLUtilities . getChildValue ( userElement , "username" ) ) ; return user ; }
Find the user by their email address .