public RegisteredProject removeProjectType(String projectPath,String type) throws ConflictException, ForbiddenException, NotFoundException, ServerException {
  final RegisteredProject project=getProject(projectPath);
  if (project == null) {
    return null;
  }
  List<String> newMixins=project.getMixins();
  String newType=project.getType();
  if (newMixins.contains(type)) {
    newMixins.remove(type);
  }
 else   if (newType.equals(type)) {
    if (project.isDetected()) {
      projects.remove(project.getPath());
      return null;
    }
    newType=BaseProjectType.ID;
  }
  final NewProjectConfig conf=new NewProjectConfig(project.getPath(),newType,newMixins,project.getName(),project.getDescription(),project.getAttributes(),project.getSource());
  return putProject(conf,project.getBaseFolder(),true,project.isDetected());
}

public RegisteredProject removeProjectType ( String projectPath , String type ) throws ConflictException , ForbiddenException , NotFoundException , ServerException { final RegisteredProject project = getProject ( projectPath ) ; if ( project == null ) { return null ; } List < String > newMixins = project . getMixins ( ) ; String newType = project . getType ( ) ; if ( newMixins . contains ( type ) ) { newMixins . remove ( type ) ; } else if ( newType . equals ( type ) ) { if ( project . isDetected ( ) ) { projects . remove ( project . getPath ( ) ) ; return null ; } newType = BaseProjectType . ID ; } final NewProjectConfig conf = new NewProjectConfig ( project . getPath ( ) , newType , newMixins , project . getName ( ) , project . getDescription ( ) , project . getAttributes ( ) , project . getSource ( ) ) ; return putProject ( conf , project . getBaseFolder ( ) , true , project . isDetected ( ) ) ; }
extension writer should call this method to apply changes which supposedly make the project no longer have particular project type . in a case of removing primary project type : - if the project was not detected base project type will be set as primary - if the project was detected it will be converted back to the folder for example : - extension code knows that removing some file inside project ' s file system will ( or may ) cause removing particular project type
