Loading a directory with getResource in Java

Solution Unverified - Updated -

Issue

  • What is the correct behavior of calling getResource on Class or ClassLoader with a directory in a jar?
  • Invoking the following code behaves differently on WebLogic and EAP:

    URL baseUrl = ExampleClass.class.getResource(".");
    URL url = new URL(baseUrl, "META-INF/wsdls/example.wsdl");
    
  • What is the correct behavior of calling getResource on Class or ClassLoader with a directory?

Environment

  • Red Hat JBoss Enterprise Application Platform 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content