0

This code snippet works fine when invoked by websphere server (cl is of type com.ibm.ws.classloader.CompoundClassLoader).

ClassLoader cl = Thread.currentThread().getContextClassLoader();
Enumeration resenum = cl.getResources("/abc.xml");

However, when I run the same code in a standalone class from main method (by adding the folder path of abc.xml to run time configuration), resnum is empty. cl is of type sun.misc.Launcher$AppClassLoader. If I remove "/" from the code, it works fine. Is there a way I can load abc.xml with a "/" before it (possibly with some other class loader)? Please help.

Singh
  • 23
  • 6
  • why not to try first with "/" and if empty try with without it? – Edwin Miguel May 31 '18 at 18:32
  • As I mentioned in my question, it works without "/". Due to some reason, I need to have that "/" before file name in the parameter to getResources(). – Singh May 31 '18 at 19:20

0 Answers0