class StaticFileHandler implements HttpHandler {

    @Override
    public Eventual<LiveHttpResponse> handle(LiveHttpRequest request, HttpInterceptor.Context context) {
        try {
            return resolveFile(request.path())
                    .map(ResolvedFile::new)
                    .map(resolvedFile -> HttpResponse.response()
                            .addHeader(CONTENT_TYPE, resolvedFile.mediaType)
                            .body(resolvedFile.content, UTF_8)
                            .build()
                            .stream())
                    .map(Eventual::of)
                    .orElseGet(() -> new HttpAggregator(NOT_FOUND_HANDLER).handle(request, context));
        } catch (IOException e) {
            return Eventual.of(HttpResponse.response(INTERNAL_SERVER_ERROR).build().stream());
        }
    }

    public  StaticFileHandler(File dir);

}