-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: problem with property file
PostPosted: Mon Apr 04, 2005 11:15 pm 
Newbie

Joined: Mon Apr 04, 2005 11:10 pm
Posts: 6
hi guys....


i have problem with property files....

i am specifying like this...


props.load(new FileInputStream("C:/Libs/hibernate-2.1/etc/hibernate.properties"));

it works fine onlocal machine...........................but what happens when i deploy this to tomcat.............and linux machines dont hace c drive......



help me out ..................



hit me hard ...........


come back soon!

_________________
i love u peeps!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 05, 2005 11:04 am 
Newbie

Joined: Tue Apr 05, 2005 8:01 am
Posts: 12
I dont understand your correct requirement, but if you want to read a properties file which is there in the classpath this is how you can do it.

InputStream propertyStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("something.properties");
Properties props = new Properties();
props.load(propertyStream);

This way you dont have to bother where you going to place the file


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.