logger.msg(msg, MyLogger.SEV_WARNING);
shutdown = true;
}
// update downloaded byte counter ...
DownloadFile dlFile = handler.dlFileSeg().getDlFile();
String filename = dlFile.getFilename();
int bytes = 0;
Integer bytesInt = downloadedBytes.get(filename);
if(bytesInt != null)
bytes = bytesInt;
bytes += handler.newByteCount();
downloadedBytes.put(filename, bytes);
// ... and progres bar in main window
int last = 0;
Integer lastInt = lastProgBarUpdate.get(filename);
if(lastInt != null)
last = lastInt;
last = updateProgressBar(bytes, last, dlFile);
lastProgBarUpdate.put(filename, last);
// all data downloaded?
if(handler.isFinished())
{
if(handler.getError() == RspHandler.ERR_NONE)
fetch430count = 0;
toRemoveVector.add(handler);
runningThreads--;
decrSegCount(filename); // decrease main window segment counter
// segment done, so check if whole download file is finished now
dlFile.removeSegment(handler.dlFileSeg().getIndex());
if(!dlFile.hasMoreSegments())
{
try
{
handleFinishedDlFile(dlFile);
}