2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2023 Nordix Foundation. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.openecomp.sdc.be.tosca;
22 import fj.data.Either;
23 import java.io.IOException;
24 import java.util.zip.ZipOutputStream;
25 import org.openecomp.sdc.be.model.Component;
26 import org.openecomp.sdc.be.plugins.CsarZipGenerator;
27 import org.openecomp.sdc.exception.ResponseFormat;
30 * Generates a Network Service CSAR based on a SERVICE component and wraps it in a SDC CSAR entry.
32 @org.springframework.stereotype.Component("defaultCsarGenerator")
33 public class DefaultCsarGenerator implements CsarZipGenerator {
35 private static final String DEFINITIONS_PATH = "Definitions/";
36 private final CommonCsarGenerator commonCsarGenerator;
38 public DefaultCsarGenerator(final CommonCsarGenerator commonCsarGenerator) {
39 this.commonCsarGenerator = commonCsarGenerator;
43 public Either<ZipOutputStream, ResponseFormat> generateCsarZip(Component component,
46 boolean isInCertificationRequest,
47 boolean isAsdPackage) throws IOException {
48 return commonCsarGenerator.generateCsarZip(component, getFromCS, zip, isInCertificationRequest, isAsdPackage, DEFINITIONS_PATH, true, false);
52 public String getModel() {