ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Levy-Lambert <>
Subject Re: [patch] NioFileUtils, Java6FileUtils, FileUtilsAdapter + factory, build.xml (was Re: AW: Adding a methof to StringUtils)
Date Fri, 21 Apr 2006 12:30:37 GMT
Hello Kevin,

Kev Jackson wrote:
> Ok, this is what I've managed to bash together this morning:
> - NioFileUtils (uses Java1.4 NIO libraries, altered the TRANSFER_SIZE
> as suggested to 32000, currently no way to override that (yet))
> - Java6FileUtils (currently has no implementation, but could be used
> in future for implementing Java6 features (file permisions etc))
> - FileUtils (refactored to imlement interface, still needs to have all
> comments refactored into @see -> interface)
> - FileUtilsAdapter (interface of FileUtils)
> - FileUtilsFactory (uses runtime class-loading to select correct
> version, also allows for selection of impl via system property or ant
> property (project.getProperty), as suggested, caches the instance of
> the FileUtilsAdapter on first use.  This assumes that during a build a
> user won't want to swap out FilUtils implementations.)
> - build.xml (contains the selector code for [Nio|Java6]FileUtils)
> Current problems:
> I cannot get the current code to select the implementation based on
> the property I'm specifying - (I'm using and I've also
> tried -D style props).  Any hint as to how this mechanism works in
> general would be appreciated.
Did you try to debug it ? It seems to work well for regular expressions.
> Code is just in util package, it would be nicer in it's own separate
> package - open to suggestions on this.
> Not sure that the selector in the build is working - after bootstrap +
> build, the ant-nodeps.jar doesn't contain the Nio or the
> Java6FileUtils - should they be here?
> Patch attached for consideration and comments.
One issue :

If NIOFileUtils is in the same package as FileUtils, bootstrapping under
JDK 1.2 or 1.3 would not work.
The bootstrap scripts (build.bat, are using primitive
mechanisms (directories) to find out what should be built first.

> Btw, swapping to NIO does help the AppFuse build to get past the
> copying - it now fails on HtmlUnit - which we can't do much about.  So
> (anecdotally anyway), NIO seems to use less memory than traditional IO.
Good news.

> Thanks
> Kev
> ------------------------------------------------------------------------


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

View raw message