// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.filedistribution;

import com.yahoo.config.FileReference;
import com.yahoo.config.application.api.FileRegistry;

import java.util.List;

public class CombinedLegacyRegistry implements FileRegistry {
    private final FileDBRegistry legacy;
    private final FileDBRegistry future;

    CombinedLegacyRegistry(FileDBRegistry legacy, FileDBRegistry future) {
        this.legacy = legacy;
        this.future = future;
    }
    @Override
    public FileReference addFile(String relativePath) {
        FileReference reference = legacy.addFile(relativePath);
        return future.addFile(relativePath, reference);
    }

    @Override
    public String fileSourceHost() {
        return future.fileSourceHost();
    }

    @Override
    public List<Entry> export() {
        return future.export();
    }
}

@@ -707,38 +707,66 @@
 ePath);%0A        
-return
+// TODO: Enable when system tested
  future.addFile(
@@ -791,16 +791,42 @@
 rence);%0A
+        return reference;%0A
     %7D%0A%0A 

Disable double addFile as legacy code has not been verified yet.