if (UtilValidate.isNotEmpty(emailAddress.getString("infoString"))) {
email.setAddress(emailAddress.getString("infoString"));
communication.addEmailAddress(email);
}
ContactIOFactory ciof = Pim.getContactIOFactory();
ContactMarshaller marshaller = ciof.createContactMarshaller();
String saveToDirectory = UtilProperties.getPropertyValue("sfa.properties", "save.outgoing.directory", "");
if (UtilValidate.isEmpty(saveToDirectory)) {
saveToDirectory = System.getProperty("ofbiz.home");
}
String saveToFilename = fullName + ".vcf";
file = FileUtil.getFile(saveToDirectory + "/" + saveToFilename);
FileOutputStream outputStream = new FileOutputStream(file);
marshaller.marshallContact(outputStream, contact);
outputStream.close();
} catch (FileNotFoundException e) {
Debug.logError(e, module);
return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"SfaExportVCardErrorOpeningFile", UtilMisc.toMap("errorString", file.getAbsolutePath()), locale));