public boolean downloadUrl (String filename, String urlString) {
            BufferedInputStream in = null;
            FileOutputStream fout = null;
            try {
                URL url_ = new URL(urlString);
                in = new BufferedInputStream(url_.openStream());
                fout = new FileOutputStream(filename);
                byte data[] = new byte[1024];
                int count, amount = 0, steps = 0, mapSize = url_.openConnection().getContentLength();
                SwingUtilities.invokeLater(new Runnable() {
                    public void run () {
                        progressBar.setMaximum(10000);
                    }
                });
                while ((count = in.read(data, 0, 1024)) != -1) {
                    fout.write(data, 0, count);
                    downloadedPerc += (count * 1.0 / mapSize) * 100;
                    amount += count;
                    steps++;
                    if (steps > 100) {
                        steps = 0;
                        final String txt = (amount / 1024) + "Kb / " + (mapSize / 1024) + "Kb";
                        final int perc = (int) downloadedPerc * 100;
                        SwingUtilities.invokeLater(new Runnable() {
                            public void run () {
                                progressBar.setValue(perc);
                                label.setText(txt);
                            }
                        });
                    }
                }
            } catch (MalformedURLException e) {
                Logger.logError("Texture Download Error", e);
                return false;
            } catch (IOException e) {
                Logger.logError("Texture Download Error", e);
                return false;
            } finally {
                try {
                    in.close();
                    fout.flush();
                    fout.close();
                } catch (IOException e) {
                    Logger.logWarn("Error while downloading texture pack", e);
                }
            }
            return true;
        }