Package java.net

Examples of java.net.URLClassLoader$IndexFile


            }
//            { new File(getProjectBasedir(this.project) + "/target/test-classes").toURI().toURL() };
            if (parent == null) {
                parent = TestMultRoundtrip.class.getClassLoader();
            }
            ClassLoader loader = new URLClassLoader(urls, parent);
            Thread.currentThread().setContextClassLoader(loader);
        } catch (MalformedURLException e1) {
            e1.printStackTrace();
        }
        return oldClassLoader;
View Full Code Here


            catch (MalformedURLException e)
            {
                throw new UncheckedIOException(e);
            }
        }
        return new URLClassLoader(urls, classLoaderFactory.getRootClassLoader());
    }
View Full Code Here

    private void runNoExit(String mainClassName, String[] args) throws Exception {
        ClassPathRegistry classPathRegistry = new DefaultClassPathRegistry();
        URL[] antClasspath = classPathRegistry.getClassPathUrls("ANT");
        URL[] runtimeClasspath = classPathRegistry.getClassPathUrls("GRADLE_RUNTIME");
        ClassLoader rootClassLoader = ClassLoader.getSystemClassLoader().getParent();
        URLClassLoader antClassLoader = new URLClassLoader(antClasspath, rootClassLoader);
        URLClassLoader runtimeClassLoader = new URLClassLoader(runtimeClasspath, antClassLoader);
        Thread.currentThread().setContextClassLoader(runtimeClassLoader);
        Class mainClass = runtimeClassLoader.loadClass(mainClassName);
        Method mainMethod = mainClass.getMethod("main", String[].class);
        mainMethod.invoke(null, new Object[]{args});
    }
View Full Code Here

        // Look in the codebase for applets...
        if (propsIn == null && Environment.isApplet()) {
            URL[] cba = new URL[1];
            cba[0] = Environment.getApplet().getCodeBase();

            URLClassLoader ucl = URLClassLoader.newInstance(cba);
            propsIn = ucl.getResourceAsStream(propsFileName);
        }

        if (propsIn == null) {
            propsIn = ClassLoader.getSystemResourceAsStream(propsFileName);
View Full Code Here

                    }
                    // Look in the codebase for applets...
                    URL[] cba = new URL[1];
                    cba[0] = Environment.getApplet().getCodeBase();

                    URLClassLoader ucl = URLClassLoader.newInstance(cba);
                    url = ucl.getResource(name);

                    if (url != null) {
                        setInputReader(new URLInputReader(url));
                    }
                }
View Full Code Here

                    }
                    // Look in the codebase for applets...
                    URL[] cba = new URL[1];
                    cba[0] = Environment.getApplet().getCodeBase();

                    URLClassLoader ucl = URLClassLoader.newInstance(cba);
                    if (ucl.getResource(name) != null) {
                        exists = true;

                        // This has been commented out because the
                        // AppletDataNugget has been deprecated, and
                        // is not needed.
View Full Code Here

        try
        {
            return super.getPluginClassLoader(pluginInfo);
        } catch (ClassCastException e)
        {
            return new URLClassLoader(new URL[0], this.getClass().getClassLoader());
        }
    }
View Full Code Here

        try
        {
            return super.getXmlBlasterClassLoader();
        } catch (ClassCastException e)
        {
            return new URLClassLoader(new URL[0], this.getClass().getClassLoader());
        }
    }
View Full Code Here

        // remove this installer
        installer.dispose();
       
        // Now the fun part => run jsynoptic
        // first add the jsynoptic jar file to the classpath
        URLClassLoader sysloader = (URLClassLoader)ClassLoader.getSystemClassLoader();
        Method method;
        try {
          method = URLClassLoader.class.getDeclaredMethod("addURL",new Class[]{URL.class});
          method.setAccessible(true);
          method.invoke(sysloader,new Object[]{ jsynJar.toURL() });
View Full Code Here

   * @param basename The basename of the resource bundle to load.
   * @param locale the locale to create the localizer for.
   */
  public Localizer(URL baseurl, String basename, Locale locale) {
    try {
      URLClassLoader loader = getClassLoader(baseurl);
      //System.out.println("basename:" + basename + " baseURL: " + baseurl);
      mBundle = ResourceBundle.getBundle(basename, locale, loader);
    }
    catch (Throwable thr) {
      mLog.error("ResourceBundle not found: '" + basename + "'", thr);
View Full Code Here

TOP

Related Classes of java.net.URLClassLoader$IndexFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.