ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Gordon" <tim.gor...@allustra.com>
Subject File URLs for different plaforms
Date Mon, 24 Apr 2006 09:01:11 GMT
Hi

Not a pure ANT question, but it's relevant to building configurations for
remote systems, possibly of another OS...

 Is there a simple way to generate file URLs that are guaranteed to work on
another platform?

For example, something like:

config.url=file://${file.system.path}

doesn't work for *nix systems and Windows, because you'll get something like

config.url=file:///home/user/settings.properties

which is fine under *nix, but

config.url=file://C:\Documents and Settings\user\settings.properties

under Windows, which isn't a valid URL because it Java starts looking for a
host call 'C'.

The simplest way out seems to be to define my config.url propeties like

config.url=file:///${file.system.path}

instead, because *nix absorbs the superfluous forward-slash but this doesn't
seem to be a very elegant solution.

Tim Gordon
Allustra Limited
Paxton House
30 Artillery Lane
London
E1 7LS
Tel +44 (0)20 7539 5722
Fax +44 (0)20 7539 5710
http://www.allustra.com/





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


Mime
View raw message