public static void extractNativeLibrary(Platform platform, String name, File targetDir) throws IOException {
        NativeLibrary library = nativeLibraryMap.get(new NativeLibrary.Key(name, platform));
        if (library == null) {
            return;
        }

        String pathInJar = library.getPathInNativesJar();
        if (pathInJar == null) {
            return;
        }
        
        URL url = Resources.getResource(pathInJar);
        if (url == null) {
            return;
        }

        String loadedAsFileName;
        if (library.getExtractedAsName() != null) {
            loadedAsFileName = library.getExtractedAsName();
        } else {
            loadedAsFileName = Paths.get(pathInJar).getFileName().toString();
        }
        
        URLConnection conn = url.openConnection();

        File targetFile = new File(targetDir, loadedAsFileName);

        try (InputStream in = conn.getInputStream()) {
            Files.copy(in, targetFile.toPath(), StandardCopyOption.REPLACE_EXISTING);
            targetFile.setLastModified(conn.getLastModified());
        }
    }
Removes platform-specific portions of a library file name so
that it can be accepted by {@link System#loadLibrary(java.lang.String) }.
<p>
E.g.<br>
<ul>
<li>jinput-dx8_64.dll => jinput-dx8_64</li>
<li>liblwjgl64.so => lwjgl64</li>
<li>libopenal.so => openal</li>
</ul>

@param filename The filename to strip platform-specific parts
@return The stripped library name
jme3-desktop/src/main/java/com/jme3/system/NativeLibraryLoader.java