private void registerFileEntry(ConfigPayloadBuilder builder, Map<Path, FileReference> registeredFiles, boolean isModelType) {
        Path path;
        if (isModelType) {
            var modelReference = ModelReference.valueOf(builder.getValue());
            if (modelReference.path().isEmpty()) {
                modelReference.url().ifPresent(url -> userConfiguredUrls.add(url.value()));
                return;
            }
            path = Path.fromString(modelReference.path().get().value());
        }
        else {
            path = Path.fromString(builder.getValue());
        }

        ApplicationFile file = applicationPackage.getFile(path);
        if (file.isDirectory() && (file.listFiles() == null || file.listFiles().isEmpty()))
            logger.logApplicationPackage(INFO, "Directory '" + path.getRelative() + "' is empty");

        FileReference reference = registeredFiles.get(path);
        if (reference == null) {
            reference = fileRegistry.addFile(path.getRelative());
            registeredFiles.put(path, reference);
        }
        if (reference == null)
            throw new IllegalArgumentException("No such file or directory '" + path.getRelative() + "'");

        if (isModelType) {
            var model = ModelReference.valueOf(builder.getValue());
            var modelWithReference = ModelReference.unresolved(model.modelId(), model.url(), Optional.of(reference));
            builder.setValue(modelWithReference.toString());
        }
        else {
            builder.setValue(reference.value());
        }
    }
Registers user configured files for a producer for file distribution.
config-model/src/main/java/com/yahoo/vespa/model/filedistribution/UserConfiguredFiles.java