components/studio-platform/plugins/org.wso2.integrationstudio.docker.distribution/src/org/wso2/integrationstudio/docker/distribution/action/DockerBuildActionUtil.java
/**
     * Export the associated carbon application to a given folder location.
     * 
     * @param project Carbon application project.
     * @param location Destination folder.
     * @throws IOException Error occurred while copying file.
     * @throws XmlPullParserException Error occurred while parsing the pom file.
     */
Export the associated carbon application to a given folder location.

@param project Carbon application project.
@param location Destination folder.
@throws IOException Error occurred while copying file.
@throws XmlPullParserException Error occurred while parsing the pom file.
Export the associated carbon application to a given folder location . @param project Carbon application project . @param location Destination folder . @throws IOException Error occurred while copying file . @throws XmlPullParserException Error occurred while parsing the pom file .
private static void exportCarToM2Folder(IProject project, String location)
            throws IOException, XmlPullParserException {
        IFile pomFileRes = project.getFile(POM_XML);
        File pomFile = pomFileRes.getLocation().toFile();
        MavenProject parentPrj = MavenUtils.getMavenProject(pomFile);
        String finalFileName = String.format("%s-%s.car", parentPrj.getModel().getArtifactId(),
                parentPrj.getModel().getVersion());
        try {
            IResource CarbonArchive = ExportUtil.buildCAppProject(pomFileRes.getProject());
            String groupID = parentPrj.getModel().getGroupId();
            groupID = groupID.replace(".", File.separator);
            location = location + File.separator + groupID + File.separator + parentPrj.getModel().getArtifactId()
                    + File.separator + parentPrj.getModel().getVersion();
            File destFileName = new File(location.trim(), finalFileName);
            if (destFileName.exists()) {
                org.apache.commons.io.FileUtils.deleteQuietly(destFileName);
            }
            FileUtils.copyFile(CarbonArchive.getLocation().toFile(), destFileName);
        } catch (Exception e) {
            log.error("An error occurred while creating the carbon archive file", e);
        }
    }
private static void exportCarToM2Folder ( IProject project , String location ) throws IOException , XmlPullParserException { IFile pomFileRes = project . getFile ( POM_XML ) ; File pomFile = pomFileRes . getLocation ( ) . toFile ( ) ; MavenProject parentPrj = MavenUtils . getMavenProject ( pomFile ) ; String finalFileName = String . format ( "%s-%s.car" , parentPrj . getModel ( ) . getArtifactId ( ) , parentPrj . getModel ( ) . getVersion ( ) ) ; try { IResource CarbonArchive = ExportUtil . buildCAppProject ( pomFileRes . getProject ( ) ) ; String groupID = parentPrj . getModel ( ) . getGroupId ( ) ; groupID = groupID . replace ( "." , File . separator ) ; location = location + File . separator + groupID + File . separator + parentPrj . getModel ( ) . getArtifactId ( ) + File . separator + parentPrj . getModel ( ) . getVersion ( ) ; File destFileName = new File ( location . trim ( ) , finalFileName ) ; if ( destFileName . exists ( ) ) { org . apache . commons . io . FileUtils . deleteQuietly ( destFileName ) ; } FileUtils . copyFile ( CarbonArchive . getLocation ( ) . toFile ( ) , destFileName ) ; } catch ( Exception e ) { log . error ( "An error occurred while creating the carbon archive file" , e ) ; } }
Export the associated carbon application to a given folder location.
Export the associated carbon application to a given folder location .