From bb1b0047b4020ae39a831f9f792f11400b829286 Mon Sep 17 00:00:00 2001 From: mguessan Date: Tue, 20 Jul 2010 10:41:38 +0000 Subject: [PATCH] Carddav: fix regression in VCardWriter git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1220 3d1905a2-6b24-0410-a738-b14d5a86fcbd --- src/java/davmail/exchange/VCardWriter.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/java/davmail/exchange/VCardWriter.java b/src/java/davmail/exchange/VCardWriter.java index 9690e098..1849264e 100644 --- a/src/java/davmail/exchange/VCardWriter.java +++ b/src/java/davmail/exchange/VCardWriter.java @@ -27,6 +27,17 @@ public class VCardWriter extends ICSBufferedWriter { writeLine("VERSION:3.0"); } + public void appendProperty(String propertyName, String propertyValue) { + if ((propertyValue != null) && (propertyValue.length() > 0)) { + write(propertyName); + write(":"); + StringBuilder valueBuffer = new StringBuilder(); + appendEncodedValue(valueBuffer, propertyValue); + writeLine(valueBuffer.toString()); + } + + } + public void appendProperty(String propertyName, String... propertyValue) { boolean hasValue = false; for (String value : propertyValue) { @@ -60,7 +71,7 @@ public class VCardWriter extends ICSBufferedWriter { */ private void appendEncodedValue(StringBuilder buffer, String value) { if (value != null) { - for (int i = 0; i < value.length();i++) { + for (int i = 0; i < value.length(); i++) { char c = value.charAt(i); if (c == ',' || c == ';') { buffer.append('\\');