The Apache Commons team has announced the release of Commons IO 2.0 which can be downloaded here.
Commons IO is a library that contains utility classes, stream implementations, file filters, file comparators and components for dealing with IO operations. The release notes contains the full details of the enhancements and bug fixes in IO 2.0, but below is a summary of whats new:
Commons IO 2.0 has moved to JDK 1.5 allowing improvements both internally and in the external API. Except for the new minimum JDK requirement, however, it is otherwise backwards compatible with the previous release, which required JDK 1.3.
Streams, Readers & Writers
There are a number of new InputStream / Reader and OutputStream / Writer implementations in IO 2.0:
As well as these new streams the Proxy InputStream, OutputStream, Reader & Writer implementations have had exception handling and pre/post processing support added.
File Alteration Monitor
The File Alteration Monitor is a component for monitoring file system events (directory and file create, update and delete events). It originated in the JCI FAM module but has been refactored to improve performance and allow selective monitoring of the file system using filters. See the FileAlterationObserver JavaDocs for examples of how to use this component.
The Tailer component is a simple implementation of the unix "tail -f" functionality. Register a TailerListener implementation to be notified of new lines in a file.
isSymlink() method to detect sym links
sizeOf(File) method which, if the file is a directory, sums the sizes of the files recursively
New methods for getting the system's home directory file or path
New methods for getting the system's temporary directory file or path
New implementation of the
freeSpaceKb() method that has no arguments
New implementations of the
freeSpaceKb() methods that take a timeout parameter