protected void deleteResource(Resource resource) { if (resource._isLinkAvailable("resource:delete")) { try { resource.deleteResource(); } catch (NotFoundException error) {} } // can't delete root resource }
public AmazonApiGateway(String endpoint, String regionId) { Map<Integer, Class<? extends AmazonServiceException>> exceptionClasses = new HashMap<>(); exceptionClasses.put(400, BadRequestException.class); exceptionClasses.put(401, UnauthorizedException.class); exceptionClasses.put(404, NotFoundException.class); exceptionClasses.put(409, ConflictException.class); exceptionClasses.put(429, TooManyRequestsException.class); exceptionClasses.put(503, ServiceUnavailableException.class); this.amazonApiGatewayService = new HalService<>(endpoint == null ? DEFAULT_ENDPOINT : endpoint, SERVICE_NAME, regionId, ApiGateway.class, new StatusCodeErrorResponseHandler(exceptionClasses)); }