public GeoPermissions getPerms ( String photoId ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_PERMS ) ; parameters . put ( "photo_id" , photoId ) ; Response response = transport . get ( transport . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new FlickrException ( response . getErrorCode ( ) , response . getErrorMessage ( ) ) ; } // response: // <perms id="240935723" ispublic="1" iscontact="0" isfriend="0" isfamily="0"/> GeoPermissions perms = new GeoPermissions ( ) ; Element permsElement = response . getPayload ( ) ; perms . setPublic ( "1" . equals ( permsElement . getAttribute ( "ispublic" ) ) ) ; perms . setContact ( "1" . equals ( permsElement . getAttribute ( "iscontact" ) ) ) ; perms . setFriend ( "1" . equals ( permsElement . getAttribute ( "isfriend" ) ) ) ; perms . setFamily ( "1" . equals ( permsElement . getAttribute ( "isfamily" ) ) ) ; perms . setId ( permsElement . getAttribute ( "id" ) ) ; // I ignore the id attribute. should be the same as the given // photo id. return perms ; }
Get permissions for who may view geo data for a photo .