Debug.msg("Recieved response, begin processin call list");
Debug.msg("Received response, begin processing call list");
	public boolean retrieveCSVList()			throws WrongPasswordException, IOException {		URL url;		URLConnection urlConn;		DataOutputStream printout;		boolean wrong_pass = false;		boolean newEntries = false;		Debug.msg("Opening HTML Callerlist page");		// retrieveHTMLCallerList(box_address, password, countryPrefix,		// countryCode,		// areaPrefix, areaCode, firmware, jfritz);		// Attempting to fetch the html version of the call list		String postdata = firmware.getAccessMethod()				+ POSTDATA_LIST.replaceAll("\\$LANG", firmware.getLanguage())				+ URLEncoder.encode(box_password, "ISO-8859-1");		String urlstr = "http://" + box_address +":" + box_port + "/cgi-bin/webcm";		Debug.msg("Urlstr: " + urlstr);		Debug.msg("Postdata: " + postdata);		try {			url = new URL(urlstr);		} catch (MalformedURLException e) {			Debug.err("URL invalid: " + urlstr);			throw new WrongPasswordException("URL invalid: " + urlstr);		}		if (url != null) {			urlConn = url.openConnection();			urlConn.setDoInput(true);			urlConn.setDoOutput(true);			urlConn.setUseCaches(false);			// Sending postdata			if (postdata != null) {				urlConn.setRequestProperty("Content-Type",						"application/x-www-form-urlencoded");				printout = new DataOutputStream(urlConn.getOutputStream());				printout.writeBytes(postdata);				printout.flush();				printout.close();			}			try {				// Get response data from the box				BufferedReader reader = new BufferedReader(						new InputStreamReader(urlConn.getInputStream()));				// read out the response data!				while (reader.skip(100000) > 0) {					// kind of stupid, but it has to be					// If you don't read the list, you may not get an					// Updated list from the box				}				// close the streams				reader.close();				urlConn.getInputStream().close();			} catch (IOException e1) {				throw new IOException("Network unavailable");			}		}		// The list should be updated now		// Get the csv file for processing		Debug.msg("Retrieving the CSV list from the box");		urlstr = "http://" + box_address + ":" + box_port + "/cgi-bin/webcm";		try {			url = new URL(urlstr);		} catch (MalformedURLException e) {			Debug.err("URL invalid: " + urlstr);			throw new WrongPasswordException("URL invalid: " + urlstr);		}		// If the url is valid load the data		if (url != null) {			urlConn = url.openConnection();			urlConn.setDoInput(true);			urlConn.setDoOutput(true);			urlConn.setUseCaches(false);			// Sending postdata to the fritz box			urlConn.setRequestProperty("Content-Type",					"application/x-www-form-urlencoded");			printout = new DataOutputStream(urlConn.getOutputStream());			if (firmware.getLanguage().equals("de")) {				printout.writeBytes(POSTDATA_FETCH_CALLERLIST.replaceAll(						"\\$LANG", firmware.getLanguage()).replaceAll(						"\\$CSV_FILE", CSV_FILE_DE));			} else if (firmware.getLanguage().equals("en")) {				printout.writeBytes(POSTDATA_FETCH_CALLERLIST.replaceAll(						"\\$LANG", firmware.getLanguage()).replaceAll(						"\\$CSV_FILE", CSV_FILE_EN));			}			printout.flush();			printout.close();			BufferedReader reader;			try {				// Get response data from the box				reader = new BufferedReader(new InputStreamReader(urlConn						.getInputStream()));				// pass it on to the import function				Debug.msg("Recieved response, begin processin call list");				newEntries = jfritz.getCallerlist().importFromCSVFile(reader);				Debug.msg("Finished processing response");				// close the reader and the cocket connection				reader.close();				urlConn.getInputStream().close();			} catch (IOException e1) {				throw new IOException("Network unavailable");			}			if (wrong_pass)				throw new WrongPasswordException("Password invalid");		}		// return if there were new entries or not		return newEntries;	}