aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/main/java/com/yahoo/config/subscription/JarSource.java
blob: c106823b52d2c146151ef6b30da4f1a41f953fd9 (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
28
29
30
31
32
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.subscription;

import java.util.jar.JarFile;

/**
 * Source specifying config as a jar file entry
 * @author Vegard Havdal
 */
public class JarSource implements ConfigSource {
    private final String path;
    private final JarFile jarFile;

    /**
     * Creates a new jar source
     * @param jarFile the jar file to use as a source
     * @param path the path within the jar file, or null to use the default config/
     */
    public JarSource(JarFile jarFile, String path) {
        this.path = path;
        this.jarFile = jarFile;
    }

    public JarFile getJarFile() {
        return jarFile;
    }

    public String getPath() {
        return path;
    }

}