public static String getFile(String httpUrlString, Properties httpRequestProperties,
			boolean allowRedirect, File destFile) throws MalformedURLException, IOException {

		HttpURLConnection connection = null;
		InputStream content = null;
		try {

			connection = getContent(httpUrlString, httpRequestProperties, allowRedirect);
			content = connection.getInputStream();

			BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(destFile));
			byte[] dataBuffer = new byte[8 * 1024];
			try {
				int len;
				while ((len = content.read(dataBuffer)) >= 0) {
					out.write(dataBuffer, 0, len);
				}
			}
			finally {
				out.close();
			}
		}
		finally {
			if (content != null) {
				content.close();
			}
		}

		return connection.getContentType();
	}
Download a file by executing an HTTP/HTTPS GET request.
@param httpUrlString HTTP/HTTPS URL
@param httpRequestProperties optional HTTP request header values to be included (may be null)
@param allowRedirect allow site redirects to be handled if true
@param destFile destination file
@throws MalformedURLException bad httpUrlString specified
@throws IOException if an error occurs while executing request
@return String representing the content-type of the file, or null if the information is not available
Ghidra/Framework/Generic/src/main/java/ghidra/net/http/HttpUtil.java