• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How can i get a resource using relative path ?

 
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I would like that my app could get a resource that is out of my ear but
using a relative path.
For example,
if my app is deployed in "c:\jboss-4.0.0\server\myapp\deploy", i would like to
access "c:\jboss-4.0.0\sever\myapp\conf\blabla".
But if using the relative path is "c:\jboss-4.0.0\bin", right ? So, how to get the information that my application is running on the context "myapp" ?
As these resources are not in my classpath, i can�t use


Does anyone know how to help me ?

Regards,
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you looking for the home folder of your server? This is going to return you the home folder of your server:


So if you have deployed the application in C:\jboss\server\myapp\deploy\xyz.ear, then the above property is going to return you C:\jboss\server\myapp. Is this what you are looking for?
 
Eusebio Floriano
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jaikiran,

It was exactly what i was looking for.
Thank you very much.

Regards,
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:Are you looking for the home folder of your server? This is going to return you the home folder of your server:


So if you have deployed the application in C:\jboss\server\myapp\deploy\xyz.ear, then the above property is going to return you C:\jboss\server\myapp. Is this what you are looking for?



how can i get the same for server installed in linux?
 
Jaikiran Pai
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The code remains the same irrespective of the operating system. The value returned will correspond to the path where the JBoss AS is installed.
 
Why fit in when you were born to stand out? - Seuss. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic