class ConfigurationController {

    private final RuntimeEnvironment env = RuntimeEnvironment.getInstance();

    public static final String PATH = "configuration";

    private final SuggesterService suggesterService;

    @Inject
    public ConfigurationController(SuggesterService suggesterService) {
        this.suggesterService = suggesterService;
    }

    @GET
    @Produces(MediaType.APPLICATION_XML)
    public String get() {
        return env.getConfigurationXML();
    }

    @PUT
    @Consumes(MediaType.APPLICATION_XML)
    public Response set(@Context HttpServletRequest request,
                        @QueryParam("reindex") final boolean reindex) throws IOException {

        String body;
        try (InputStream inputStream = request.getInputStream()) {
            body = new String(inputStream.readAllBytes(), StandardCharsets.UTF_8);
        }

        return ApiTaskManager.getInstance().submitApiTask(PATH,
                new ApiTask(request.getRequestURI(), () -> {
                    env.applyConfig(body, reindex, CommandTimeoutType.RESTFUL);
                    suggesterService.refresh();
                    return null;
                }, Response.Status.CREATED));
    }

    @GET
    @Path("/{field}")
    @Produces(MediaType.APPLICATION_JSON)
    public Object getField(@PathParam("field") final String field) {
        return getConfigurationValueException(field);
    }

    @PUT
    @Path("/{field}")
    public Response setField(@Context HttpServletRequest request,
                             @PathParam("field") final String field, final String value) {

        setConfigurationValueException(field, value);

        return ApiTaskManager.getInstance().submitApiTask(PATH,
                new ApiTask(request.getRequestURI(), () -> {
                    // apply the configuration - let the environment reload the configuration if necessary
                    env.applyConfig(false, CommandTimeoutType.RESTFUL);
                    suggesterService.refresh();
                    return null;
                }, Response.Status.NO_CONTENT));
    }

    @POST
    @Path("/authorization/reload")
    public Response reloadAuthorization(@Context HttpServletRequest request) {
        return ApiTaskManager.getInstance().submitApiTask("authorization",
                new ApiTask(request.getRequestURI(),
                        () -> {
                            env.getAuthorizationFramework().reload();
                            return null;
                        },
                        Response.Status.NO_CONTENT));
    }

    private Object getConfigurationValueException(String fieldName) throws WebApplicationException {<FILL_FUNCTION_BODY>}

    private void setConfigurationValueException(String fieldName, String value)
            throws WebApplicationException {

        final IOException[] capture = new IOException[1];
        final int IOE_INDEX = 0;
        env.syncWriteConfiguration(value, (configuration, v) -> {
            try {
                ClassUtil.setFieldValue(configuration, fieldName, v);
            } catch (IOException ex) {
                capture[IOE_INDEX] = ex;
            }
        });
        if (capture[IOE_INDEX] != null) {
            throw new WebApplicationException(capture[IOE_INDEX], Response.Status.BAD_REQUEST);
        }
    }
}

        final IOException[] capture = new IOException[1];
        final int IOE_INDEX = 0;
        Object result = env.syncReadConfiguration(configuration -> {
            try {
                return ClassUtil.getFieldValue(configuration, fieldName);
            } catch (IOException ex) {
                capture[IOE_INDEX] = ex;
                return null;
            }
        });
        if (capture[IOE_INDEX] != null) {
            throw new WebApplicationException(capture[IOE_INDEX], Response.Status.BAD_REQUEST);
        }
        return result;
    
<no_super_class>