mirror of
https://github.com/sismics/docs.git
synced 2024-11-22 22:07:56 +01:00
Fix leak
This commit is contained in:
parent
6e3d2ea972
commit
ac3580fb4a
@ -54,9 +54,10 @@ public class ResourceUtil {
|
|||||||
// Extract the JAR path
|
// Extract the JAR path
|
||||||
String jarPath = dirUrl.getPath().substring(5, dirUrl.getPath().indexOf("!"));
|
String jarPath = dirUrl.getPath().substring(5, dirUrl.getPath().indexOf("!"));
|
||||||
JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"));
|
JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"));
|
||||||
|
|
||||||
Enumeration<JarEntry> entries = jar.entries();
|
|
||||||
Set<String> fileSet = new HashSet<String>();
|
Set<String> fileSet = new HashSet<String>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
Enumeration<JarEntry> entries = jar.entries();
|
||||||
while (entries.hasMoreElements()) {
|
while (entries.hasMoreElements()) {
|
||||||
// Filter according to the path
|
// Filter according to the path
|
||||||
String entryName = entries.nextElement().getName();
|
String entryName = entries.nextElement().getName();
|
||||||
@ -76,6 +77,10 @@ public class ResourceUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
jar.close();
|
||||||
|
}
|
||||||
|
|
||||||
return Lists.newArrayList(fileSet);
|
return Lists.newArrayList(fileSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user