@Override
    public synchronized FileReference addFile(String relativePath) {
        if (relativePath.startsWith("/"))
            throw new IllegalArgumentException(relativePath + " is not relative");

        Optional<FileReference> cachedReference = Optional.ofNullable(fileReferenceCache.get(relativePath));
        return cachedReference.orElseGet(() -> {
            try {
                FileReference newRef = manager.addFile(Path.fromString(relativePath));
                fileReferenceCache.put(relativePath, newRef);
                return newRef;
            } catch (FileNotFoundException e) {
                if (silenceNonExistingFiles) {
                    return new FileReference("non-existing-file");
                } else {
                    throw new IllegalArgumentException(e);
                }
            } catch (IOException e) {
                throw new IllegalArgumentException(e);
            }
            }
        );
    }
File registry for one application package

@author Tony Vaagenes
configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/FileDBRegistry.java