Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8447811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:16:16+00:00 2026-06-10T10:16:16+00:00

Please have a look at the following code package vcardtest; import java.io.*; import java.util.Iterator;

  • 0

Please have a look at the following code

package vcardtest;

import java.io.*;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.sourceforge.cardme.engine.VCardEngine;
import net.sourceforge.cardme.vcard.VCard;
import net.sourceforge.cardme.vcard.features.*;
import net.sourceforge.cardme.vcard.types.parameters.TelephoneParameterType;
import net.sourceforge.cardme.vcard.types.parameters.XTelephoneParameterType;

public class VCardTest 
{

    public static void main(String[] args) 
    {
        File vcardFile = new File("C:/Users/yohan/Contacts/Akon Kon.vcf");
        VCardEngine vcardEngine = new VCardEngine();
        try 
        {
            VCard vcard = vcardEngine.parse(vcardFile);
            String name = vcard.getName().getGivenName();

            if(vcard.hasEmails())
            {
                 EmailFeature email = vcard.getEmails().next();
                String sEmail = email.getEmail();
                   System.out.println(sEmail);
            }


            if(vcard.hasNicknames())
            {
            NicknameFeature nickName = vcard.getNicknames();
            Iterator<String> nicknames = nickName.getNicknames();
            String sNickName = nicknames.next();  
             System.out.println(sNickName);
            }


           // if(vcard.hasAddresses())
            //{
            //Iterator<AddressFeature> addresses = vcard.getAddresses();
            //AddressFeature address = addresses.next();
            //String streetAddress = address.getStreetAddress();
            //System.out.println(streetAddress);
            //}
            String telephone = "";


            //Getting the phone numbers

            Iterator<TelephoneFeature> itNumbers = vcard.getTelephoneNumbers();

            while (itNumbers.hasNext()) 
            {

                TelephoneFeature next1 = itNumbers.next();
                telephone = next1.getTelephone();

           //     System.out.println(telephone);
                System.out.println("types = " + next1.getExtendedTelephoneParameterSize());

                Iterator<XTelephoneParameterType> itTypes = next1.getExtendedTelephoneParameterTypes();

                Iterator<TelephoneParameterType> itNTypes = next1.getTelephoneParameterTypes();

                while (itNTypes .hasNext()) 
                {

                        TelephoneParameterType next = itNTypes .next();
                        System.out.println(" - " + next.getType() + " / " + next.getDescription());

                        if(next.getType().equals("CELL"))
                        {
                            System.out.println("Cell Phone Number: " + next1.getTelephone());
                        }
                        else if(next.getType().equals("HOME"))
                        {
                            System.out.println("Home Number is: " + next1.getTelephone());
                        }

                }

            }



            System.out.println("---------------------------------------------------------------------");
            System.out.println( name );


            //System.out.println(streetAddress);



        } catch (IOException ex) 
        {
           ex.printStackTrace();
        }
    }
}

If I pass a VCard with an address, this generates the following error

run: Exception in thread “main” java.lang.NoClassDefFoundError:
org/apache/commons/codec/net/QuotedPrintableCodec at
net.sourceforge.cardme.engine.VCardEngine.parseLabelType(VCardEngine.java:1432)
at
net.sourceforge.cardme.engine.VCardEngine.parseLine(VCardEngine.java:523)
at
net.sourceforge.cardme.engine.VCardEngine.parseVCard(VCardEngine.java:348)
at
net.sourceforge.cardme.engine.VCardEngine.parse(VCardEngine.java:254)
at vcardtest.VCardTest.main(VCardTest.java:22) Caused by:
java.lang.ClassNotFoundException:
org.apache.commons.codec.net.QuotedPrintableCodec at
java.net.URLClassLoader$1.run(URLClassLoader.java:366) at
java.net.URLClassLoader$1.run(URLClassLoader.java:355) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:354) at
java.lang.ClassLoader.loadClass(ClassLoader.java:423) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at
java.lang.ClassLoader.loadClass(ClassLoader.java:356) … 5 more Java
Result: 1 BUILD SUCCESSFUL (total time: 2 seconds)

Following the test VCard I used, which is generated by my phone, send to laptop and got converted to .contact, and manually converted back to .vcf using options in the contacts folder of windows.

BEGIN:VCARD
VERSION:2.1
N:Kon;Akon
FN:Akon Kon
TEL;CELL;VOICE:0711111111
ADR;HOME:;;195;Colj;Sri lanka
LABEL;HOME;ENCODING=QUOTED-PRINTABLE:195=0D=0AColj, Sri lanka
EMAIL;PREF;INTERNET:akok@a.com
REV:20120828T061900Z
END:VCARD

Please help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:16:17+00:00Added an answer on June 10, 2026 at 10:16 am

    You appear to missing the Apache Commons Codec library

    You’ll need to download it & its dependencies & add them to your class path

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please have a look at the following code package Euler; import java.util.ArrayList; import java.util.List;
Please have a look at the following code package normal; import java.io.*; import java.util.*;
please have a look at the following code import java.util.ArrayList; import java.util.List; public class
Please have a look at following code : import java.util.ArrayList; import java.util.List; class Main{
Please have a look at the following code. package normal; import java.awt.*; import java.awt.event.*;
Please have a look at the following code import java.awt.Color; import java.awt.Dimension; import java.awt.FlowLayout;
Please have a look at the following code. import java.awt.FlowLayout; import java.awt.GridLayout; import javax.swing.*;
Please have a look at the following code import java.awt.Color; import java.awt.Dimension; import java.awt.EventQueue;
Please have a look at the following code import java.awt.event.*; import javax.swing.*; import java.awt.*;
Please have a look at the following code import java.awt.*; import java.awt.event.*; import javax.swing.*;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.