ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Baker <simon.ba...@clearmoney.com>
Subject loadproperties
Date Mon, 07 Oct 2002 12:16:23 GMT
If a property in a property file is blank (which in our case it legally
might be), or indeed the property doesn't exist in the property file, eg. it
is commented out, then when ant loads the property file the associated
variable contains the variable name, .ie. ${variablename}

How can i get the ant variable to contain blank following a property load?

Here's the property file:

# Default Webstream Settings
[default]webstream.volume=" " 
[default]webstream.log_volume=
[default]webstream.messaging_port=10050
[default]webstream.use_ssl=true
[default]webstream.java_path=/usr/WebSphere/AppServer/java/jre/sh/java

Here's the ant load:

<loadproperties srcFile="webstream.properties">
	<filterchain>
      	<linecontains>
            	<contains value="[default]"/>
            </linecontains>
            <replacetokens begintoken="[" endtoken="]">
            	<token key="default" value=""/>
            </replacetokens>
      </filterchain>
</loadproperties>   

And here's an echo of the variable:

<echo>webstream.volume=${webstream.volume}</echo>
<echo>webstream.log_volume=${webstream.log_volume}</echo>
<echo>webstream.messaging_port=${webstream.messaging_port}</echo>
<echo>webstream.use_ssl=${webstream.use_ssl}</echo>
<echo>webstream.java_path=${webstream.java_path}</echo>

This results in:

init:
     [echo] webstream.volume=${webstream.volume}
     [echo] webstream.log_volume=${webstream.log_volume}
     [echo] webstream.messaging_port=10050
     [echo] webstream.use_ssl=true
     [echo] webstream.java_path=/usr/WebSphere


Simon Baker 
Clear Money Ltd. 
84-86 Regent Street 
London 
W1B 5RR
t: +44 (0)20 7025 6605
f: +44 (0)20 7025 6501
e: simon.baker@clearmoney.com 

Visit our web site at: <http://www.clear.co.uk> 



**********************************************************************
Confidentiality: this e-mail and any attachments may be confidential. If you are not the intended
recipient you should not read, copy, distribute, disclose or otherwise use the information
in this e-mail and any attachments. Please reply to this e-mail highlighting the error and
delete the e-mail and any attachments from your system.

Security Warning: please note that this e-mail has been created in the knowledge that Internet
e-mail is not a 100% secure communications medium. We suggest that you consider this when
e-mailing us.

Viruses: although we have taken steps to ensure that this e-mail and attachments are free
from any virus we advise that in keeping with good computing practice the recipients should
ensure that they are actually virus free.

Clear, Clear Money and the Clear logo are trade marks of Clear Money Limited and they should
not be used, nor should any part of the material in this e-mail be copied, without our prior
written permission. Clear Money Limited is a limited liability company incorporated in the
UK. Registered Office: 84-86 Regent Street, London. W1B 5RR. Telephone: 020 7025 6500. Fax:
020 7025 6501. Corporation No: 03873527. VAT No: 751 8550 22.
**********************************************************************

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message