Exemplo n.º 1
0
 /**
  * @see java.lang.ClassLoader#findResource(java.lang.String)
  * @return A URL object for reading the resource, or null if the resource could not be found.
  *     Example URL: jar:file:C:\...\some.jar!/resources/InnerText.txt
  */
 @Override
 protected URL findResource(String sName) {
   logDebug(LogArea.RESOURCE, "findResource: %s", sName);
   if (isLaunchedFromJar()) {
     JarEntryInfo inf = findJarEntry(normalizeResourceName(sName));
     if (inf != null) {
       URL url = inf.getURL();
       logInfo(LogArea.RESOURCE, "found resource: %s", url);
       return url;
     }
     logInfo(LogArea.RESOURCE, "not found resource: %s", sName);
     return null;
   }
   return super.findResource(sName);
 } // findResource()
Exemplo n.º 2
0
 /**
  * @see java.lang.ClassLoader#findResources(java.lang.String)
  * @return An enumeration of {@link java.net.URL <tt>URL</tt>} objects for the resources
  */
 @Override
 public Enumeration<URL> findResources(String sName) throws IOException {
   logDebug(LogArea.RESOURCE, "getResources: %s", sName);
   if (isLaunchedFromJar()) {
     List<JarEntryInfo> lstJarEntry = findJarEntries(normalizeResourceName(sName));
     List<URL> lstURL = new ArrayList<URL>();
     for (JarEntryInfo inf : lstJarEntry) {
       URL url = inf.getURL();
       if (url != null) {
         lstURL.add(url);
       }
     }
     return Collections.enumeration(lstURL);
   }
   return super.findResources(sName);
 } // findResources()