public Profile importProfile(Profile profile) throws BusinessException, JAXBException, IOException {
  if (null == profile.getId()) {
    throw new BusinessException("Import the profile '" + profile.getName() + "'.",ConfigurationInterfaceErrorCodeEnum.IMPORT_DATA_NOT_VALID);
  }
  profile.setImportDate(new Date());
  if (existingProfiles.containsKey(profile.getId())) {
    Profile old=existingProfiles.replace(profile.getId(),profile);
    Files.deleteIfExists(pathResolver.getProfileFilePath(old));
  }
 else {
    existingProfiles.put(profile.getId(),profile);
  }
  saveProfile(profile);
  return profile;
}

public Profile importProfile ( Profile profile ) throws BusinessException , JAXBException , IOException { if ( null == profile . getId ( ) ) { throw new BusinessException ( "Import the profile '" + profile . getName ( ) + "'." , ConfigurationInterfaceErrorCodeEnum . IMPORT_DATA_NOT_VALID ) ; } profile . setImportDate ( new Date ( ) ) ; if ( existingProfiles . containsKey ( profile . getId ( ) ) ) { Profile old = existingProfiles . replace ( profile . getId ( ) , profile ) ; Files . deleteIfExists ( pathResolver . getProfileFilePath ( old ) ) ; } else { existingProfiles . put ( profile . getId ( ) , profile ) ; } saveProfile ( profile ) ; return profile ; }
imports the profile . note that if profile with the same id already exists it will be overwritten .
