public static String testUrl(URL url, boolean withAuthentication)
	{
		try
		{
			HttpURLConnection HTTPConnection = (HttpURLConnection)url.openConnection();
			if (HTTPConnection == null)
				return "HttpURLConnection.openConnection() returned null";

			HTTPConnection.connect();

			int responseCode = HTTPConnection.getResponseCode();
			if (responseCode < 200 || responseCode > 299)
			{
				if (!(withAuthentication && responseCode == 401))
					return "HTTP response code: " + responseCode;
			}
		}
		catch(IOException ioe)
		{
			return "" + ioe;
		}

		return null;
	}