blob: cbfd516b539740faffbeea86a8df5e590c455483 (
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 Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.http;
import com.yahoo.config.application.api.ApplicationFile;
import java.util.logging.Level;
import com.yahoo.restapi.SlimeJsonResponse;
import com.yahoo.slime.Cursor;
import java.util.*;
/**
* Status and md5sum for files within an application package.
*
* @author hmusum
*/
class SessionContentStatusListResponse extends SlimeJsonResponse {
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger("SessionContentStatusListResponse");
public SessionContentStatusListResponse(String urlBase, List<ApplicationFile> files) {
Cursor array = slime.setArray();
for (ApplicationFile f : files) {
Cursor element = array.addObject();
element.setString("status", f.getMetaData().getStatus());
element.setString("md5", f.getMetaData().getMd5());
element.setString("name", urlBase + f.getPath());
log.log(Level.FINE, () -> "Adding file " + urlBase + f.getPath());
}
}
}
|