获取资源 @param sqlPath SQL路径 @param charset 编码 @return @throws IOException
(String sqlPath,String charset)
| 91 | * @throws IOException |
| 92 | */ |
| 93 | private static Reader getResourceAsReader(String sqlPath,String charset) throws IOException { |
| 94 | Charset c = null; |
| 95 | if(charset != null && !charset.isEmpty()){ |
| 96 | c = Charset.forName(charset); |
| 97 | } |
| 98 | |
| 99 | Reader reader; |
| 100 | if(c == null) { |
| 101 | reader = new InputStreamReader(new FileInputStream(sqlPath)); |
| 102 | }else { |
| 103 | reader = new InputStreamReader(new FileInputStream(sqlPath), c); |
| 104 | } |
| 105 | |
| 106 | return reader; |
| 107 | } |
| 108 | |
| 109 | |
| 110 | /** |