mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-1508: Ensure extension JarFile is always properly closed.
This commit is contained in:
@@ -216,14 +216,7 @@ public class ExtensionClassLoader extends URLClassLoader {
|
||||
private static URL[] getExtensionURLs(File extension,
|
||||
List<File> temporaryFiles) throws GuacamoleException {
|
||||
|
||||
JarFile extensionJar;
|
||||
try {
|
||||
extensionJar = new JarFile(extension);
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new GuacamoleServerException("Contents of extension \""
|
||||
+ extension + "\" cannot be read.", e);
|
||||
}
|
||||
try (JarFile extensionJar = new JarFile(extension)) {
|
||||
|
||||
// Include extension itself within classpath
|
||||
List<URL> urls = new ArrayList<>();
|
||||
@@ -296,6 +289,12 @@ public class ExtensionClassLoader extends URLClassLoader {
|
||||
|
||||
return urls.toArray(new URL[0]);
|
||||
|
||||
}
|
||||
catch (IOException e) {
|
||||
throw new GuacamoleServerException("Contents of extension \""
|
||||
+ extension + "\" cannot be read.", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user