Package java.net

Examples of java.net.URLClassLoader$IndexFile


    for (int i = 0; i < urlList.length; i++) {
      urls[i] = new URL("file:" + path + getJarName(urlList[i]));
    }

    // add downloaded jars to the classpath with required permissions
    classLoader = new URLClassLoader(urls) {
      protected PermissionCollection getPermissions (CodeSource codesource) {
        PermissionCollection perms = null;

        try {
          // getPermissions from original classloader is important as it checks for signed jars and shows any security dialogs needed
View Full Code Here


        Iterator urls = list.iterator();
        URL[] urlArray = new URL[list.size()];
        for (int i = 0; urls.hasNext(); i++) {
            urlArray[i] = (URL)urls.next();
        }
        classLoader = new URLClassLoader(urlArray, findParentClassLoader());
    }
View Full Code Here

            URL[] urls = new URL[] { new File(".").toURL() };
            ClassLoader parent = Thread.currentThread().getContextClassLoader();
            if (parent == null) {
                parent = TestMultRoundtrip.class.getClassLoader();
            }
            ClassLoader loader = new URLClassLoader(urls, parent);
            Thread.currentThread().setContextClassLoader(loader);
            mclas = loader.loadClass(mname);
        } catch (ClassNotFoundException ex) {
            System.err.println("Class " + mname + " not found");
            return false;
        }
        IBindingFactory bfact;
View Full Code Here

            for (int i = 0; i < urls.length; i++) {
                urls[i] = new File(paths[i]).toURI().toURL();
            }
           
            // initialize classloader with full array of path URLs
            s_directLoader = new URLClassLoader(urls,
                ClassFile.class.getClassLoader());
           
        } catch (MalformedURLException ex) {
            throw new IllegalArgumentException
                ("Error initializing classloading: " + ex.getMessage());
View Full Code Here

        ClassLoader originalClassloader = Server.class.getClassLoader();
        List<File> additionalClasspath = new ArrayList<File>();
        for (File additionalRuntimeJar : getAdditionalRuntimeJars()) {
            additionalClasspath.add(additionalRuntimeJar);
        }
        URLClassLoader jettyClassloader = new URLClassLoader(GFileUtils.toURLArray(additionalClasspath), originalClassloader);
        try {
            Thread.currentThread().setContextClassLoader(jettyClassloader);
            startJetty();
        } finally {
            Thread.currentThread().setContextClassLoader(originalClassloader);
View Full Code Here

         
          return( super.loadClass( name, resolve ));
        }
      };
     
      ClassLoader cl = new URLClassLoader(new URL[]{jar_file.toURI().toURL()}, parent);
     
        Class c = cl.loadClass( "org.gudy.azureus2.core3.util.Constants");

        Field  field = c.getField( "AZUREUS_VERSION" );
       
        return((String)field.get( null ));
       
View Full Code Here

  }
 
 
  public Version determineWGAVersion() throws IOException, ClassNotFoundException, IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException {
    File classesDir = new File(getDeployDir(), "WEB-INF/classes");
    URLClassLoader loader = new URLClassLoader(new URL[] {classesDir.toURL()}, this.getClass().getClassLoader());
    Class wgaVersionClass = loader.loadClass("de.innovationgate.wgpublisher.WGAVersion");
    Version version = new Version();
    version.setMajorVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_MAJOR_VERSION").getInt(null));
    version.setMinorVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_MINOR_VERSION").getInt(null));
    version.setMaintenanceVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_MAINTENANCE_VERSION").getInt(null));
    version.setPatchVersion(wgaVersionClass.getDeclaredField("WGAPUBLISHER_PATCH_VERSION").getInt(null));
View Full Code Here

    }
    try {
      File wgutils = new File(getWebappDir(), "libs/wgutils.jar");
      URL[] jars = new URL[1];
      jars[0] = wgutils.toURL();
      URLClassLoader classLoader = new URLClassLoader(jars);
      Class factoryClass = classLoader.loadClass("de.innovationgate.wga.config.WGAConfigurationFactory");
    } catch (MalformedURLException e) {
      return false;
    } catch (ClassNotFoundException e) {
      return false;
    }
View Full Code Here

           System.out.println("Parent Classloader of new context classloader is: " + parentClassloader);
           System.out.println("Adding the following files to new logging classloader: " + loggingJars);
           System.out.println("Adding the following files to new lib classloader: " + nonLoggingJars);
       }

       URLClassLoader loggingClassLoader = new URLClassLoader(loggingJars.toArray(new URL[loggingJars.size()]),
               parentClassloader);

       if (useParentLastClassLoader) {
           libClassLoader = new ParentLastClassLoader(nonLoggingJars.toArray(new URL[nonLoggingJars.size()]),
                   loggingClassLoader);
       } else {
           libClassLoader = new URLClassLoader(nonLoggingJars.toArray(new URL[nonLoggingJars.size()]),
                   loggingClassLoader);
       }

       if (bootStrapDebug) {
           System.out.println("Logging class loader: " + loggingClassLoader);
View Full Code Here

        if (retval == null && Environment.isApplet()) {
            if (DEBUG)
                Debug.output("PropUtils.getROFOU(): checking with URLClassLoader");
            URL[] cba = new URL[1];
            cba[0] = Environment.getApplet().getCodeBase();
            URLClassLoader ucl = URLClassLoader.newInstance(cba);
            retval = ucl.getResource(name);
        }

        // If there was no resource by that name available
        if (retval == null) {
            if (DEBUG)
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.