Package net.fortuna.ical4j.vcard

Examples of net.fortuna.ical4j.vcard.VCardBuilder


    }
    public static void main(String[] args) throws Exception {
     VcardIndexingSource instance = new VcardIndexingSource();
    
     instance.prefix = "http://test.org/";
     VCardBuilder parser = new VCardBuilder(new InputStreamReader(new FileInputStream(new File(args[0])), "utf8"));
     Map<EntityType,Map<String,Set<String>>> entityMap = new EnumMap<EntityType,Map<String,Set<String>>>(EntityType.class);
     entityMap.put(EntityType.organization, new HashMap<String,Set<String>>());
     entityMap.put(EntityType.person,  new HashMap<String,Set<String>>());
     for(VCard vcard : parser.buildAll()){
         instance.processVcard(vcard,OntologyMappings.schemaOrgMappings,entityMap);
     }
    }
View Full Code Here


                r = new InputStreamReader(new FileInputStream(file), DEFAULT_CHARSET);
            } catch (FileNotFoundException e) {
                throw new IllegalStateException("vcard import file "+file+
                    "not found - maybe deleted during import?",e);
            }
            VCardBuilder parser = new VCardBuilder(r);
            try {
                return parser.buildAll().iterator();
            } catch (IOException e) {
                throw new IllegalStateException("Unable to read vcard file "+file,e);
            } catch (ParserException e) {
                throw new IllegalStateException("Unable to parse vcard file "+file,e);
            }
View Full Code Here

    public void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
        Preconditions.checkNotNull(baseURI);

        setBaseURI(baseURI);
        try {
            for(VCard card : new VCardBuilder(in).buildAll()) {
                parseVCard(card);
            }
        } catch (ParserException e) {
            throw new RDFParseException(e);
        }
View Full Code Here

    public void parse(Reader reader, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
        Preconditions.checkNotNull(baseURI);

        setBaseURI(baseURI);
        try {
            for(VCard card : new VCardBuilder(reader).buildAll()) {
                parseVCard(card);
            }
        } catch (ParserException e) {
            throw new RDFParseException(e);
        }
View Full Code Here

        try {
          final File file = upload.writeToTempFile();
          final List<AddressDO> newAddresses = new ArrayList<AddressDO>();

          final FileInputStream fis = new FileInputStream(file);
          final VCardBuilder builder = new VCardBuilder(fis);

          AddressDO newAddress = null;
          for (final VCard card : builder.buildAll()) {
            newAddress = new AddressDO();

            // //// SET BASE DATA
            if (card.getProperty(net.fortuna.ical4j.vcard.Property.Id.N) != null) {
              setName(card.getProperty(net.fortuna.ical4j.vcard.Property.Id.N), newAddress);
View Full Code Here

TOP

Related Classes of net.fortuna.ical4j.vcard.VCardBuilder

Copyright © 2018 www.massapicom. 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.