/android/import-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/import-contacts

« back to all changes in this revision

Viewing changes to src/org/waxworlds/importcontacts/VCFImporter.java

  • Committer: edam
  • Date: 2009-01-13 06:35:26 UTC
  • Revision ID: edam@waxworlds.org-20090113063526-l9t1s9git4bav60a
- new contact's phone numebrs and email addresses are added to the caches after those contacts are updated to account for the situation where the same contact is imported again from another file (or the contact exists twice in the same file!?)

Show diffs side-by-side

added added

removed removed

21
21
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
22
 */
23
23
 
24
 
package org.waxworlds.edam.importcontacts;
 
24
package org.waxworlds.importcontacts;
25
25
 
26
26
import java.io.BufferedReader;
27
27
import java.io.File;
38
38
import java.util.regex.Matcher;
39
39
import java.util.regex.Pattern;
40
40
 
 
41
import org.waxworlds.importcontacts.Importer.AbortImportException;
 
42
 
41
43
import android.content.SharedPreferences;
42
44
import android.provider.Contacts;
43
45
import android.provider.Contacts.PhonesColumns;
72
74
 
73
75
                        // get files
74
76
                        class VCardFilter implements FilenameFilter {
75
 
                                public boolean accept( File dir, String name ) {
76
 
                                        return name.toLowerCase().endsWith( ".vcf" );
77
 
                                }
 
77
                            public boolean accept( File dir, String name ) {
 
78
                                return name.toLowerCase().endsWith( ".vcf" );
 
79
                            }
78
80
                        }
79
81
                        files = dir.listFiles( new VCardFilter() );
80
82
                }
244
246
                private Vector< String > _lines = null;
245
247
                private int _nameLevel = NAMELEVEL_NONE;
246
248
 
247
 
                @SuppressWarnings("serial")
248
249
                protected class ParseException extends Exception
249
250
                {
250
 
                        @SuppressWarnings("unused")
251
251
                        public ParseException( String error )
252
252
                        {
253
253
                                super( error );
259
259
                        }
260
260
                }
261
261
 
262
 
                @SuppressWarnings("serial")
263
262
                protected class SkipContactException extends Exception { }
264
263
 
265
264
                public void parseLine( String line )