@Override protected VCardDataType _dataType(T property, VCardVersion version) { if (property.getUrl() != null) { switch (version) { case V2_1: return VCardDataType.URL; case V3_0: case V4_0: return VCardDataType.URI; } } if (property.getData() != null) { switch (version) { case V2_1: case V3_0: return null; case V4_0: return VCardDataType.URI; } } return _defaultDataType(version); }
private String write(T property, VCardVersion version) { String url = property.getUrl(); if (url != null) { return url; } byte data[] = property.getData(); if (data != null) { switch (version) { case V2_1: case V3_0: return Base64.encodeBase64String(data); case V4_0: U contentType = property.getContentType(); String mediaType = (contentType == null || contentType.getMediaType() == null) ? "application/octet-stream" : contentType.getMediaType(); return new DataUri(mediaType, data).toString(); } } return ""; }
if (property.getUrl() != null) { copy.setEncoding(null);