/[projects]/dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/dawa/DawaWebservice.java
ViewVC logotype

Diff of /dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/dawa/DawaWebservice.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3071 by torben, Mon Apr 25 09:34:22 2016 UTC revision 3072 by torben, Tue Jul 26 06:30:11 2016 UTC
# Line 30  public class DawaWebservice { Line 30  public class DawaWebservice {
30                    
31          DeduplicateHelper<String> dedup = new DeduplicateHelper<>();          DeduplicateHelper<String> dedup = new DeduplicateHelper<>();
32    
33            public Map<String, Integer> kommuner() throws IOException {
34                    
35                    final String url = "http://dawa.aws.dk/kommuner";
36                                    
37                    Map<String,Integer> result = new TreeMap<>();
38                    
39                    String jsonStr = HttpUtil.getContentString(url, 5000);
40                    JSONArray root = new JSONArray( jsonStr) ;
41                    
42                    for (int i=0; i<root.length(); i++) {
43                            JSONObject current = root.getJSONObject(i);
44                                                    
45                            int kode = current.getInt("kode");
46                            String navn = current.getString("navn");
47                            
48                            result.put(navn, kode);
49                    }
50                                    
51                    return result;
52            }
53            
54          public Map<String, Integer> kommunerIRegion(int regionskode) throws IOException {          public Map<String, Integer> kommunerIRegion(int regionskode) throws IOException {
55                                    
56                  final String url = "http://dawa.aws.dk/kommuner";                  final String url = "http://dawa.aws.dk/kommuner";

Legend:
Removed from v.3071  
changed lines
  Added in v.3072

  ViewVC Help
Powered by ViewVC 1.1.20