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

void net::sourceforge::jnlp::runtime::JNLPClassLoader::initializeResources (  )  throws LaunchException [inline, package]

Load all of the JARs used in this JNLP file into the ResourceTracker for downloading.

If the user trusts this publisher (i.e. the publisher's certificate is in the user's trusted.certs file), we do not show any dialogs.

Definition at line 391 of file JNLPClassLoader.java.

References activateJars(), net::sourceforge::jnlp::cache::ResourceTracker::addResource(), net::sourceforge::jnlp::tools::JarSigner::allJarsSigned(), net::sourceforge::jnlp::tools::JarSigner::anyJarsSigned, available, file, fillInPartJars(), net::sourceforge::jnlp::tools::JarSigner::getAlreadyTrustPublisher(), net::sourceforge::jnlp::cache::ResourceTracker::getCacheFile(), net::sourceforge::jnlp::JNLPFile::getCodeBase(), net::sourceforge::jnlp::ResourcesDesc::getJARs(), net::sourceforge::jnlp::JARDesc::getLocation(), net::sourceforge::jnlp::ResourcesDesc::getMainJAR(), net::sourceforge::jnlp::JNLPFile::getResources(), net::sourceforge::jnlp::JNLPFile::getSecurity(), jarLocationSecurityMap, js, R(), resources, strict, tracker, verifyJars(), and waitForJars().

Referenced by JNLPClassLoader().

                                                      {
        JARDesc jars[] = resources.getJARs();
                if (jars == null || jars.length == 0)
                        return;
                /*
                if (jars == null || jars.length == 0) {
                        throw new LaunchException(null, null, R("LSFatal"),
                                            R("LCInit"), R("LFatalVerification"), "No jars!");
                }
                */
        List initialJars = new ArrayList();

        for (int i=0; i < jars.length; i++) {

            available.add(jars[i]);

            if (jars[i].isEager())
                initialJars.add(jars[i]); // regardless of part

            tracker.addResource(jars[i].getLocation(),
                                jars[i].getVersion(),
                                jars[i].isCacheable() ? JNLPRuntime.getDefaultUpdatePolicy() : UpdatePolicy.FORCE
                               );
        }

        if (strict)
            fillInPartJars(initialJars); // add in each initial part's lazy jars

                if (JNLPRuntime.isVerifying()) {

                        JarSigner js;
                        waitForJars(initialJars); //download the jars first.

                        try {
                                js = verifyJars(initialJars);
                        } catch (Exception e) {
                                //we caught an Exception from the JarSigner class.
                                //Note: one of these exceptions could be from not being able
                                //to read the cacerts or trusted.certs files.
                                e.printStackTrace();
                                throw new LaunchException(null, null, R("LSFatal"),
                                        R("LCInit"), R("LFatalVerification"), R("LFatalVerificationInfo"));
                        }

                        //Case when at least one jar has some signing
                        if (js.anyJarsSigned()){
                                signing = true;

                                if (!js.allJarsSigned() &&
                                    !SecurityWarningDialog.showNotAllSignedWarningDialog(file))
                                    throw new LaunchException(file, null, R("LSFatal"), R("LCClient"), R("LSignedAppJarUsingUnsignedJar"), R("LSignedAppJarUsingUnsignedJarInfo"));


                                //user does not trust this publisher
                                if (!js.getAlreadyTrustPublisher()) {
                                    checkTrustWithUser(js);
                                } else {
                                        /**
                                         * If the user trusts this publisher (i.e. the publisher's certificate
                                         * is in the user's trusted.certs file), we do not show any dialogs.
                                         */
                                }
                        } else {

                                signing = false;
                                //otherwise this jar is simply unsigned -- make sure to ask
                                //for permission on certain actions
                        }
                }

                for (JARDesc jarDesc: file.getResources().getJARs()) {
                        try {
                                URL location = tracker.getCacheFile(jarDesc.getLocation()).toURL();
                                SecurityDesc jarSecurity = file.getSecurity();

                                if (file instanceof PluginBridge) {

                                URL codebase = null;

                                if (file.getCodeBase() != null) {
                                    codebase = file.getCodeBase();
                                } else {
                                    //Fixme: codebase should be the codebase of the Main Jar not
                                    //the location. Although, it still works in the current state.
                                    codebase = file.getResources().getMainJAR().getLocation();
                                }

                                        jarSecurity = new SecurityDesc(file,
                                                        SecurityDesc.ALL_PERMISSIONS,
                                                        codebase.getHost());
                                }

                                jarLocationSecurityMap.put(location, jarSecurity);
                        } catch (MalformedURLException mfe) {
                                System.err.println(mfe.getMessage());
                        }
                }

        activateJars(initialJars);
    }


Generated by  Doxygen 1.6.0   Back to index