File file = null;
try {
ContactModelFactory cmf = Pim.getContactModelFactory();
Contact contact = cmf.createContact();
PersonalIdentity pid = cmf.createPersonalIdentity();
String fullName = PartyHelper.getPartyName(delegator, partyId, false);
String[] name = fullName.split("\\s");
pid.setFirstname(name[0]);
pid.setLastname(name[1]);
contact.setPersonalIdentity(pid);
GenericValue postalAddress = PartyWorker.findPartyLatestPostalAddress(partyId, delegator);
Address address = cmf.createAddress();
address.setStreet(postalAddress.getString("address1"));