summaryrefslogtreecommitdiffstats
path: root/configserver/src/main/java/com/yahoo/vespa/config/server/filedistribution/ApplicationFileManager.java
blob: 82535143c89cb8521860f06c8f93197db339b2b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// 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 java.io.File;

public class ApplicationFileManager implements AddFileInterface {

    private final File applicationDir;
    private final FileDirectory master;

    ApplicationFileManager(File applicationDir, FileDirectory master) {
        this.applicationDir = applicationDir;
        this.master = master;
    }

    @Override
    public FileReference addFile(String relativePath, FileReference reference) {
        return master.addFile(new File(applicationDir, relativePath), reference);
    }

    @Override
    public FileReference addFile(String relativePath) {
        return master.addFile(new File(applicationDir, relativePath));
    }

}