From f0eb26533a7fbd1f0e9a4dbe0e809f9ac678f14b Mon Sep 17 00:00:00 2001 From: Ludovic Orban Date: Tue, 9 Nov 2021 09:18:09 +0100 Subject: [PATCH] Issue #6728 - QUIC and HTTP/3 - foreign: delete native lib copy on exit --- .../jetty/quic/quiche/foreign/incubator/NativeHelper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jetty-quic/quic-quiche/quic-quiche-foreign-incubator/src/main/java/org/eclipse/jetty/quic/quiche/foreign/incubator/NativeHelper.java b/jetty-quic/quic-quiche/quic-quiche-foreign-incubator/src/main/java/org/eclipse/jetty/quic/quiche/foreign/incubator/NativeHelper.java index 608ce3f2763..c17cef1a992 100644 --- a/jetty-quic/quic-quiche/quic-quiche-foreign-incubator/src/main/java/org/eclipse/jetty/quic/quiche/foreign/incubator/NativeHelper.java +++ b/jetty-quic/quic-quiche/quic-quiche-foreign-incubator/src/main/java/org/eclipse/jetty/quic/quiche/foreign/incubator/NativeHelper.java @@ -43,7 +43,7 @@ class NativeHelper String libName = getNativePrefix() + "/" + System.mapLibraryName("quiche"); File lib = extractFromResourcePath(libName, NativeHelper.class.getClassLoader()); System.load(lib.getAbsolutePath()); - //TODO delete lib? + lib.deleteOnExit(); } catch (IOException e) { @@ -89,7 +89,7 @@ class NativeHelper private static File extractFromResourcePath(String libName, ClassLoader classLoader) throws IOException { File target = new File(System.getProperty("java.io.tmpdir"), libName); - target.getParentFile().mkdir(); + target.getParentFile().mkdirs(); try (InputStream is = classLoader.getResourceAsStream(libName); OutputStream os = new FileOutputStream(target)) { IO.copy(is, os);