blob: 492bc2e410c60da827b718c93d1a4eb59b502719 (
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
33
34
35
36
37
38
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.application.api;
import com.yahoo.config.FileReference;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* @author Tony Vaagenes
*/
public interface FileRegistry {
FileReference addFile(String relativePath);
FileReference addUri(String uri);
FileReference addBlob(String name, ByteBuffer blob);
default FileReference addApplicationPackage() { return addFile(""); }
List<Entry> export();
default Set<FileReference> asSet() {
return export().stream()
.map(e -> e.reference)
.collect(Collectors.toSet());
}
class Entry {
public final String relativePath;
public final FileReference reference;
public Entry(String relativePath, FileReference reference) {
this.relativePath = relativePath;
this.reference = reference;
}
}
}
|