10 |
|
|
11 |
import dk.daoas.adressevedligehold.AddressSourceEntry.EntryType; |
import dk.daoas.adressevedligehold.AddressSourceEntry.EntryType; |
12 |
import dk.daoas.adressevedligehold.util.DeduplicateHelper; |
import dk.daoas.adressevedligehold.util.DeduplicateHelper; |
|
import dk.daoas.adressevedligehold.util.SafeParsers; |
|
13 |
|
|
14 |
public class AddressSourceNS implements AddressSource { |
public class AddressSourceNS implements AddressSource { |
15 |
|
|
48 |
BufferedReader br1 = new BufferedReader(isr1) |
BufferedReader br1 = new BufferedReader(isr1) |
49 |
) { |
) { |
50 |
String line = br1.readLine(); |
String line = br1.readLine(); |
51 |
|
|
52 |
|
if (line == null) { |
53 |
|
throw new IOException("Can't read 1st line - is file empty?"); |
54 |
|
} |
55 |
|
|
56 |
String[] parts = line.split(","); |
String[] parts = line.split(","); |
57 |
int numFields = parts.length; |
if (parts.length != 22) { |
58 |
if (numFields != 22) { |
throw new IOException("Not enough fields in CSV file. Found " + parts.length + ", expected 22"); |
|
throw new IOException("Not enough fields in CSV file. Found " + numFields + ", expected 22"); |
|
59 |
} |
} |
60 |
} |
} |
61 |
|
|