All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.centurylink.mdw.model.project.ProjectMeta Maven / Gradle / Ivy

There is a newer version: 6.1.39
Show newest version
package com.centurylink.mdw.model.project;

import com.centurylink.mdw.yaml.YamlLoader;

import java.io.IOException;
import java.util.Map;

/**
 * Info from project.yaml.
 * TODO: base data, which should be available at runtime
 */
public class ProjectMeta {

    private String mdwVersion;
    public String getMdwVersion() { return mdwVersion; }

    private String assetLocation;
    public String getAssetLocation() { return assetLocation; }

    private String configLocation;
    public String getConfigLocation() { return configLocation; }

    public ProjectMeta(byte[] yaml) throws IOException {
        YamlLoader loader = new YamlLoader(new String(yaml));
        Map top = (Map)loader.getTop();
        Map mdw = loader.getMap("mdw", top);
        if (mdw != null)
            mdwVersion = (String)mdw.get("version");
        Map asset = loader.getMap("asset", top);
        if (asset != null)
            assetLocation = (String)asset.get("location");
        Map config = loader.getMap("config", top);
        if (config != null)
            configLocation = (String)config.get("location");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy