public  void ReloadEnvironmentVariables(Path file) throws Exception{
		//读取指定的配置文件并保存到Map中
		InputStream in = Files.newInputStream(file);
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		String line = null;
		List<String> keys = new ArrayList<String>();
		List<String> values = new ArrayList<String>();
		while((line = reader.readLine())!=null){
			String[] s = line.split("=");
            //保存变量
			keys.add(s[0]);
			values.add(s[1]);
		}
		
		WebDriver driver = OldFirefoxInit.init();
		driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
		String jenkinsUrl =  ReadPros.getJenkins().getProperty("url");
		driver.get(jenkinsUrl);
		
		login(driver);
		
		driver.get(driver.getCurrentUrl()+"configure"); //跳转到jenkins系统配置页面
		String url = ReadPros.getJenkins().getProperty("url");
		String configUrl = url.substring(0,url.lastIndexOf("/")+1)+"configure";
		Thread.sleep(1000);
		
		//1.清除jenkins系统变量
		//环境变量选择框是否被选中
		String clickEnvCheckBoxScript = "var checkbox = document.getElementsByName('hudson-slaves-EnvironmentVariablesNodeProperty')[0];"
				+ "var checkValue =  checkbox.getAttribute('checked');"
				+ "if (checkValue){"
				+ "	  return checkbox ;"
				+ "}else{"
				+ "  return null;"
				+ "}";
		WebElement checkEle = (WebElement)((JavascriptExecutor)driver).executeScript(clickEnvCheckBoxScript);
		if(null != checkEle){  //checkbox是被选中的
			//取消勾选框,并保存(此时环境变量已都被移除)
			checkEle.click();
			String saveButtonScript = "var buttonNodeList = document.getElementsByTagName('button');"
					+ "var saveNode ;"
					+ "for(var i=0;i<buttonNodeList.length;i++){"
					+ "	   var name = buttonNodeList[i].textContent;"
					+ "   if( name == 'Save'){"  
					+ "       saveNode=buttonNodeList[i];"
					+ "    }"
					+ "}"
					+ "return saveNode";
			WebElement saveEle  = (WebElement)((JavascriptExecutor)driver).executeScript(saveButtonScript);
			saveEle.click(); // 点击保存按钮
		}
		Thread.sleep(3000);
		
		//2.重新加载系统变量
		driver.get(configUrl);
		Thread.sleep(2000);
		WebElement checkEle02 = driver.findElement(By.xpath("//input[@name='hudson-slaves-EnvironmentVariablesNodeProperty']")); 
		String che = checkEle02.getAttribute("checked");
		if(null==che || !che.equals("true")){
			checkEle02.click();
	}
		
		addEnvironmentVariables(driver, keys.size(), keys, values);
		
	}