/** * 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); } }
builder.asString(null), ContentType.create("text/xml", Constants.DEFAULT_ENCODING))); httpMethod.setHeader("If-Match", oldConfig.getEtag()); HttpResponse response = performRestRequest(httpMethod, 200);
builder.asString(null), ContentType.create("text/xml", Constants.DEFAULT_ENCODING))); httpMethod.setHeader("If-Match", oldConfig.getEtag()); HttpResponse response = performRestRequest(httpMethod, 200);