@Override public Path save( final Path resource, final PackageConfiguration packageConfiguration, final Metadata metadata, final String comment ) { ioService.write( paths.convert( resource ), packageConfigurationContentHandler.toString( packageConfiguration ), metadataService.setUpAttributes( resource, metadata ), makeCommentedOption( comment ) ); //Invalidate Project-level DMO cache as project.imports has changed. invalidateDMOProjectCache.fire( new InvalidateDMOProjectCacheEvent( resource ) ); //Signal update to interested parties resourceUpdatedEvent.fire( new ResourceUpdatedEvent( resource ) ); return resource; }
@Override public Path newProject( final Path activePath, final String projectName, final String baseURL ) { //Projects are always created in the FS root final Path fsRoot = getFileSystemRoot( activePath ); final Path projectRootPath = getProjectRootPath( fsRoot, projectName ); //Set-up project structure and KModule.xml kModuleService.setUpKModuleStructure( projectRootPath ); //Create POM.xml pomService.create( projectRootPath, baseURL ); //Create Project configuration final Path projectConfigPath = paths.convert( paths.convert( projectRootPath ).resolve( "project.imports" ), false ); ioService.createFile( paths.convert( projectConfigPath ) ); ioService.write( paths.convert( projectConfigPath ), packageConfigurationContentHandler.toString( new PackageConfiguration() ) ); //Signal creation to interested parties resourceAddedEvent.fire( new ResourceAddedEvent( projectRootPath ) ); return paths.convert( paths.convert( projectRootPath ).resolve( "pom.xml" ) ); }