Search in sources :

Example 1 with FromCanonical

use of org.eclipse.winery.repository.xml.converter.FromCanonical in project winery by eclipse.

the class XmlRepository method putDefinition.

@Override
public void putDefinition(RepositoryFileReference ref, org.eclipse.winery.model.tosca.TDefinitions content) throws IOException {
    FromCanonical converter = new FromCanonical();
    XTDefinitions definitions = converter.convert(content);
    Path serializationTarget = ref2AbsolutePath(ref);
    Files.createDirectories(serializationTarget.getParent());
    try (OutputStream out = Files.newOutputStream(serializationTarget, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.CREATE)) {
        serialize(definitions, out);
    }
}
Also used : Path(java.nio.file.Path) FromCanonical(org.eclipse.winery.repository.xml.converter.FromCanonical) OutputStream(java.io.OutputStream) XTDefinitions(org.eclipse.winery.model.tosca.xml.XTDefinitions)

Example 2 with FromCanonical

use of org.eclipse.winery.repository.xml.converter.FromCanonical in project winery by eclipse.

the class XmlRepository method serialize.

@Override
public void serialize(org.eclipse.winery.model.tosca.TDefinitions definitions, OutputStream target) throws IOException {
    FromCanonical converter = new FromCanonical();
    XTDefinitions implementedStandard = converter.convert(definitions);
    serialize(implementedStandard, target);
}
Also used : FromCanonical(org.eclipse.winery.repository.xml.converter.FromCanonical) XTDefinitions(org.eclipse.winery.model.tosca.xml.XTDefinitions)

Aggregations

XTDefinitions (org.eclipse.winery.model.tosca.xml.XTDefinitions)2 FromCanonical (org.eclipse.winery.repository.xml.converter.FromCanonical)2 OutputStream (java.io.OutputStream)1 Path (java.nio.file.Path)1