// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/util/Constants.java
// public class Constants {
// 
//     public static final int CLIENT_CONNECTION_TIMEOUT = 5000;
//     public static final int CLIENT_READ_TIMEOUT = 5000;
//     public static final String CONFIG_OPERATION_DEPLOY = "deploy";
//     public static final String CONFIG_OPERATION_UNDEPLOY = "undeploy";
//     public static final String MI_SERVER = "mi";
//     public static final String EI_SERVER = "ei";
// 
//     public static final String AUTHORIZATION_HEADER = "Authorization";
//     public static final String BASIC = "Basic ";
//     public static final String ACCESS_TOKEN = "AccessToken";
// }


import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.activation.DataHandler;
import org.apache.axiom.util.base64.Base64Utils;
import org.apache.commons.httpclient.Header;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import org.wso2.carbon.application.mgt.stub.upload.types.carbon.UploadedFileItem;
import org.wso2.carbon.stub.ApplicationAdminStub;
import org.wso2.carbon.stub.CarbonAppUploaderStub;
import org.wso2.maven.car.artifact.util.Constants;
import java.io.File;
        }
    }

    private CarbonAppUploaderStub getCarbonAppUploaderStub(String username,
                                                           String pwd, String url) throws Exception {

        CarbonAppUploaderStub carbonAppUploaderStub =
                new CarbonAppUploaderStub(url + "/services/CarbonAppUploader");
        Header header = createBasicAuthHeader(username, pwd);
        List<Header> list = new ArrayList();
        list.add(header);
        carbonAppUploaderStub._getServiceClient().getOptions()
                .setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS, list);
        return carbonAppUploaderStub;
    }

    private ApplicationAdminStub getApplicationAdminStub(String serverURL, String username, String pwd)
            throws Exception {

        ApplicationAdminStub appAdminStub = new ApplicationAdminStub(serverURL + "/services/ApplicationAdmin");
        Header header = createBasicAuthHeader(username, pwd);
        List<Header> list = new ArrayList();
        list.add(header);
        appAdminStub._getServiceClient().getOptions()
                .setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS, list);
        return appAdminStub;
    }

    private Header createBasicAuthHeader(String userName, String password) {

// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/util/Constants.java
// public class Constants {
// 
//     public static final int CLIENT_CONNECTION_TIMEOUT = 5000;
//     public static final int CLIENT_READ_TIMEOUT = 5000;
//     public static final String CONFIG_OPERATION_DEPLOY = "deploy";
//     public static final String CONFIG_OPERATION_UNDEPLOY = "undeploy";
//     public static final String MI_SERVER = "mi";
//     public static final String EI_SERVER = "ei";
// 
//     public static final String AUTHORIZATION_HEADER = "Authorization";
//     public static final String BASIC = "Basic ";
//     public static final String ACCESS_TOKEN = "AccessToken";
// }


// Path: maven-car-deploy-plugin/src/main/java/org/wso2/maven/car/artifact/EICAppHandler.java
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.activation.DataHandler;
import org.apache.axiom.util.base64.Base64Utils;
import org.apache.commons.httpclient.Header;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import org.wso2.carbon.application.mgt.stub.upload.types.carbon.UploadedFileItem;
import org.wso2.carbon.stub.ApplicationAdminStub;
import org.wso2.carbon.stub.CarbonAppUploaderStub;
import org.wso2.maven.car.artifact.util.Constants;
import java.io.File;

        }
    }

    private CarbonAppUploaderStub getCarbonAppUploaderStub(String username,
                                                           String pwd, String url) throws Exception {

        CarbonAppUploaderStub carbonAppUploaderStub =
                new CarbonAppUploaderStub(url + "/services/CarbonAppUploader");
        Header header = createBasicAuthHeader(username, pwd);
        List<Header> list = new ArrayList();
        list.add(header);
        carbonAppUploaderStub._getServiceClient().getOptions()
                .setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS, list);
        return carbonAppUploaderStub;
    }

    private ApplicationAdminStub getApplicationAdminStub(String serverURL, String username, String pwd)
            throws Exception {

        ApplicationAdminStub appAdminStub = new ApplicationAdminStub(serverURL + "/services/ApplicationAdmin");
        Header header = createBasicAuthHeader(username, pwd);
        List<Header> list = new ArrayList();
        list.add(header);
        appAdminStub._getServiceClient().getOptions()
                .setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS, list);
        return appAdminStub;
    }

    private Header createBasicAuthHeader(String userName, String password) {

        return new Header(Constants.AUTHORIZATION_HEADER,