aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Replace with Properties Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Replace with Properties" Watch "Replace with Properties" New topic
Author

Replace with Properties

Steven Martin
Greenhorn

Joined: Dec 03, 2001
Posts: 25
I'm looking to use a property file to replace text properties embedded in another file.
Basically,

- load property file
- foreach property
replace propertyName in text file
with propertyValue

How do you get all the property names in a .properties file into a list and then access their values?

thanks!
Steven
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

You have changed your display name to an invalid value. Please restore the valid value prior to your next post.

Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

bear
JavaRanch Sheriff
[ May 11, 2006: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16014
    
  20

Ant has a substitution option on its copy task.


Customer surveys are for companies who didn't pay proper attention to begin with.
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
Use filter in copy tesk.
Steven Martin
Greenhorn

Joined: Dec 03, 2001
Posts: 25
But how do I iterate through the properties names and properties values from the properties file?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61010
    
  65

"stevenmartin",

My request that you change your display name to adhere to JavaRanch standards was not a suggestion. Valid display names are mandatory for participation on the Ranch. Please change your display name as instructed immediately.

Be aware that accounts with invalid display names are removed.

bear
JavaRanch Sheriff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Replace with Properties