/** * Finds the resource with the given name. A resource is * some data (images, audio, text, etc) that can be accessed by class * code in a way that is independent of the location of the code. * * @param name The name of the resource for which a stream is required. * Must not be <code>null</code>. * @return a URL for reading the resource, or <code>null</code> if the * resource could not be found or the caller doesn't have * adequate privileges to get the resource. */ public synchronized URL getResource(String name) { // we need to search the components of the path to see if // we can find the class we want. if (isParentFirst(name)) { return super.getResource(name); } // try this class loader first, then parent URL url= findResource(name); if (url == null) { url= getParent().getResource(name); } return url; }