public Boolean deletePrivilege ( String id ) throws OAuthSystemException , OAuthProblemException , URISyntaxException { cleanError ( ) ; prepareToken ( ) ; OneloginURLConnectionClient httpClient = new OneloginURLConnectionClient ( ) ; OAuthClient oAuthClient = new OAuthClient ( httpClient ) ; URIBuilder url = new URIBuilder ( settings . getURL ( Constants . DELETE_PRIVILEGE_URL , id ) ) ; OAuthClientRequest bearerRequest = new OAuthBearerClientRequest ( url . toString ( ) ) . buildHeaderMessage ( ) ; Map < String , String > headers = getAuthorizedHeader ( ) ; bearerRequest . setHeaders ( headers ) ; Boolean removed = false ; OneloginOAuth2JSONResourceResponse oAuth2Response = oAuthClient . resource ( bearerRequest , OAuth . HttpMethod . DELETE , OneloginOAuth2JSONResourceResponse . class ) ; if ( oAuth2Response . getResponseCode ( ) == 204 ) { removed = true ; } else { error = oAuth2Response . getError ( ) ; errorDescription = oAuth2Response . getErrorDescription ( ) ; } return removed ; }
Deletes a privilege