//使用File获取resources里面资源文件的相对路径 若文件名称为中文可能会报文件不存在 File file = new File(this.getClass().getResource("/province-city.josn").getPath()); //使用inputStream InputStream inputStream = this.getClass().getResourceAsStream("/province-city.json");
//使用File获取resources里面资源文件的相对路径 若文件名称为中文可能会报文件不存在 File file = new File(this.getClass().getResource("/province-city.josn").getPath()); //使用inputStream InputStream inputStream = this.getClass().getResourceAsStream("/province-city.json");
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。