import org.onap.usecaseui.server.service.lcm.domain.sdc.bean.SDCServiceTemplate;
import org.onap.usecaseui.server.service.lcm.domain.sdc.exceptions.SDCCatalogException;
import org.onap.usecaseui.server.util.RestfulServices;
+import org.onap.usecaseui.server.util.UuiCommonUtil;
import org.openecomp.sdc.toscaparser.api.NodeTemplate;
import org.openecomp.sdc.toscaparser.api.Property;
import org.openecomp.sdc.toscaparser.api.ToscaTemplate;
String toPath = String.format("/home/uui/%s.csar", uuid);
//String toPath = String.format("D:\\work/%s.csar", uuid);
try {
- downloadFile(toscaModelPath, toPath);
+ if(!UuiCommonUtil.isExistFile(toPath)){
+ downloadFile(toscaModelPath, toPath);
+ }
return extractTemplate(toPath, isVF);
} catch (IOException e) {
throw new SDCCatalogException("download csar file failed!", e);
package org.onap.usecaseui.server.util;
import java.io.BufferedReader;
+import java.io.File;
import java.io.IOException;
import java.lang.reflect.Array;
import java.util.ArrayList;
}
return listPages;
}
+
+ public static boolean isExistFile(String path) {
+
+ if (null == path || "".equals(path.trim())) {
+ return false;
+ }
+
+ File targetFile = new File(path);
+ return targetFile.exists();
+ }
}