aboutsummaryrefslogtreecommitdiffstats
path: root/configserver/src/main/java/com/yahoo/vespa/config/server/http/SessionContentListResponse.java
blob: 0a9d6e36767b08073854a3f229d4124b083c34d3 (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
// Copyright Yahoo. 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 com.yahoo.restapi.SlimeJsonResponse;
import com.yahoo.slime.Cursor;

import java.util.List;

/**
 * Represents a request for listing files within an application package.
 *
 * @author Ulf Lilleengen
 */
class SessionContentListResponse extends SlimeJsonResponse {

    public SessionContentListResponse(String urlBase, List<ApplicationFile> files) {
        Cursor array = slime.setArray();
        for (ApplicationFile file : files) {
            array.addString(urlBase + file.getPath() + (file.isDirectory() ? "/" : ""));
        }
    }

}