ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yves Martin <>
Subject Proposal: improve 'whichresource' features
Date Fri, 07 Jan 2005 11:21:50 GMT


 Maybe I have not understood well what is the aim of 'whichresource' and how to
 use it - but here is my problem:

 To get the simple jar file name that contains a class loaded from the Ant lib/
 directory, I had to do:

  <pathconvert property="ant-junit-jarfile" pathSep="?">
    <path location="${ant-junit.url}"/>
    <mapper type="glob"

 It is only working on Linux...

 On Windows, ant-junit-jarfile is empty.

 The value of 'ant-junit.url' on Windows is

 [ The URI RFC says the ':' is a reserved character BUT it is used to express
   the ugly windows drive notation... Another issue for me. Does the JDK
   provide valid file: URL on Windows ? ]

 Is there a portable way to get that code working ?

 Isn't it simpler to add an output option to 'whichresource' ?


 The "output" values may be
 - 'url': complete URL,
 - 'jar': if protocol is jar, only the part between "jar:" and "!"
 - 'file': if protocol is file, only the file name)
 and so on.

 So whichresource will only write in the property the part on the URL we are
 interested in. URL specification is not enough: it has to understand some
 protocols to be able to remove "!..."  part in case of "jar:" protocol for

 What do you think about that idea ? I'm ready to work on it if ok. Or else I
 will have to create my own task.

 Thank you in advance for your answers
Yves Martin

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

View raw message