import java.net.URI;
import java.nio.file.Path;
import java.nio.file.Paths;
+import java.util.Enumeration;
import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
import java.util.zip.ZipInputStream;
import org.apache.commons.io.IOUtils;
}
return;
}
+
+ public boolean containsWorkflows(String csarFilePath) {
+ boolean workflowsInCsar = false;
+ try {
+ ZipFile zipFile = new ZipFile(csarFilePath);
+ Enumeration<? extends ZipEntry> zipEntries = zipFile.entries();
+ while (zipEntries.hasMoreElements()) {
+ String fileName = ((ZipEntry) zipEntries.nextElement()).getName();
+ if (fileName.endsWith(BPMN_SUFFIX)) {
+ workflowsInCsar = true;
+ break;
+ }
+ }
+ }
+ catch (Exception e) {
+ LOGGER.debug("Exception :",e);
+ LOGGER.error(MessageEnum.ASDC_ARTIFACT_CHECK_EXC,
+ csarFilePath,
+ "",
+ "",
+ e.getMessage(), "", "", MsoLogger.ErrorCode.DataError, "ASDC Unable to check CSAR entries");
+ }
+ return workflowsInCsar;
+ }
protected HttpResponse sendDeploymentRequest(String bpmnFileName) throws Exception {
HttpClient client = HttpClientBuilder.create().build();