private Enumeration<URL> getResources11g(ClassLoader classLoader, String configFileName) {
    List<URL> newProps = new ArrayList<URL>();
    if (classLoader.getClass().getSimpleName().equalsIgnoreCase("IdcClassLoader")) {
      try {
        Field field = classLoader.getClass().getField("m_zipfiles");

        @SuppressWarnings("unchecked")
        Map<String, IdcZipFile> zipFiles = (Map<String, IdcZipFile>) field.get(classLoader);

        for (Entry<String, IdcZipFile> entry : zipFiles.entrySet()) {
          if (entry.getValue().m_entries.get(configFileName) != null) {
            String jarFile = entry.getKey();

            // windows needs a slash before the C:/
            if (!jarFile.startsWith("/")) {
              jarFile = "/" + jarFile;
            }

            try {
              URL u = new URL("jar:file:" + entry.getKey() + "!/" + configFileName);
              newProps.add(u);

            } catch (MalformedURLException e) {
              e.printStackTrace();
            }
          }
        }

      } catch (Exception e) {
        // If there is any exception the ClassLoader is an unrecognised format
        e.printStackTrace();
      }
    }
    return Collections.enumeration(newProps);
  }
private Enumeration<URL> getResources11g(ClassLoader classLoader, String configFileName) {
    List<URL> newProps = new ArrayList<URL>();
    if (classLoader.getClass().getSimpleName().equalsIgnoreCase("IdcClassLoader")) {
      try {
        Field field = classLoader.getClass().getField("m_zipfiles");

        @SuppressWarnings("unchecked")
        Map<String, IdcZipFile> zipFiles = (Map<String, IdcZipFile>) field.get(classLoader);

        for (Entry<String, IdcZipFile> entry : zipFiles.entrySet()) {
          if (entry.getValue().m_entries.get(configFileName) != null) {
            String jarFile = entry.getKey();

            
            if (!jarFile.startsWith("/")) {
              jarFile = "/" + jarFile;
            }

            try {
              URL u = new URL("jar:file:" + entry.getKey() + "!/" + configFileName);
              newProps.add(u);

            } catch (MalformedURLException e) {
              e.printStackTrace();
            }
          }
        }

      } catch (Exception e) {
        
        e.printStackTrace();
      }
    }
    return Collections.enumeration(newProps);
  }
private Enumeration < URL > getResources11g ( ClassLoader classLoader , String configFileName ) { List < URL > newProps = new ArrayList < URL > ( ) ; if ( classLoader . getClass ( ) . getSimpleName ( ) . equalsIgnoreCase ( "IdcClassLoader" ) ) { try { Field field = classLoader . getClass ( ) . getField ( "m_zipfiles" ) ; @ SuppressWarnings ( "unchecked" ) Map < String , IdcZipFile > zipFiles = ( Map < String , IdcZipFile > ) field . get ( classLoader ) ; for ( Entry < String , IdcZipFile > entry : zipFiles . entrySet ( ) ) { if ( entry . getValue ( ) . m_entries . get ( configFileName ) != null ) { String jarFile = entry . getKey ( ) ; // windows needs a slash before the C:/ if ( ! jarFile . startsWith ( "/" ) ) { jarFile = "/" + jarFile ; } try { URL u = new URL ( "jar:file:" + entry . getKey ( ) + "!/" + configFileName ) ; newProps . add ( u ) ; } catch ( MalformedURLException e ) { e . printStackTrace ( ) ; } } } } catch ( Exception e ) { // If there is any exception the ClassLoader is an unrecognised format e . printStackTrace ( ) ; } } return Collections . enumeration ( newProps ) ; }
Replacement for getResources which works on 11g.

<p>
The UCM 11G {@link ClassLoader} does not load component jars in the
standard manner, which means you cannot use
{@link ClassLoader#getResources(String)} to find all instances of a
specific file in the jar path, instead we inspect the m_zipfiles map, where
we can query each zip file for the properties file.
</p>

<p>
Instead, we use reflection to find all the loaded component jar files and
search manually
</p>

@param classLoader
@param configFileName
@throws MalformedURLException
Replacement for getResources which works on 11g .