Logo Search packages:      
Sourcecode: icedtea-web version File versions  Download package

void net::sourceforge::jnlp::runtime::JNLPClassLoader::activateNative ( JARDesc  jar  )  [inline, protected]

Search for and enable any native code contained in a JAR by copying the native files into the filesystem. Called in the security context of the classloader.

Definition at line 772 of file JNLPClassLoader.java.

References net::sourceforge::jnlp::cache::ResourceTracker::getCacheFile(), net::sourceforge::jnlp::JARDesc::getLocation(), getNativeDir(), nativeDir, and tracker.

Referenced by activateJars().

        if (JNLPRuntime.isDebug())
            System.out.println("Activate native: "+jar.getLocation());

        File localFile = tracker.getCacheFile(jar.getLocation());
        if (localFile == null)

        String[] librarySuffixes = { ".so", ".dylib", ".jnilib", ".framework", ".dll" };

        try {
            JarFile jarFile = new JarFile(localFile, false);
            Enumeration<JarEntry> entries = jarFile.entries();

            while (entries.hasMoreElements()) {
                JarEntry e = entries.nextElement();

                if (e.isDirectory()) {

                String name = new File(e.getName()).getName();
                boolean isLibrary = false;

                for (String suffix: librarySuffixes) {
                    if (name.endsWith(suffix)) {
                       isLibrary = true;
                if (!isLibrary) {

                if (nativeDir == null)
                    nativeDir = getNativeDir();

                File outFile = new File(nativeDir, name);

                                     new FileOutputStream(outFile));

        catch (IOException ex) {
            if (JNLPRuntime.isDebug())

Generated by  Doxygen 1.6.0   Back to index