This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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: 37907
    
  22
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
one to one unidirectional mapping in jpa
Generating Class Files from an XML Doc
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