public Organization getModuleOrganization ( final String moduleName , final String moduleVersion ) throws GrapesCommunicationException { final Client client = getClient ( ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getModuleOrganizationPath ( moduleName , moduleVersion ) ) ; final ClientResponse response = resource . accept ( MediaType . APPLICATION_JSON ) . get ( ClientResponse . class ) ; client . destroy ( ) ; if ( ClientResponse . Status . OK . getStatusCode ( ) != response . getStatus ( ) ) { final String message = "Failed to get module's organization" ; if ( LOG . isErrorEnabled ( ) ) { LOG . error ( String . format ( HTTP_STATUS_TEMPLATE_MSG , message , response . getStatus ( ) ) ) ; } throw new GrapesCommunicationException ( message , response . getStatus ( ) ) ; } return response . getEntity ( Organization . class ) ; }
Returns the organization of a given module