use of ezvcard.property.Uid in project ez-vcard by mangstadt.
the class HCardPageTest method createFullVCard.
private VCard createFullVCard() throws IOException {
VCard vcard = new VCard();
StructuredName n = new StructuredName();
n.setFamily("Claus");
n.setGiven("Santa");
n.getAdditionalNames().add("Saint Nicholas");
n.getAdditionalNames().add("Father Christmas");
n.getPrefixes().add("Mr");
n.getPrefixes().add("Dr");
n.getSuffixes().add("M.D.");
n.setSortAs("Claus");
vcard.setStructuredName(n);
vcard.setClassification("public");
vcard.setMailer("Thunderbird");
vcard.setFormattedName("Santa Claus");
vcard.setNickname("Kris Kringle");
vcard.addTitle("Manager");
vcard.addRole("Executive");
vcard.addRole("Team Builder");
vcard.addEmail("johndoe@hotmail.com", EmailType.HOME, EmailType.WORK);
vcard.addEmail("doe.john@company.com", EmailType.WORK);
Telephone tel = new Telephone(new TelUri.Builder("+1-555-222-3333").extension("101").build());
vcard.addTelephoneNumber(tel);
tel = new Telephone(new TelUri.Builder("+1-555-333-4444").build());
tel.getTypes().add(TelephoneType.WORK);
vcard.addTelephoneNumber(tel);
vcard.addTelephoneNumber("(555) 111-2222", TelephoneType.HOME, TelephoneType.VOICE, TelephoneType.PREF);
Address adr = new Address();
adr.setStreetAddress("123 Main St");
adr.setExtendedAddress("Apt 11");
adr.setLocality("Austin");
adr.setRegion("Tx");
adr.setPostalCode("12345");
adr.setCountry("USA");
adr.setLabel("123 Main St." + NEWLINE + "Austin TX, 12345" + NEWLINE + "USA");
adr.getTypes().add(AddressType.HOME);
vcard.addAddress(adr);
adr = new Address();
adr.setPoBox("123");
adr.setStreetAddress("456 Wall St.");
adr.setLocality("New York");
adr.setRegion("NY");
adr.setPostalCode("11111");
adr.setCountry("USA");
adr.getTypes().add(AddressType.PREF);
adr.getTypes().add(AddressType.WORK);
vcard.addAddress(adr);
vcard.setOrganization("Google", "GMail");
Birthday bday = new Birthday(date("1970-03-08"), false);
vcard.setBirthday(bday);
vcard.addUrl("http://company.com");
vcard.setCategories("business owner", "jolly");
vcard.addImpp(Impp.aim("myhandle"));
vcard.addImpp(Impp.yahoo("myhandle@yahoo.com"));
vcard.addNote("I am proficient in Tiger-Crane Style," + NEWLINE + "and I am more than proficient in the exquisite art of the Samurai sword.");
vcard.setGeo(123.456, -98.123);
vcard.setTimezone(new Timezone(new UtcOffset(false, -6, 0), "America/Chicago"));
InputStream in = getClass().getResourceAsStream("hcard-portrait.jpg");
Photo photo = new Photo(in, ImageType.JPEG);
vcard.addPhoto(photo);
in = getClass().getResourceAsStream("hcard-sound.ogg");
Sound sound = new Sound(in, SoundType.OGG);
vcard.addSound(sound);
vcard.setUid(new Uid("urn:uuid:ffce1595-cbe9-4418-9d0d-b015655d45f6"));
vcard.setRevision(date("2000-03-10 13:22:44"));
return vcard;
}
Aggregations