This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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


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: 43993
    
  33
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
 
Have you checked out Aspose?
 
subject: A question about read message from resource from java class
 
It's not a secret anymore!