/** * Delete an Origin Access Identity. * * @param id The identifier of the Origin Access Identity. * @throws CloudFrontServiceException exception */ public void deleteOriginAccessIdentity(String id) throws CloudFrontServiceException { if(log.isDebugEnabled()) { log.debug("Deleting origin access identity with id: " + id); } // Get the identity's current config. OriginAccessIdentityConfig currentConfig = getOriginAccessIdentityConfig(id); HttpDelete httpMethod = new HttpDelete(ENDPOINT + VERSION + ORIGIN_ACCESS_IDENTITY_URI_PATH + "/" + id); try { httpMethod.setHeader("If-Match", currentConfig.getEtag()); HttpResponse response = performRestRequest(httpMethod, 204); releaseConnection(response); } catch(CloudFrontServiceException e) { throw e; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw new CloudFrontServiceException(e); } }
/** * Delete an Origin Access Identity. * * @param id The identifier of the Origin Access Identity. * @throws CloudFrontServiceException exception */ public void deleteOriginAccessIdentity(String id) throws CloudFrontServiceException { if(log.isDebugEnabled()) { log.debug("Deleting origin access identity with id: " + id); } // Get the identity's current config. OriginAccessIdentityConfig currentConfig = getOriginAccessIdentityConfig(id); HttpDelete httpMethod = new HttpDelete(ENDPOINT + VERSION + ORIGIN_ACCESS_IDENTITY_URI_PATH + "/" + id); try { httpMethod.setHeader("If-Match", currentConfig.getEtag()); HttpResponse response = performRestRequest(httpMethod, 204); releaseConnection(response); } catch(CloudFrontServiceException e) { throw e; } catch(RuntimeException e) { throw e; } catch(Exception e) { throw new CloudFrontServiceException(e); } }
httpMethod.setHeader("If-Match", currentConfig.getEtag()); HttpResponse response = performRestRequest(httpMethod, 204); releaseConnection(response);
httpMethod.setHeader("If-Match", currentConfig.getEtag()); HttpResponse response = performRestRequest(httpMethod, 204); releaseConnection(response);
releaseConnection(response); throw e; releaseConnection(response); throw new CloudFrontServiceException("CloudFront Request failed", t);
releaseConnection(response); throw e; releaseConnection(response); throw new CloudFrontServiceException("CloudFront Request failed", t);