Changeset 30738 in osm for applications/editors/josm/plugins/czechaddress
- Timestamp:
- 2014-10-19T01:27:04+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/parser/DatabaseParser.java
r23190 r30738 1 1 package org.openstreetmap.josm.plugins.czechaddress.parser; 2 2 3 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.*;4 3 import java.io.BufferedOutputStream; 5 4 import java.io.File; … … 9 8 import java.net.HttpURLConnection; 10 9 import java.net.URL; 10 11 11 import org.openstreetmap.josm.Main; 12 12 import org.openstreetmap.josm.plugins.czechaddress.DatabaseLoadException; 13 import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.Database; 13 14 14 15 /** … … 109 110 "Požadavek na server selhal, číslo chyby: " + String.valueOf( con.getResponseCode() )); 110 111 111 BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(getDatabasePath()));112 113 int total = 0, count;114 byte[] buffer = new byte[1024*512]; 115 while ((count = con.getInputStream().read(buffer)) >= 0) { 116 bos.write(buffer, 0, count);117 total += count;118 System.err.println("CzechAddress: MVČR database: " + String.valueOf(total/1024) + " kb downloaded."); 112 try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(getDatabasePath()))) { 113 int total = 0, count; 114 byte[] buffer = new byte[1024*512]; 115 while ((count = con.getInputStream().read(buffer)) >= 0) { 116 bos.write(buffer, 0, count); 117 total += count; 118 Main.error("CzechAddress: MVČR database: " + String.valueOf(total/1024) + " kb downloaded."); 119 } 119 120 } 120 121 bos.close();122 121 123 122 // Look for a detailed error message from the server
Note:
See TracChangeset
for help on using the changeset viewer.