mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +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,
|
private static URL[] getExtensionURLs(File extension,
|
||||||
List<File> temporaryFiles) throws GuacamoleException {
|
List<File> temporaryFiles) throws GuacamoleException {
|
||||||
|
|
||||||
JarFile extensionJar;
|
try (JarFile extensionJar = new JarFile(extension)) {
|
||||||
try {
|
|
||||||
extensionJar = new JarFile(extension);
|
|
||||||
}
|
|
||||||
catch (IOException e) {
|
|
||||||
throw new GuacamoleServerException("Contents of extension \""
|
|
||||||
+ extension + "\" cannot be read.", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Include extension itself within classpath
|
// Include extension itself within classpath
|
||||||
List<URL> urls = new ArrayList<>();
|
List<URL> urls = new ArrayList<>();
|
||||||
@@ -296,6 +289,12 @@ public class ExtensionClassLoader extends URLClassLoader {
|
|||||||
|
|
||||||
return urls.toArray(new URL[0]);
|
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