1 |
package dk.daoas.adressevedligehold.fileupload; |
package dk.daoas.adressevedligehold.coveragefileupload; |
2 |
|
|
3 |
import java.io.IOException; |
import java.io.IOException; |
4 |
import java.util.List; |
import java.util.List; |
8 |
import com.google.common.base.CharMatcher; |
import com.google.common.base.CharMatcher; |
9 |
import com.google.common.base.Splitter; |
import com.google.common.base.Splitter; |
10 |
|
|
11 |
import dk.daoas.adressevedligehold.fileupload.AddressSourceEntry.EntryType; |
import dk.daoas.adressevedligehold.coveragefileupload.AddressSourceEntry.EntryType; |
12 |
|
|
13 |
public class AddressSourceNS extends AbstractAddressSource { |
public class AddressSourceNS extends AbstractAddressSource { |
14 |
|
|
15 |
enum NextUgedag { |
enum NextUgedag { |
16 |
MANDAG,TIRSDAG,ONSDAG,TORSDAG,FREDAG,LORDAG,SONDAG |
MANDAG,TIRSDAG,ONSDAG,TORSDAG,FREDAG,LORDAG,SONDAG |
17 |
} |
} |
18 |
|
|
19 |
|
final static char SEPARATOR = ';'; |
20 |
|
|
21 |
|
|
22 |
final Splitter splitter = Splitter.on(',') |
final Splitter splitter = Splitter.on(SEPARATOR) |
23 |
.trimResults( CharMatcher.is('"') ); |
.trimResults( CharMatcher.is('"') ); |
24 |
|
|
25 |
List<String> parts; |
List<String> parts; |
34 |
|
|
35 |
@Override |
@Override |
36 |
public void validate() throws IOException { |
public void validate() throws IOException { |
37 |
super.validatNoHeaderLine(22, ','); |
super.validatNoHeaderLine(22, SEPARATOR); |
38 |
} |
} |
39 |
|
|
|
//TODO: Skal csv parsning klares med Apache Commons CSV ? |
|
40 |
|
|
41 |
@Override |
@Override |
42 |
public AddressSourceEntry getNextEntry() throws IOException { |
public AddressSourceEntry getNextEntry() throws IOException { |
134 |
public String getDistributor() { |
public String getDistributor() { |
135 |
return "NS"; |
return "NS"; |
136 |
} |
} |
137 |
|
|
138 |
|
@Override |
139 |
|
public boolean calculateDistances() { |
140 |
|
return false; //NS skal IKKE beregne afstande |
141 |
|
} |
142 |
|
|
143 |
} |
} |