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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.