How to read a resource in application classpath in JBoss EAP 5 or 6?

Solution Verified - Updated -

Issue

  • How to read a filesystem resource that is:
    • in the same directory as a class file
    • in the root directory of a deployment
    • in my server profile's conf directory
    • inside a jar library that's on that classpath

Environment

Red Hat JBoss Enterprise Application Platform (EAP)

  • EAP 5.x
  • EAP 6.x

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