Search in sources :

Example 1 with Reader

use of org.eclipse.winery.yaml.common.reader.xml.Reader in project winery by eclipse.

the class WriterUtils method loadDefinitions.

public static Definitions loadDefinitions(Path path, String namespace, String name) {
    Path filePath = getDefinitionsPath(path, namespace, name);
    Reader reader = new Reader();
    try {
        return reader.parse(new FileInputStream(filePath.toFile()));
    } catch (JAXBException | FileNotFoundException e) {
        e.printStackTrace();
    }
    return new Definitions();
}
Also used : Path(java.nio.file.Path) JAXBException(javax.xml.bind.JAXBException) Definitions(org.eclipse.winery.model.tosca.Definitions) TDefinitions(org.eclipse.winery.model.tosca.TDefinitions) Reader(org.eclipse.winery.yaml.common.reader.xml.Reader)

Aggregations

Path (java.nio.file.Path)1 JAXBException (javax.xml.bind.JAXBException)1 Definitions (org.eclipse.winery.model.tosca.Definitions)1 TDefinitions (org.eclipse.winery.model.tosca.TDefinitions)1 Reader (org.eclipse.winery.yaml.common.reader.xml.Reader)1