-
- static private Card getCard(String input) throws IOException {
- boolean remote = false;
- Format format = Format.Abook;
- String ext = input;
- if (ext.contains(".")) {
- String tab[] = ext.split("\\.");
- if (tab.length > 1 && tab[tab.length - 1].equalsIgnoreCase("vcf")) {
- format = Format.VCard21;
- }
- }
-
- if (input.contains("://")) {
- format = Format.VCard21;
- remote = true;
- }
-
- Card card = null;
- try {
- if (remote) {
- Sync sync = new Sync(input);
- card = new Card(sync.getCache(), format);
- card.setRemote(true);
- sync.sync(card, false);
- } else {
- card = new Card(new File(input), format);
- }
- } catch (IOException ioe) {
- ioe.printStackTrace();
- throw ioe;
- }
-
- return card;
- }