private void handleDownloadFinished(DownloadFinished df) throws Exception {
		
		String fileUID = df.getFileUID();
		DFSException error = df.getError();

		if(error != null) {

			agentPrintMessage("Download failed for file "+fileUID);
			agentPrintMessage(error);

			LinkedList<GetFile> list = currentDownloads.remove(fileUID);
			if(list != null) {

				Iterator<GetFile> it = list.iterator();
				while(it.hasNext()) {
					GetFile fg = it.next();
					fg.cbH.getFileCB(error, fileUID, null);
				}

			}
			
			TreeSet<DAId> daSourceIds = filesToReplicate.remove(fileUID);
			if(daSourceIds != null) {

				Iterator<DAId> it = daSourceIds.iterator();
				while(it.hasNext()) {

					DAId daSourceId = it.next();
					com.sendDatagramMessage(new FileReplicated(daSourceId, fileUID));

				}

			}

		} else {
			
			agentPrintMessage("Download successfull for file "+fileUID);

			DAId thisDa = da.getDaId();
			File f = df.getFile();

			try {
				localFiles.addFile(fileUID, f, FileMode.rw);
			} catch (FileDBException e) {
				agentPrintMessage("File already localy available: "+fileUID);
				f.delete();
			}

			FileLocationUpdateValue loc = new FileLocationUpdateValue(fileUID);
			loc.addLocationToAdd(thisDa);

//			da.submitRequest(new UpdateLocalRequest(getFileKey(fileUID), loc), this);
			agentPrintMessage("Updating locations of file "+fileUID);
			String key = getFileKey(fileUID);
			FileLocation fLoc = new FileLocation(fileUID);
			fLoc.addRemoteFileLocation(thisDa);
			SharedMapEntry entry = new SharedMapEntry(key, fLoc);
			da.getOverlayInterface().getMapInterface().updateAsync(
					getFileKey(fileUID), loc, entry, this);

			LinkedList<GetFile> waitingRest = currentDownloads.remove(fileUID);
			if(waitingRest != null) {
				Iterator<GetFile> it = waitingRest.iterator();
				while(it.hasNext()) {
					GetFile gf = it.next();
					gf.cbH.getFileCB(null, fileUID, f);
				}
			}

		}

	}