aspose file tools
The moose likes Java in General and the fly likes Working with properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Working with properties file" Watch "Working with properties file" New topic
Author

Working with properties file

Frederic Henri
Greenhorn

Joined: Mar 29, 2007
Posts: 5
Hi all,

I have to work with properties file and wonder how I can get hashmap of the keys ?

I have properties like :
FileTransformer.<fileType>.Name = "descriptive name";
FileTransformer.<fileType>.extension = "*.xxx";
FileTransformer.<fileType>.transformer = "class_name";

here I can get as possibly as many fileTypes as there is different extension types. As the time I read my properties file, I am not certain of all properties there is. Also my properties file will contain many other properties that I am not interested in when I want to read only the FileTransformer part.

Is there a way working with properties file to get a hashmap of FileTransformer only ? where all <fileType> will be key of another
hashmap ?

Thanks for your comment,
Fred
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2300
You can at best get all the keys and then have some custom function to select out all the keys that starts with "FileTransformer" and use those keys further.
There is nothing built in Properties as such.


Rahul Bhattacharjee
LinkedIn - Blog
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Working with properties file
 
Similar Threads
web.xml causes 404 error
complete web.xml sample
parsing the XML tags values having the same name
Configuring Tomcat 5 on Win2K and Linux
Apache2 / Tomcat 6 / GWT 2.0 - Could use some help