Well, I took my Apple AddressBook and exported
all of its contents to
vCard format and ran them through your main method.
Here are the
things I noticed:
0) I first tried selecting all the cards and exporting
them to a
directory, thinking this would export each entry to a
separate vCard.
This wasn't the case -- they all got exported to a
single file. Trying
to run this file through your main method results in no
apparent result
-- the program outputs nothing, but also doesn't appear
to ever
complete (I have to Ctrl-C out of it). Is this sort of
vCard bundle
supported by your classes? Or is this the expected
sort of behaviour?
1) Running my own card through the test program worked
just fine, with
the notable exception of the formatting of the BASE64
data (my vCard
has a photo in it). Each interleaving line is either
one longer or one
shorter then the line two previous to it. This appears
just to be an
output issue, so I'll probably take a moment to fix
this up myself.
When we import the record in the first place we aren't
stripping out the end-of-line character(s), so they're
still part of
the data when we output it. The existing breaks in the
data are based
off 75 character offsets from the beginning of the
data, however when
the vProperty class does the breaks, it's based off a
75-character
offset from the beginning of the header. Thus we're
adding our breaks
in a different place, creating the effect I saw.
2) One card for a French Canadian buddy of mine results
in the
following exception:
Invalid line outside of vObject in vObjectSet
java.text.ParseException: Invalid line outside of
vObject in vObjectSet
at
org.jSyncManager.API.Conduit.Tools.vTypes.vCommon.vObjectSet.parse(vObje
ctSet.java:74)
at
org.jSyncManager.API.Conduit.Tools.vTypes.vCommon.vObjectSet.<init>(vObj
ectSet.java:50)
at
org.jSyncManager.API.Conduit.Tools.vTypes.vCard.main(vCard.java:211)
His last name contains two accented E's, but
I'm not sure that this is
the complete problem. Doing a hex dump of his vCard,
it appears that
it starts with 0xFE 0xFF (looking at it now, it appears
that my
all-in-one dump from [0] above also starts with these
two characters).
Otherwise, everything seems to parse correctly.
It could be a bug in
Apple's vCard export that causes my two "special"
records to start with
0xFE 0xFF -- I really don't know. But otherwise,
everything seems to
be working just fine (the vast majority of cards
displayed without
issue).