Index: applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/parser/DatabaseParser.java
===================================================================
--- applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/parser/DatabaseParser.java	(revision 30737)
+++ applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/parser/DatabaseParser.java	(revision 30738)
@@ -1,5 +1,4 @@
 package org.openstreetmap.josm.plugins.czechaddress.parser;
 
-import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.*;
 import java.io.BufferedOutputStream;
 import java.io.File;
@@ -9,6 +8,8 @@
 import java.net.HttpURLConnection;
 import java.net.URL;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.plugins.czechaddress.DatabaseLoadException;
+import org.openstreetmap.josm.plugins.czechaddress.addressdatabase.Database;
 
 /**
@@ -109,15 +110,13 @@
                         "Požadavek na server selhal, číslo chyby: " + String.valueOf( con.getResponseCode() ));
 
-            BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(getDatabasePath()));
-
-            int total = 0, count;
-            byte[] buffer = new byte[1024*512];
-            while ((count = con.getInputStream().read(buffer)) >= 0) {
-                bos.write(buffer, 0, count);
-                total += count;
-                System.err.println("CzechAddress: MVČR database: " + String.valueOf(total/1024) + " kb downloaded.");
+            try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(getDatabasePath()))) {
+	            int total = 0, count;
+	            byte[] buffer = new byte[1024*512];
+	            while ((count = con.getInputStream().read(buffer)) >= 0) {
+	                bos.write(buffer, 0, count);
+	                total += count;
+	                Main.error("CzechAddress: MVČR database: " + String.valueOf(total/1024) + " kb downloaded.");
+	            }
             }
-
-            bos.close();
 
             // Look for a detailed error message from the server
