+ /* load profile fields. */
+ while (true) {
+ String fieldPrefix = sonePrefix + "/Profile/Fields/" + profile.getFieldNames().size();
+ String fieldName = configuration.getStringValue(fieldPrefix + "/Name").getValue(null);
+ if (fieldName == null) {
+ break;
+ }
+ String fieldValue = configuration.getStringValue(fieldPrefix + "/Value").getValue(null);
+ if (fieldValue == null) {
+ logger.log(Level.WARNING, "Invalid profile field found, aborting load!");
+ return;
+ }
+ profile.addField(fieldName);
+ profile.setField(fieldName, fieldValue);
+ }
+