ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike" <>
Subject Whichresource is URL-encoding spaces
Date Tue, 12 Feb 2008 03:27:49 GMT
Hi, I'm relatively new with Ant but have been picking up on it. I trying to
figure out why this Ant script doesn't complete successfully:
<?xml version="1.0" encoding="utf-8"?>
<project name="test" basedir=".">
	<property environment="env" />
	<whichresource property=""
resource="" classpath="."/>

	<pathconvert property="">
		<path location="${}" />
		<regexpmapper to="\1" from="file:(.*)" />
	<condition property="exists">
		<available file="${}"/>
	<echo message="${}" />
	<fail message="it doesn't exist." unless="exists" />
	<target name="test" />

The output I get from Eclipse is:

C:\Documents and Settings\Mike\workspace\test\build.xml:16: it doesn't

I have determined that the cause is the whichresource task -- it's URL
encoding spaces in my path to %20 this resulting in
"C:\Documents%20and%20Settings\Mike". When I hard-code the same path without
URL encoding the "exists" condition is true. Obviously one solution is to
not use a path with spaces, but I'd like to keep it as-is if there's a

I haven't written this script, but if whichresource finds a file should
there be a need to check if it's "available"?

Thanks in advance for any help.


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

View raw message