private void downloadFile(Request req) {
        FileReference fileReference = new FileReference(req.parameters().get(0).asString());
        log.log(Level.FINE, () -> "getFile() called for file reference '" + fileReference.value() + "'");
        Optional<File> file = downloader.getFile(new FileReferenceDownload(fileReference, HostName.getLocalhost()));
        if (file.isPresent()) {
            new RequestTracker().trackRequest(file.get().getParentFile());
            req.returnValues().add(new StringValue(file.get().getAbsolutePath()));
            log.log(Level.FINE, () -> "File reference '" + fileReference.value() + "' available at " + file.get());
        } else {
            log.log(Level.INFO, "File reference '" + fileReference.value() + "' not found");
            req.setError(fileReferenceNotFound, "File reference '" + fileReference.value() + "' not found");
        }

        req.returnRequest();
    }
An RPC server that handles file distribution requests.

@author hmusum
config-proxy/src/main/java/com/yahoo/vespa/config/proxy/filedistribution/FileDistributionRpcServer.java