public synchronized String getNextTmpFile() throws Exception {
		while (isDownloadInProgress) {
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				log.error("hasNext() sleep mysteriously interrupted.");
			}
		}
		if (!hasNext()) {
			return null;
		}
		String fname = getNextTmpFileName();
		if (fname == null) {
			return null;
		}
		File f = new File(fname);
		if (!f.exists() && f.canRead()) {
			String err = "File:" + fname + " cannot be read!";
			log.error(err);
			throw new Exception(err);
		}
		StringBuffer sb = new StringBuffer();
		try {
			BufferedReader in = new BufferedReader(new FileReader(fname));
			String str;
			while ((str = in.readLine()) != null) {
				sb.append(str);
			}
			in.close();
		} catch (IOException e) {
			String err = "File:" + fname
					+ " exists, is readable, but read failed!";
			log.error(err);
			throw new Exception(err);
		}
		String returnString = sb.toString();
		log.debug("File:" + fname + " successfully read. Contanins "
				+ returnString.length() + " characters.");
		deleteFile(fname);
		return returnString;
	}