代码优化
This commit is contained in:
@@ -456,7 +456,7 @@ class DefaultVFS extends VFS {
|
||||
// Some versions of JBoss VFS might give a JAR stream even if the resource
|
||||
// referenced by the URL isn't actually a JAR
|
||||
is = url.openStream();
|
||||
@SuppressWarnings("resource")
|
||||
// @SuppressWarnings("resource")
|
||||
JarInputStream jarInput = new JarInputStream(is);
|
||||
log.debug("Listing " + url);
|
||||
for (JarEntry entry; (entry = jarInput.getNextJarEntry()) != null;) {
|
||||
@@ -473,7 +473,7 @@ class DefaultVFS extends VFS {
|
||||
* then we assume the current resource is not a directory.
|
||||
*/
|
||||
is = url.openStream();
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
|
||||
try(BufferedReader reader = new BufferedReader(new InputStreamReader(is))){
|
||||
List<String> lines = new ArrayList<String>();
|
||||
for (String line; (line = reader.readLine()) != null;) {
|
||||
log.debug("Reader entry: " + line);
|
||||
@@ -488,6 +488,7 @@ class DefaultVFS extends VFS {
|
||||
log.debug("Listing " + url);
|
||||
children.addAll(lines);
|
||||
}
|
||||
};
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user