Package org.eclipse.birt.core.framework

# Class URLClassLoader

java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.eclipse.birt.core.framework.URLClassLoader

All Implemented Interfaces:
  `Closeable`, `AutoCloseable`

Direct Known Subclasses:
  `OSGILauncher.ChildFirstURLClassLoader`

public class URLClassLoader extends URLClassLoader
A URL class loader with close API. Java's URL class loader locks the JAR file it loaded until the JVM exit. It may cause some problem when we need remove the JARs if the class loader are not used any more. BIRT's URL class loader add a new close() method to close the JAR files explicitly. Once the close() is called, the user can't use the class and the loaded classes any more.

## Constructor Summary

Constructors
Constructor
Description
`URLClassLoader(URL[] urls)`
`URLClassLoader(URL[] urls, ClassLoader parent)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addURL(URL url)`
`void`
`close()`
`static String`
`decode(String s)`
`protected void`
`definePackage(String className, org.eclipse.birt.core.framework.URLClassLoader.Resource resource)`
`protected Class<?>`
`findClass(String name)`
`protected Class<?>`
`findClass1(String name)`
`URL`
`findResource(String name)`
`protected URL`
`findResource1(String name)`
`Enumeration<URL>`
`findResources(String name)`
`protected Enumeration<URL>`
`findResources1(String name)`
`URL[]`
`getURLs()`

### Methods inherited from class java.net.URLClassLoader

`definePackage, getPermissions, getResourceAsStream, newInstance, newInstance`

### Methods inherited from class java.security.SecureClassLoader

`defineClass, defineClass`

### Methods inherited from class java.lang.ClassLoader

`clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### URLClassLoader

public URLClassLoader(URL[] urls)

### URLClassLoader

public URLClassLoader(URL[] urls, ClassLoader parent)

## Method Details

### close

public void close()

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `URLClassLoader`

### addURL

public void addURL(URL url)

Overrides:
  `addURL` in class `URLClassLoader`

### getURLs

public URL[] getURLs()

Overrides:
  `getURLs` in class `URLClassLoader`

### findClass

protected Class<?> findClass(String name) throws ClassNotFoundException

Overrides:
  `findClass` in class `URLClassLoader`
Throws:
  `ClassNotFoundException`

### findClass1

protected Class<?> findClass1(String name) throws ClassNotFoundException

Throws:
  `ClassNotFoundException`

### definePackage

protected void definePackage(String className, org.eclipse.birt.core.framework.URLClassLoader.Resource resource)

### findResource

public URL findResource(String name)

Overrides:
  `findResource` in class `URLClassLoader`

### findResource1

protected URL findResource1(String name)

### findResources

public Enumeration<URL> findResources(String name)

Overrides:
  `findResources` in class `URLClassLoader`

### findResources1

protected Enumeration<URL> findResources1(String name)

### decode

public static String decode(String s)