Just sharing my experience here.
The below source code has helped me on windows machine to skip the download issue like "This file may harm your computer prompt".
HashMap<String, Object> prefs = new HashMap<String, Object>();
//to disable browser notification pop up
prefs.put("profile.default_content_setting_values.notifications", 2);
//to disable the chrome browser prompt download file xml is harm to keep it
prefs.put("download.prompt_for_download", false);
prefs.put("download.extensions_to_open", "application/xml");
prefs.put("safebrowsing.enabled", true);
//to Turns off multiple download warning
prefs.put("profile.default_content_settings.popups", 0);
prefs.put("profile.content_settings.exceptions.automatic_downloads.*.setting", 1 );
//to set the default download file path
String downloadFilepath = System.getProperty("user.dir") + "\\src\\test\\resources\\downloads";
prefs.put("download.default_directory", downloadFilepath);
options.setExperimentalOption("prefs", prefs);
options.addArguments("start-maximized");
options.addArguments("--safebrowsing-disable-download-protection");
options.addArguments("safebrowsing-disable-extension-blacklist");
WebDriver driver = new ChromeDriver(options);