+ if (JavaEnvUtils.isAtLeastJavaVersion("1.6")) {
+ //reflection to avoid bootstrap/build problems
+ String j6FileUtils = "org.apache.tools.ant.util.java16.Java6FileUtils";
+ ReflectWrapper w = new ReflectWrapper(..., j6FileUtils);
+ long free = ((Long)w.invoke("freeSpace", String.class,
partition)).longValue();
+ return free >= StringUtils.parseHumanSizes(needed);
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.
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);
Am I missing something? AFAIK, Ant 1.7 will not be built with jdk6. --DD
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]