This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes A question about read message from resource from java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "A question about read message from resource from java class" Watch "A question about read message from resource from java class" New topic
Author

A question about read message from resource from java class

Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 61
Hi all,

I have a file such as "myinfo.properties" which contains following data:


Now I want to read the message in my java class. How can I do that?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
More of a beginner's question;

Split each line on the = and put the first part as Key and the second part as Value in a Map.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

...or user the Properties class which does the splitting and mapping part for you.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A question about read message from resource from java class
 
Similar Threads
Calling a method from within a method in another class (in the same package)?
Address Book Java Issues
A question about read message from resource from java class
Generating Class Files from an XML Doc
one to one unidirectional mapping in jpa