// Path: vscode-car-plugin/src/main/java/org/wso2/maven/Model/ArchiveException.java
// public class ArchiveException extends Exception {
//     public ArchiveException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: vscode-car-plugin/src/main/java/org/wso2/maven/Model/ArtifactDependency.java
// public class ArtifactDependency {
//     private String artifact;
//     private String version;
//     private String serverRole;
//     private Boolean include;
// 
//     public ArtifactDependency(String artifact, String version, String serverRole, Boolean include) {
//         this.artifact = artifact;
//         this.version = version;
//         this.serverRole = serverRole;
//         this.include = include;
//     }
// 
//     /**
//      * @return the artifact
//      */
//     public String getArtifact() {
//         return artifact;
//     }
// 
//     /**
//      * @param artifact of the dependency
//      */
//     public void setArtifact(String artifact) {
//         this.artifact = artifact;
//     }
// 
//     /**
//      * @return the verison
//      */
//     public String getVersion() {
//         return version;
//     }
// 
//     /**
//      * @param version of the dependency
//      */
//     public void setVersion(String version) {
//         this.version = version;
//     }
// 
//     /**
//      * @return the serverRole
//      */
//     public String getServerRole() {
//         return serverRole;
//     }
// 
//     /**
//      * @param serverRole of the dependency
//      */
//     public void setServerRole(String serverRole) {
//         this.serverRole = serverRole;
//     }
// 
//     /**
//      * @return include
//      */
//     public Boolean getInclude() {
//         return include;
//     }
// 
//     /**
//      * @param include of the dependency
//      */
//     public void setInclude(Boolean include) {
//         this.include = include;
//     }
// }


import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.project.MavenProject;
import org.wso2.maven.Model.ArchiveException;
import org.wso2.maven.Model.ArtifactDependency;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.xml.stream.XMLStreamException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
    }

    /**
     * Add the given folder to the given location in the .car file.
     *
     * @param path:      file path in the .car file
     * @param srcFolder: folder to be included in the .car file
     * @param zip:       ZipOutputStream
     */
    private void addFolderToZip(String path, String srcFolder, ZipOutputStream zip) throws ArchiveException {
        File folder = new File(srcFolder);
        String[] fileList = folder.list();
        if (fileList == null) {
            return;
        }
        try {
            int i = 0;
            while (true) {
                if (fileList.length == i) break;
                String newPath = folder.getName();
                if (!path.equalsIgnoreCase(Constants.EMPTY_STRING)) {
                    newPath = path + "/" + newPath;
                }
                if (new File(folder, fileList[i]).isDirectory()) {
                    zip.putNextEntry(new ZipEntry(newPath + "/" + fileList[i] + "/"));
                }
                addToZip(newPath, srcFolder + "/" + fileList[i], zip);
                i++;
            }
        } catch (IOException ex) {
// Path: vscode-car-plugin/src/main/java/org/wso2/maven/Model/ArchiveException.java
// public class ArchiveException extends Exception {
//     public ArchiveException(String message, Throwable cause) {
//         super(message, cause);
//     }
// }
// 
// Path: vscode-car-plugin/src/main/java/org/wso2/maven/Model/ArtifactDependency.java
// public class ArtifactDependency {
//     private String artifact;
//     private String version;
//     private String serverRole;
//     private Boolean include;
// 
//     public ArtifactDependency(String artifact, String version, String serverRole, Boolean include) {
//         this.artifact = artifact;
//         this.version = version;
//         this.serverRole = serverRole;
//         this.include = include;
//     }
// 
//     /**
//      * @return the artifact
//      */
//     public String getArtifact() {
//         return artifact;
//     }
// 
//     /**
//      * @param artifact of the dependency
//      */
//     public void setArtifact(String artifact) {
//         this.artifact = artifact;
//     }
// 
//     /**
//      * @return the verison
//      */
//     public String getVersion() {
//         return version;
//     }
// 
//     /**
//      * @param version of the dependency
//      */
//     public void setVersion(String version) {
//         this.version = version;
//     }
// 
//     /**
//      * @return the serverRole
//      */
//     public String getServerRole() {
//         return serverRole;
//     }
// 
//     /**
//      * @param serverRole of the dependency
//      */
//     public void setServerRole(String serverRole) {
//         this.serverRole = serverRole;
//     }
// 
//     /**
//      * @return include
//      */
//     public Boolean getInclude() {
//         return include;
//     }
// 
//     /**
//      * @param include of the dependency
//      */
//     public void setInclude(Boolean include) {
//         this.include = include;
//     }
// }


// Path: vscode-car-plugin/src/main/java/org/wso2/maven/CARMojo.java
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.project.MavenProject;
import org.wso2.maven.Model.ArchiveException;
import org.wso2.maven.Model.ArtifactDependency;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.xml.stream.XMLStreamException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;

    }

    /**
     * Add the given folder to the given location in the .car file.
     *
     * @param path:      file path in the .car file
     * @param srcFolder: folder to be included in the .car file
     * @param zip:       ZipOutputStream
     */
    private void addFolderToZip(String path, String srcFolder, ZipOutputStream zip) throws ArchiveException {
        File folder = new File(srcFolder);
        String[] fileList = folder.list();
        if (fileList == null) {
            return;
        }
        try {
            int i = 0;
            while (true) {
                if (fileList.length == i) break;
                String newPath = folder.getName();
                if (!path.equalsIgnoreCase(Constants.EMPTY_STRING)) {
                    newPath = path + "/" + newPath;
                }
                if (new File(folder, fileList[i]).isDirectory()) {
                    zip.putNextEntry(new ZipEntry(newPath + "/" + fileList[i] + "/"));
                }
                addToZip(newPath, srcFolder + "/" + fileList[i], zip);
                i++;
            }
        } catch (IOException ex) {
            throw new ArchiveException(Constants.ARCHIVE_EXCEPTION_MSG, ex);