class CopyResourceHandler {

    CopyTask createCopyTask(final HttpServerRequest request, final Buffer buffer) {
        JsonObject task = new JsonObject(buffer.toString());
        HeaderFunction headerFunction = HeaderFunctions.DO_NOTHING;

        JsonObject staticHeaders = task.getJsonObject("staticHeaders");
        if (staticHeaders != null) {
            headerFunction = HeaderFunctions.parseStaticHeadersFromJson(staticHeaders);
        } else {
            final JsonArray dynamicHeaders = task.getJsonArray("headers");
            if (dynamicHeaders != null) {
                headerFunction = HeaderFunctions.parseFromJson(dynamicHeaders);
            }
        }

        MultiMap headers = StatusCodeTranslator.getTranslateFreeHeaders(request.headers());

        final HeaderFunctions.EvalScope evalScope = headerFunction.apply(headers);
        if (evalScope.getErrorMessage() != null) {
            log.warn("Problem invoking Header functions: {}", evalScope.getErrorMessage());
            return null;
        }

        HttpHeaderUtil.removeNonForwardHeaders(headers);
        headers.remove("content-length");

        // create copy task
        return new CopyTask(task.getString("source"), task.getString("destination"), headers);
    }

    public  CopyResourceHandler(HttpClient selfClient, String copyPath);

}