Apache Commons logo Commons IO


These are the release notes and advice for upgrading Commons-IO from version 1.3.2 to version 1.4.

Commons IO is a package of Java utility classes for java.io's hierarchy.  
Classes in this package are considered to be so standard and of such high 
reuse as to justify existence in java.io.

Commons IO contains utility classes, stream implementations, file filters, 
file comparators and endian transformation classes.

Compatibility with 1.3.2
Binary compatible - Yes

Source compatible - Yes

Semantic compatible - Yes
  Check the bug fixes section for semantic bug fixes

Commons IO 1.4 introduces four new implementations which depend on JDK 1.4 features
(CharSequenceReader, FileWriterWithEncoding, IOExceptionWithCause and RegexFileFilter).
It has been built with the JDK source and target options set to JDK 1.3 and, except for
those implementations, can be used with JDK 1.3 (see IO IO-127).

Deprecations from 1.3.2
- FileCleaner deprecated in favour of FileCleaningTracker [see IO-116]

Bug fixes from 1.3.2
- FileUtils
  - forceDelete of orphaned Softlinks does not work [IO-147]
  - Infinite loop on FileUtils.copyDirectory when the destination directory is within
    the source directory [IO-141]

- HexDump
  - HexDump's use of static StringBuffers isn't thread-safe [IO-136]

Enhancements from 1.3.2
- FileUtils
  - Add a deleteQuietly method [IO-135]
  - Add a copyDirectory() method that makes use of FileFilter [IO-105]
  - Add moveDirectory() and moveFile() methods [IO-77]

- FilenameUtils
  - Add file name extension separator constants[IO-149]

- IOExceptionWithCause [IO-148]
  - Add a new IOException implementation with constructors which take a cause

- TeeInputStream [IO-129]
  - Add new Tee input stream implementation

- FileWriterWithEncoding [IO-153]
  - Add new File Writer implementation that accepts an encoding

- CharSequenceReader [IO-138]
  - Add new Reader implementation that handles any CharSequence (String,
    StringBuffer, StringBuilder or CharBuffer) 

- ThesholdingOuputStream [IO-121]
  - Add a reset() method which sets the count of the bytes written back to zero.

- DeferredFileOutputStream [IO-130]
  - Add support for temporary files

- ByteArrayOutputStream
  - Add a new write(InputStream) method [IO-152]

- New Closed Input/Output stream implementations [IO-122]
  - AutoCloseInputStream - automatically closes and discards the underlying input stream
  - ClosedInputStream - returns -1 for any read attempts
  - ClosedOutputStream - throws an IOException for any write attempts
  - CloseShieldInputStream - prevents the underlying input stream from being closed.
  - CloseShieldOutputStream - prevents the underlying output stream from being closed.

- Add Singleton Constants to several stream classes [IO-143]

- PrefixFileFilter [IO-126]
  - Add faciltiy to specify case sensitivity on prefix matching

- SuffixFileFilter [IO-126]
  - Add faciltiy to specify case sensitivity on suffix matching

- RegexFileFilter [IO-74]
  - Add new regular expression file filter implementation

- Make IOFileFilter implementations Serializable [IO-131]

- Improve IOFileFilter toString() methods [IO-120]

- Make fields final so classes are immutable/threadsafe [IO-133]
  - changes to Age, Delegate, Name, Not, Prefix, Regex, Size, Suffix and Wildcard IOFileFilter

- IOCase
  - Add a compare method to IOCase [IO-144]

- Add a package of java.util.Comparator implementations for files [IO-145]
  - DefaultFileComparator - compare files using the default File.compareTo(File) method.
  - ExtensionFileComparator - compares files using file name extensions.
  - LastModifiedFileComparator - compares files using the last modified date/time.
  - NameFileComparator - compares files using file names.
  - PathFileComparator - compares files using file paths.
  - SizeFileComparator - compares files using file sizes.