private void processResource(Payload payload, Optional<String> resourceOptional) {

        Optional<String> httpOptional = resourceOptional
                .map(String::trim)
                .filter(e -> e.startsWith("http"));

        Optional<Path> pathOptional = resourceOptional
                .filter(e -> !e.isEmpty())
                .filter(e -> !e.startsWith("http"))
                .map(String::trim)
                .map(Paths::get)
                .filter(Files::exists)
                .filter(e -> !Files.isDirectory(e));

        if (httpOptional.isPresent()) {
            payload.sendRedirect(httpOptional.get());
        } else if (pathOptional.isPresent()) {
            Path path = pathOptional.get();
            fileService.processFile(payload, path);
        } else {
            fileService.processFile(payload, controller.getConfigPath().resolve("public").resolve(payload.getFinalURI()));
        }
    }
", "/afx/dynamic/*.*"}, method = {GET, HEAD, OPTIONS, POST}, produces = "
src/main/java/com/kodedu/controller/DynamicResource.java