1
0
mirror of https://github.com/moparisthebest/davmail synced 2024-12-14 11:42:23 -05:00

Carddav: fix regression in VCardWriter

git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1220 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
mguessan 2010-07-20 10:41:38 +00:00
parent d5f2f73691
commit bb1b0047b4

View File

@ -27,6 +27,17 @@ public class VCardWriter extends ICSBufferedWriter {
writeLine("VERSION:3.0"); 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) { public void appendProperty(String propertyName, String... propertyValue) {
boolean hasValue = false; boolean hasValue = false;
for (String value : propertyValue) { for (String value : propertyValue) {
@ -60,7 +71,7 @@ public class VCardWriter extends ICSBufferedWriter {
*/ */
private void appendEncodedValue(StringBuilder buffer, String value) { private void appendEncodedValue(StringBuilder buffer, String value) {
if (value != null) { if (value != null) {
for (int i = 0; i < value.length();i++) { for (int i = 0; i < value.length(); i++) {
char c = value.charAt(i); char c = value.charAt(i);
if (c == ',' || c == ';') { if (c == ',' || c == ';') {
buffer.append('\\'); buffer.append('\\');