Examples of VCardImpl


Examples of net.sourceforge.cardme.vcard.VCardImpl

    rev.set(Calendar.DAY_OF_MONTH, 22);
    rev.set(Calendar.HOUR_OF_DAY, 14);
    rev.set(Calendar.MINUTE, 30);
    rev.set(Calendar.SECOND, 5);
   
    VCardImpl vcard = getSimpleVCard();
    vcard.setRev(new RevType(rev));
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCardImpl

    assertTrue(vcardStr.contains("REV:2011-12-22T14:30:05Z\r\n"));
  }
 
  @Test
  public void testBuildUidType() throws VCardBuildException {
    VCardImpl vcard = getSimpleVCard();
    vcard.setUid(new UidType("c0ff639f-9633-4e57-bcfd-55079cfd9d65"));
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCardImpl

    Calendar bday = Calendar.getInstance();
    bday.set(Calendar.YEAR, 1980);
    bday.set(Calendar.MONTH, 4);
    bday.set(Calendar.DAY_OF_MONTH, 21);
   
    VCardImpl vcard = getSimpleVCard();
    BDayType bdayType = new BDayType(bday);
    bdayType.setParam(BDayParamType.DATE);
    vcard.setBDay(bdayType);
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCardImpl

    assertTrue(vcardStr.contains("BDAY;VALUE=DATE:1980-05-21\r\n"));
  }
 
  @Test
  public void testBuildAdrType() throws VCardBuildException {
    VCardImpl vcard = getSimpleVCard();
    AdrType adr = new AdrType();
    adr.setPostOfficeBox("25334");
    adr.setStreetAddress("South cresent drive, Building 5, 3rd floor");
    adr.setLocality("New York");
    adr.setRegion("New York");
    adr.setPostalCode("NYC887");
    adr.setCountryName("U.S.A.");
    adr.addParam(AdrParamType.HOME).addParam(AdrParamType.PARCEL).addParam(AdrParamType.PREF);
    vcard.addAdr(adr);
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCardImpl

    assertTrue(vcardStr.contains("ADR;TYPE=HOME,PARCEL,PREF:25334;;South cresent drive\\, Building 5\\, 3rd flo\r\n or;New York;New York;NYC887;U.S.A.\r\n"));
  }
 
  @Test
  public void testBuildKeyType() throws VCardBuildException {
    VCardImpl vcard = getSimpleVCard();
   
    KeyType keyPlain = new KeyType();
    keyPlain.setKeyTextType(KeyTextType.PGP);
    keyPlain.setKey("plain text key");
    vcard.addKey(keyPlain);
   
    KeyType keyBin = new KeyType();
    keyBin.setKeyTextType(KeyTextType.X509);
    keyBin.setEncodingType(EncodingType.BINARY);
    keyBin.setKey("binary data".getBytes());
    vcard.addKey(keyBin);
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCardImpl

    assertTrue(vcardStr.contains("KEY;ENCODING=B;TYPE=X509:YmluYXJ5IGRhdGE=\r\n"));
  }
 
  private VCardImpl getSimpleVCard()
  {
    VCardImpl vcard = new VCardImpl();
    vcard.setVersion(new VersionType(VCardVersion.V3_0));
    vcard.setN(new NType("Doe", "John"));
    vcard.setFN(new FNType("John \"Johny\" Doe"));
    return vcard;
  }
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCardImpl

    assertEquals(expected, encodedText);
  }
 
  @Test
  public void testForceEncodeQuotedPrintableSpaces_1() throws VCardBuildException {
    VCardImpl vcard = new VCardImpl();
    vcard.setVersion(new VersionType(VCardVersion.V3_0));
    vcard.setN(new NType("Doe", "John"));
    vcard.setFN(new FNType("John Doe"));
   
    NoteType note = new NoteType("This is a note with normal text.");
    note.setEncodingType(EncodingType.QUOTED_PRINTABLE);
    vcard.addNote(note);
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCardImpl

    assertEquals(expectedVCard, resultVCard);
  }
 
  @Test
  public void testForceEncodeQuotedPrintableSpaces_2() throws VCardBuildException {
    VCardImpl vcard = new VCardImpl();
    vcard.setVersion(new VersionType(VCardVersion.V3_0));
    vcard.setN(new NType("Doe", "John"));
    vcard.setFN(new FNType("John Doe"));
   
    NoteType note = new NoteType("This is a note with normal text.");
    note.setEncodingType(EncodingType.QUOTED_PRINTABLE);
    vcard.addNote(note);
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCardImpl

    assertEquals(expectedVCard, resultVCard);
  }
 
  @Test
  public void testForceEncodeQuotedPrintableSpaces_3() throws VCardBuildException {
    VCardImpl vcard = new VCardImpl();
    vcard.setVersion(new VersionType(VCardVersion.V3_0));
    vcard.setN(new NType("Doe", "John"));
    vcard.setFN(new FNType("John Doe"));
   
    NoteType note = new NoteType("新中西里杨阿姨 some spaces ");
    note.setEncodingType(EncodingType.QUOTED_PRINTABLE);
    vcard.addNote(note);
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here

Examples of net.sourceforge.cardme.vcard.VCardImpl

    assertEquals(expectedVCard, resultVCard);
  }
 
  @Test
  public void testForceEncodeQuotedPrintableSpaces_4() throws VCardBuildException {
    VCardImpl vcard = new VCardImpl();
    vcard.setVersion(new VersionType(VCardVersion.V3_0));
    vcard.setN(new NType("Doe", "John"));
    vcard.setFN(new FNType("John Doe"));
   
    NoteType note = new NoteType("新中西里杨阿姨 some spaces ");
    note.setEncodingType(EncodingType.QUOTED_PRINTABLE);
    vcard.addNote(note);
   
    VCardWriter vcardWriter = new VCardWriter();
    vcardWriter.setOutputVersion(VCardVersion.V3_0);
    vcardWriter.setCompatibilityMode(CompatibilityMode.RFC2426);
    vcardWriter.setFoldingScheme(FoldingScheme.MIME_DIR);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.