ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Jackson" <foamd...@gmail.com>
Subject Re: svn commit: r486161 - /ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/condition/HasFreeSpace.java
Date Tue, 12 Dec 2006 14:43:02 GMT
> Kev, I'd have expected the reflection to be on the new File method in
> jdk6, not on an Ant class that depends on jdk6+. Because this means
> this new Ant class must be compiled with jdk6+, or cross-compiled
> against a jdk6+ rt.jar.

True, I hadn't considered that, my focus was entirely on maintaining a
clean build on pre java6 vms, without considering if the code was
actually compiled.

>
> So more something like (assuming a File#freeSpace method):
>
> > +  ReflectWrapper w = new ReflectWrapper(..., "java.io.File");
> > +  long free = ((Long)w.invoke("freeSpace", String.class, partition)).longValue();
> > +  return free >= StringUtils.parseHumanSizes(needed);

I'll try some variations of this to see if I can get it to work as suggested.

Thanks
Kev

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


Mime
View raw message