BrightSide Workbench Full Report + Source Code
org.turro.vcard.util.ExportToVCard Class Reference

Public Member Functions

 ExportToVCard (List< Contact > contacts)
 
 ExportToVCard (Contact contact)
 
File export () throws IOException
 
String getEncodedString () throws IOException
 
String getAndroidString () throws IOException
 
BufferedImage getQRCode ()
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 44 of file ExportToVCard.java.

Constructor & Destructor Documentation

◆ ExportToVCard() [1/2]

org.turro.vcard.util.ExportToVCard.ExportToVCard ( List< Contact contacts)

Definition at line 49 of file ExportToVCard.java.

49  {
50  this.contacts = contacts;
51  }

◆ ExportToVCard() [2/2]

org.turro.vcard.util.ExportToVCard.ExportToVCard ( Contact  contact)

Definition at line 53 of file ExportToVCard.java.

53  {
54  contacts = new ArrayList<Contact>();
55  contacts.add(contact);
56  }

Member Function Documentation

◆ export()

File org.turro.vcard.util.ExportToVCard.export ( ) throws IOException

Definition at line 58 of file ExportToVCard.java.

58  {
59  Properties properties = new Properties();
60  properties.load(FileUtil.getBufferedFile(
61  new File(ElephantContext.getRealPath("/WEB-INF/elephant/conf/vCard.properties"))));
62  VCardList list = new VCardList();
63  for(Contact c : contacts) {
64  VCard vCard = new ContactToVCard(c).getVCard(properties);
65  if(vCard == null) continue;
66  list.add(vCard);
67  }
68  return VCardFiles.saveVCards(list);
69  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAndroidString()

String org.turro.vcard.util.ExportToVCard.getAndroidString ( ) throws IOException

Definition at line 84 of file ExportToVCard.java.

84  {
85  Properties properties = new Properties();
86  properties.load(FileUtil.getBufferedFile(
87  new File(ElephantContext.getRealPath("/WEB-INF/elephant/conf/vCard.properties"))));
88  String result = "";
89  for(Contact c : contacts) {
90  try {
91  result += new ContactToVCard(c).generateAndroidVCard(properties);
92  } catch (VCardException ex) {
93  Logger.getLogger(ExportToVCard.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
94  }
95  }
96  return result;
97  }
ExportToVCard(List< Contact > contacts)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEncodedString()

String org.turro.vcard.util.ExportToVCard.getEncodedString ( ) throws IOException

Definition at line 71 of file ExportToVCard.java.

71  {
72  Properties properties = new Properties();
73  properties.load(FileUtil.getBufferedFile(
74  new File(ElephantContext.getRealPath("/WEB-INF/elephant/conf/vCard.properties"))));
75  String result = "";
76  for(Contact c : contacts) {
77  VCard vCard = new ContactToVCard(c).getVCard(properties);
78  if(vCard == null) continue;
79  result += vCard.getVCard();
80  }
81  return URLEncoder.encode(result, "UTF-8");
82  }
Here is the call graph for this function:

◆ getQRCode()

BufferedImage org.turro.vcard.util.ExportToVCard.getQRCode ( )

Definition at line 99 of file ExportToVCard.java.

99  {
100  try {
101  Barcode qr = new Barcode();
102  return qr.encodeQrCode(getAndroidString(), 300);
103  } catch (IOException ex) {
104  Logger.getLogger(ExportToVCard.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
105  return null;
106  }
107  }
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: