48 |
br = new BufferedReader(isr); |
br = new BufferedReader(isr); |
49 |
|
|
50 |
String line = br.readLine(); |
String line = br.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 != 9) { |
58 |
if (numFields != 9) { |
throw new IOException("Not enough fields in CSV file. Found " + parts.length + ", expected 9"); |
|
throw new IOException("Not enough fields in CSV file. Found " + numFields + ", expected 9"); |
|
59 |
} |
} |
60 |
|
|
61 |
|
|