| <whichresource > More on the Resource case | <whichresource > More on the Resource case 2004-01-11 - By Jack J. Woehr
koji_sekiguchi@(protected) wrote:
> Thank you for your quick action.
Well, I'm not an Ant committer. I just tried what you said, found you were correct, and offered a change to the Ant community. You and I both could have overlooked some issue in this case! :-) Let's see what happens.
> How about "resource" case?
That works okay. For example, I have my SoftWoehr class library source tree residing under /usr/local/work/SoftWoehr/ ... Here is a modified test case like before:
<?xml version="1.0" standalone="yes"?>
<project name="test-whichresource" default="dotest"> <target name="dotest"> <whichresource property="testresult" class="org.apache.tools.ant .Main"/> <echo message="${testresult}"/> <whichresource property="testresult.bis" resource="com/SoftWoehr/images /meu.jpg" classpath="/usr/local/work/SoftWoehr"/> <echo message="${testresult.bis}"/> </target> </project>
The output is as follows:
dotest: [echo] jar:file:/usr/local/ant/lib/ant.jar!/org/apache/tools/ant/Main .class [echo] file:/usr/local/work/SoftWoehr/com/SoftWoehr/images/meu.jpg
Resource loading *does* work that way with a leading slash in the path. I guess that's what confused the issue about class loading.
-- Jack J. Woehr # We have gone from the horse and buggy Senior Consultant # to the moon rocket in one lifetime, but Purematrix, Inc. # there has not been a corresponding moral www.purematrix.com # growth in mankind. - Dwight D. Eisenhower
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|
 |