java 读取 resources 下Json文件

import java.io.InputStream;


public static String Red_json(String url) {
		String rsString = ""; 
		InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(url);  
		Scanner scanner = new Scanner(is);
	    while (scanner.hasNextLine()) {  
	    	rsString+=scanner.nextLine();  
               //System.out.println(scanner.nextLine());
	    }  
	    return rsString;
	}
```
posted @ 2020-06-07 14:22  张什么锋  阅读(1353)  评论(0编辑  收藏  举报