class NativeUtil {

    private static final String NATIVE_FOLDER_PATH_PREFIX = "dtp_native_";

    private static File temporaryDir;

    private NativeUtil() {
    }

    public static void loadLibraryFromJar(String filename) throws IOException {<FILL_FUNCTION_BODY>}

    private static File createTempDirectory(String prefix) throws IOException {
        String tempDir = System.getProperty("java.io.tmpdir");
        File generatedDir = new File(tempDir, prefix + System.nanoTime());
        if (!generatedDir.mkdir()) {
            throw new IOException("Failed to create temp directory " + generatedDir.getName());
        }
        return generatedDir;
    }
}


        if (StringUtils.isBlank(filename)) {
            throw new IllegalArgumentException("The filename cannot be null");
        }

        if (temporaryDir == null) {
            temporaryDir = createTempDirectory(NATIVE_FOLDER_PATH_PREFIX);
            temporaryDir.deleteOnExit();
        }

        File temp = new File(temporaryDir, filename);
        try (InputStream is = NativeUtil.class.getClassLoader().getResourceAsStream(filename)) {
            assert is != null;
            Files.copy(is, temp.toPath(), StandardCopyOption.REPLACE_EXISTING);
        } catch (IOException e) {
            Files.delete(temp.toPath());
            throw e;
        } catch (NullPointerException e) {
            Files.delete(temp.toPath());
            throw new FileNotFoundException("File " + filename + " was not found inside JAR.");
        }

        try {
            System.load(temp.getAbsolutePath());
        } finally {
            temp.deleteOnExit();
        }
    
<no_super_class>