Package java.net

Examples of java.net.URLClassLoader.findResources()


    if (getLoader() instanceof URLClassLoader)
    {
      URLClassLoader ul = (URLClassLoader) getLoader();

      enumeration = cleanUrlList(ul.findResources("services.list"));
    }
    else
    {
      enumeration = cleanUrlList(getLoader().getResources("services.list"));
    }
View Full Code Here


      if (loader instanceof URLClassLoader)
      {
        URLClassLoader ul = (URLClassLoader) loader;

        enumeration = cleanUrlList(ul.findResources("services.list"));
      }
      else
      {
        enumeration = cleanUrlList(loader.getResources("services.list"));
      }
View Full Code Here

        {
          URLClassLoader ul = (URLClassLoader) loader;

          try
          {
            Enumeration e2 = ul.findResources("services.list");

            if (e2.hasMoreElements())
            {
              System.err
                      .println("NOTE: findResources found services.list entries - so this is probably a classloader issue");
View Full Code Here

    if (loader instanceof URLClassLoader)
    {
      URLClassLoader ul = (URLClassLoader) loader;

      eachServicesEntry = ul.findResources("META-INF/services/" + oneEntry);
    }
    else
    {
      eachServicesEntry = cleanUrlList(loader.getResources("META-INF/services/" + oneEntry));
    }
View Full Code Here

    private static void scanEpisodeFile(File jar, SchemaCompiler sc)
            throws BadCommandLineException, IOException {

        URLClassLoader ucl = new URLClassLoader(new URL[]{jar.toURL()});
        Enumeration<URL> resources = ucl.findResources("META-INF/sun-jaxb.episode");
        while (resources.hasMoreElements()) {
            URL url = resources.nextElement();
            sc.getOptions().addBindFile(new InputSource(url.toExternalForm()));
        }
View Full Code Here

        Support_Resources.copyFile(resources, "JarIndex", "hyts_21.jar");
        Support_Resources.copyFile(resources, "JarIndex", "hyts_22.jar");
        Support_Resources.copyFile(resources, "JarIndex", "hyts_23.jar");
        urls[0] = new URL("file:/" + resPath + "/JarIndex/hyts_21.jar");
        ucl = URLClassLoader.newInstance(urls, null);
        Enumeration en = ucl.findResources("bpack/");

        boolean resourcesFound;
        try {
            resourcesFound = true;
            URL url1 = (URL) en.nextElement();
View Full Code Here

        // testing circular reference
        Support_Resources.copyFile(resources, "JarIndex", "hyts_41.jar");
        Support_Resources.copyFile(resources, "JarIndex", "hyts_42.jar");
        urls[0] = new URL("file:/" + resPath + "/JarIndex/hyts_41.jar");
        ucl = URLClassLoader.newInstance(urls, null);
        en = ucl.findResources("bpack/");
        resourcesFound = resourcesFound
                && ((URL) en.nextElement()).equals(new URL("jar:file:/"
                        + resPath.replace('\\', '/')
                        + "/JarIndex/hyts_42.jar!/bpack/"));
        assertTrue("Resources not found (2)", resourcesFound);
View Full Code Here

        Support_Resources.copyFile(resources, "JarIndex", "hyts_23.jar");

        URLClassLoader urlClassloader = URLClassLoader.newInstance(
                new URL[] { new URL("file:/" + resPath
                        + "/JarIndex/hyts_21.jar") }, null);
        Enumeration en = urlClassloader.findResources("bpack/");
        assertTrue(en.hasMoreElements());
        URL expected = new URL("jar:file:/" + resPath.replace('\\', '/')
                + "/JarIndex/hyts_22.jar!/bpack/");
        assertEquals(expected, (URL) en.nextElement());
        assertEquals(expected, urlClassloader.findResource("bpack/"));
View Full Code Here

    private static void scanEpisodeFile(File jar, SchemaCompiler sc)
            throws BadCommandLineException, IOException {

        URLClassLoader ucl = new URLClassLoader(new URL[]{jar.toURL()});
        Enumeration<URL> resources = ucl.findResources("META-INF/sun-jaxb.episode");
        while (resources.hasMoreElements()) {
            URL url = resources.nextElement();
            sc.getOptions().addBindFile(new InputSource(url.toExternalForm()));
        }
View Full Code Here

     * Finds the <tt>META-INF/sun-jaxb.episode</tt> file to add as a binding customization.
     */
    public void scanEpisodeFile(File jar) throws BadCommandLineException {
        try {
            URLClassLoader ucl = new URLClassLoader(new URL[]{jar.toURL()});
            Enumeration<URL> resources = ucl.findResources("META-INF/sun-jaxb.episode");
            while (resources.hasMoreElements()) {
                URL url = resources.nextElement();
                addBindFile(new InputSource(url.toExternalForm()));
            }
        } catch (IOException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.