ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Bailey" <>
Subject Best way to URL encode a path in a property?
Date Wed, 25 Sep 2002 17:58:01 GMT
I'd like to know the [best] way to do this...  I'm using Ant 1.5.1...

I have a property that gets set to a path.  This path might contain spaces,
e.g. "C:\Program Files\Foo".  I need to substitute that path into a URL that
is passed for an RMI codebase, which is stored in a property in a properties
file that I load, i.e. the line in the properties file looks like:


I load the properties file with a <loadproperties>, and nested filterchain
to do the substitution on @THEPATH@.  But, what I need to do, is at least
convert any spaces in the path property to "%20", and it'd probably be good
to just URL encode the whole path.  What do people suggest?

Would the simplest thing be to do some kind of replace on the original
property, creating a new property that is say path.urlencoded, and use that
as what to substitute for @THEPATH@, or is there something else I should do,

Chris Bailey

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message