close stream for IO.resourceExist
This commit is contained in:
@ -909,8 +909,13 @@ public class IO implements OS.FileSystem {
|
||||
* @param path jar 内文件路径,不需要 / 开始,如 config/TimiJava.ini
|
||||
* @return 数据流
|
||||
*/
|
||||
public static boolean resourceExist(Class<?> clazz, String path) {
|
||||
return resourceToInputStream(clazz, path) != null;
|
||||
public static boolean resourceExist(Class<?> clazz, String path) throws IOException {
|
||||
InputStream stream = resourceToInputStream(clazz, path);
|
||||
if (stream != null) {
|
||||
stream.close();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user