public Collection < License > getInfo ( ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_INFO ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } List < License > licenses = new ArrayList < License > ( ) ; Element licensesElement = response . getPayload ( ) ; NodeList licenseElements = licensesElement . getElementsByTagName ( "license" ) ; for ( int i = 0 ; i < licenseElements . getLength ( ) ; i ++ ) { Element licenseElement = ( Element ) licenseElements . item ( i ) ; License license = new License ( ) ; license . setId ( licenseElement . getAttribute ( "id" ) ) ; license . setName ( licenseElement . getAttribute ( "name" ) ) ; license . setUrl ( licenseElement . getAttribute ( "url" ) ) ; licenses . add ( license ) ; } return licenses ; }
Fetches a list of available photo licenses for Flickr .