@Override
 public void generateDeployableFile(
     String rootPath, String applicationId, String version, String stage)
     throws AppFactoryException {
   String applicationExtenstion =
       ProjectUtils.getApplicationExtenstion(
           applicationId, CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
   String artifactFileName =
       applicationId
           + AppFactoryConstants.APPFACTORY_ARTIFACT_NAME_VERSION_SEPERATOR
           + version
           + AppFactoryConstants.FILENAME_EXTENSION_SEPERATOR
           + applicationExtenstion;
   String uploadedAppSrcFile =
       rootPath
           + File.separator
           + AppFactoryConstants.AF_GIT_TMP_FOLDER
           + File.separator
           + artifactFileName;
   String uploadedApptmpFolder =
       rootPath + File.separator + AppFactoryConstants.DEPLOYABLE_ARTIFACT_FOLDER;
   try {
     FileUtils.copyFileToDirectory(new File(uploadedAppSrcFile), new File(uploadedApptmpFolder));
   } catch (IOException e) {
     String errMsg = "Error when copying folder from src to artifact tmp : " + e.getMessage();
     log.error(errMsg, e);
     throw new AppFactoryException(errMsg, e);
   }
 }
  @Override
  public void generateApplicationSkeleton(String applicationID, String workingDirectory)
      throws AppFactoryException {

    try {
      String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain();
      String applicationExtenstion =
          ProjectUtils.getApplicationExtenstion(applicationID, tenantDomain);
      String uploadedFileName =
          applicationID
              + "-1.0.0."
              + applicationExtenstion
              + AppFactoryConstants.UPPLOADABLE_SUFFIX;
      copyUploadedAppToLocation(uploadedFileName, workingDirectory);

      if (log.isDebugEnabled()) {
        log.debug(
            "Application skeleton creation hanlded for Uploaded application type with application key -"
                + applicationID);
      }
    } catch (IOException e) {
      log.error(e);
      throw new AppFactoryException("Error when generating uploaded application skeleton", e);
    }
  }
 @Override
 public List<File> getPreVersionDeleteableFiles(
     String applicationID, String targetVersion, String currentVersion, String workingDir)
     throws AppFactoryException {
   String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain();
   String applicationExtension;
   applicationExtension = ProjectUtils.getApplicationExtenstion(applicationID, tenantDomain);
   List<File> deletableFiles = new ArrayList<File>();
   deletableFiles.add(
       new File(
           CarbonUtils.getTmpDir()
               + File.separator
               + AppFactoryConstants.REPOSITORY_BRANCH
               + File.separator
               + applicationID
               + File.separator
               + targetVersion
               + File.separator
               + applicationID
               + AppFactoryConstants.MINUS
               + AppFactoryConstants.INITIAL_UPLOADED_APP_VERSION
               + AppFactoryConstants.DOT_SEPERATOR
               + applicationExtension));
   return deletableFiles;
 }