Changeset 26264


Ignore:
Timestamp:
09/27/12 13:57:02 (8 years ago)
Author:
kjdon
Message:

changed findResource to getResource to make it a child:parent classloader rather than a parent first classloader

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/CollectionClassLoader.java

    r26255 r26264  
    3838        this.base_dir = GSFile.collectionResourceDir(site_home, collection_name);
    3939    }
    40 
    41     public URL findResource(String name)
     40 
     41  // Resource Bundle loading with a class loader will call getResource().
     42  // THe Java implementation of getResource tries using the parent class
     43  // loader to find the resource (or the system class loader if no parent).
     44  // If the resource not found, then it calls the local findResource method.
     45  // Ie parent:child ordering.
     46  // Because we want local files to override default ones, we need
     47  // child:parent ordering, so change getResource to look locally first.
     48  //public URL findResource(String name)
     49    public URL getResource(String name)
    4250    {
    4351        File resource_path = new File(this.base_dir, name);
     
    5361        }
    5462
    55         return super.findResource(name);
     63        return super.getResource(name);
    5664    }
    5765}
Note: See TracChangeset for help on using the changeset viewer.