146147148149150151152153154155156
final DownloadHandle handle = downloadHandler.getHandle(m_testContentURL); future = handle.start(new DownloadProgressListener() { @Override public void progress(long bytesRead) { handle.stop(); } }); assertDownloadStopped(future);
209210211212213214215216217218219
@Override public void progress(long bytesRead) { if (--m_count == 0) { System.out.printf("Downloaded %d bytes, stopping download...%n", bytesRead); handle2.stop(); } } }); assertDownloadStopped(future);