import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
import java.util.Map.Entry;
import org.apache.http.HttpEntity;
import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse;
import org.openecomp.sdc.ci.tests.utils.Utils;
import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils;
+import org.openecomp.sdc.ci.tests.utils.general.FileHandling;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
return httpclient.execute(httpGet);
}
- public static File getToscaModelCsarFile(AssetTypeEnum assetType, String uuid) throws IOException {
+ public static File getToscaModelCsarFile(AssetTypeEnum assetType, String uuid, String fileName) throws IOException {
Config config = Utils.getConfig();
CloseableHttpClient httpclient = HttpClients.createDefault();
String url = String.format(Urls.GET_TOSCA_MODEL, config.getCatalogBeHost(), config.getCatalogBePort(),
assetType.getValue(), uuid);
HttpGet httpGet = new HttpGet(url);
- File myFile = new File("tmpCSAR");
+
+ String csarDir = FileHandling.getCreateDirByName("outputCsar");
+ File myFile = new File(csarDir+ File.separator + "tmpCSAR_" + fileName + ".csar");
httpGet.addHeader(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci");
}
return myFile;
}
-
+
+
+
public static RestResponse getRestResponseComponentToscaModel(AssetTypeEnum assetType, String uuid) throws IOException {
Config config = Utils.getConfig();
}
return null;
}
+ private static String getShortUUID() {
+ return UUID.randomUUID().toString().split("-")[0];
+ }
}