private void doFinish ( String containerName , IPath location , IProgressMonitor monitor ) throws CoreException { // create a sample file monitor . beginTask ( "Creating " + containerName , 2 ) ; monitor . worked ( 1 ) ; final Archetype archetype = new Archetype ( ) ; archetype . setGroupId ( "org.glassmaker" ) ; archetype . setArtifactId ( "org.glassmaker.archetype.basic" ) ; archetype . setVersion ( "0.0.1" ) ; ProjectParameters params = parametersPage . getParams ( ) ; final String groupId = params . getGroupId ( ) ; final String artifactId = params . getArtifactId ( ) ; final String version = params . getVersion ( ) ; final String javaPackage = params . getPackageName ( ) ; final Properties properties = params . getProperties ( ) ; properties . setProperty ( "oauth2callbackurl" , properties . getProperty ( ProjectWizardParametersPage . O_AUTH_CALLBACK ) ) ; properties . setProperty ( "clientid" , properties . getProperty ( ProjectWizardParametersPage . CLIENT_ID ) ) ; properties . setProperty ( "clientsecret" , properties . getProperty ( ProjectWizardParametersPage . CLIENT_SECRET ) ) ; List < IProject > projects = MavenPlugin . getProjectConfigurationManager ( ) . createArchetypeProjects ( location , archetype , groupId , artifactId , version , javaPackage , properties , importConfiguration , monitor ) ; }
The worker method . It will find the container create the file if missing or just replace its contents and open the editor on the newly created file .