eclipse中读取json配置文件,相对路径不能以斜杠打头。

2017-04-12 19:48
fileReader = new FileReader("src/json_for_test/netDiagnoseConfigParameter");
		    BufferedReader bufferedReader = new BufferedReader(fileReader);
		    StringBuffer stringBuffer = new StringBuffer();
		    String temp = null;
		    try {
				while((temp = bufferedReader.readLine()) != null){
					stringBuffer.append(temp);
				}
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		    diagnoseConfig = new JSONObject(stringBuffer.toString());