public void deleteProfile(Profile profile) throws BusinessException, IOException {
  if (profile.isCommonProfile()) {
    throw new BusinessException("Delete the profile '" + profile.getName() + ".",ConfigurationInterfaceErrorCodeEnum.COMMON_PROFILE_CAN_NOT_BE_ALTERED);
  }
  String id=profile.getId();
  Profile local=existingProfiles.remove(id);
  if (null != local) {
    Files.deleteIfExists(pathResolver.getProfileFilePath(local));
    for (    Environment environment : existingEnvironments.values()) {
      if (checkProfiles(environment)) {
        try {
          updateEnvironment(environment,false);
        }
 catch (        Exception e) {
          log.error("Update of the environment on the profile deletion failed.",e);
        }
      }
    }
  }
}

public void deleteProfile ( Profile profile ) throws BusinessException , IOException { if ( profile . isCommonProfile ( ) ) { throw new BusinessException ( "Delete the profile '" + profile . getName ( ) + "." , ConfigurationInterfaceErrorCodeEnum . COMMON_PROFILE_CAN_NOT_BE_ALTERED ) ; } String id = profile . getId ( ) ; Profile local = existingProfiles . remove ( id ) ; if ( null != local ) { Files . deleteIfExists ( pathResolver . getProfileFilePath ( local ) ) ; for ( Environment environment : existingEnvironments . values ( ) ) { if ( checkProfiles ( environment ) ) { try { updateEnvironment ( environment , false ) ; } catch ( Exception e ) { log . error ( "Update of the environment on the profile deletion failed." , e ) ; } } } } }
deletes the existing profile .
