private JsonValue readJsonFile(String path) throws AuditException {
   try {
     InputStream is = AuditServiceProviderImpl.class.getResourceAsStream(path);
     String contents = IOUtils.readStream(is);
     return JsonValueBuilder.toJsonValue(contents.replaceAll("\\s", ""));
   } catch (IOException e) {
     debug.error("Unable to read configuration file {}", path, e);
     throw new AuditException("Unable to read configuration file " + path, e);
   }
 }
  private Map<String, Object> toMap(JsonRepresentation entity) throws BadRequestException {
    if (entity == null) {
      return Collections.emptyMap();
    }

    try {
      final String jsonString = entity.getJsonObject().toString();
      if (StringUtils.isNotEmpty(jsonString)) {
        JsonValue jsonContent = JsonValueBuilder.toJsonValue(jsonString);
        return jsonContent.asMap(Object.class);
      }

      return Collections.emptyMap();
    } catch (JSONException e) {
      throw new BadRequestException(e.getMessage());
    }
  }