Code example for URLConnection

Methods: getContentLength

0
            progressMonitor.setExtraText(readSoFar/1024 + " KB");
        } 
    } 
 
    private void updateSize() { 
        if (!sizeKnown && connection.getContentLength() > 0) {
            sizeKnown = true;
            progressMonitor.subTask(tr("Downloading OSM data..."));
            progressMonitor.setTicksCount(connection.getContentLength());
        } 
    } 
}