ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bailey, Darragh" <dbai...@hp.com>
Subject RE: Problem with Ant pathconvert and paths with spaces [Solved]
Date Fri, 23 Jul 2010 16:21:38 GMT

> -----Original Message-----
> From: David Weintraub [mailto:qazwart@gmail.com] 
> Sent: 23 July 2010 16:43
> To: Ant Users List
> Subject: Re: Problem with Ant pathconvert and paths with spaces
> 
> On Fri, Jul 23, 2010 at 11:00 AM, Bailey, Darragh 
> <dbailey@hp.com> wrote:
> > I've also done some additional testing and have found that 
> the following will eliminate the problem for a single space.
> >
> >      <chainedmapper>
> >        <regexpmapper to="\1" from="file:([^\!]*)" />
> >        <regexpmapper from="(.*)%20(.*)" to="\1 \2" />
> >      </chainedmapper>
> 
> Take a look at this:
> http://ant.apache.org/manual/Types/mapper.html#filter-mapper
> 
> This might work:
> 
> <filtermapper>
>   <replacestring from="%20" to=" "/>
> </filtermapper>

Perfect, thanks that did the trick. 

Final result:
    <whichresource property="extra.lib.url" class="${extra.lib.classname}">
      <classpath>
        <fileset dir="${extra.lib.dir}" >
          <include name="**/*.jar" />
        </fileset>
      </classpath>
    </whichresource>
    <fail unless="extra.lib.url" message="extralib classes not found" />
    <pathconvert property="extra.lib">
      <path location="${extra.lib.url}" />
      <chainedmapper>
        <regexpmapper to="\1" from="file:([^\!]*)" />
        <!-- convert the url encoded spaces back to spaces -->
        <filtermapper>
          <replacestring from="%20" to=" " />
        </filtermapper>
      </chainedmapper>
    </pathconvert>

    <echo message="Using extra classes from ${extra.lib}" />
    <path id="classpath.extra.lib.id">
      <fileset file="${extra.lib}" />
    </path>

--
Regards,
Darragh Bailey

Systems Software Engineer
Hewlett Packard Galway Ltd.

Postal Address:    Hewlett Packard Galway Limited, Ballybrit Business Park, Galway
Registered Office: Hewlett Packard Galway Limited, 63-74 Sir John Rogerson's Quay Dublin 2
Registered Number: 361933 


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


Mime
View raw message