Release Notes
Release Notes
Version 2.8.0
Release Notes
INTRODUCTION:
==============================================================================
Apache Commons IO Version 2.8.0
==============================================================================
Java 8 required.
New features:
o Add org.apache.commons.io.input.CircularInputStream. Thanks to Gary Gregory.
o Add org.apache.commons.io.file.PathUtils.cleanDirectory(Path,
FileVisitOption...). Thanks to Gary Gregory.
o Add org.apache.commons.io.file.PathUtils.deleteDirectory(Path,
FileVisitOption...). Thanks to Gary Gregory.
o Add NullAppendable. Thanks to Gary Gregory.
o Add PathUtils.getAclEntryList(Path). Thanks to Gary Gregory.
o Null-guard IOUtils.close(Closeable, IOConsumer). Thanks to Gary Gregory.
o Add ReversedLinesFileReader.readLines(int). Thanks to Gary Gregory.
o Add ReversedLinesFileReader.toString(int). Thanks to Gary Gregory.
o IO-684: Add PathUtils.delete(Path, DeleteOption...).
Add PathUtils.deleteDirectory(Path, DeleteOption...).
Add PathUtils.deleteFile(Path, DeleteOption...).
Add PathUtils.setReadOnly(Path, boolean, LinkOption...).
Add CleaningPathVisitor.CleaningPathVisitor(PathCounters, DeleteOption[],
String...).
Add DeletingPathVisitor.DeletingPathVisitor(PathCounters, DeleteOption[],
String...). Thanks to Gary Gregory, Robin Jansohn.
o Add RandomAccessFileInputStream. Thanks to Gary Gregory.
o IO-681: IOUtils.close(Closeable) should allow a list of closeables.
o Add IOUtils.consume(InputStream). Thanks to Gary Gregory.
o IO-676: Add isFileNewer() and isFileOlder() methods that support the Java 8
Date/Time API. #124. Thanks to Isira Seneviratne, Gary Gregory.
o Add a MarkShieldInputStream #119. Thanks to Adam Retter, Gary Gregory.
o Deprecate IOUtils.LINE_SEPARATOR in favor of Java 7's System.lineSeparator().
Thanks to Gary Gregory.
Fixed Bugs:
o CharSequenceReader.skip should return 0 instead of EOF on stream end #123. Thanks
to Rob Spoor, Jochen Wiedmann.
o Implement CharSequenceReader.ready() #122. Thanks to Rob Spoor.
o IO-669: Fix code smells; fix typos #115. Thanks to XenoAmess, Gary Gregory.
o Add caching for required charsets #120. Thanks to Jerome Wolff, Gary Gregory.
o IO-673: Make some simplifications #121. Thanks to Jerome Wolff.
o IO-674: InfiniteCircularInputStream is not infinite if its input buffer contains
-1. Thanks to Gary Gregory.
o IO-675: InfiniteCircularInputStream throws a divide-by-zero exception when
reading if its input buffer is size 0. Thanks to Gary Gregory.
o IO-677: FileSystem.getCurrent() does not return the correct enum. Thanks to Gary
Gregory.
o IO-679: input.AbstractCharacterFilterReader passes count of chars read #132.
Thanks to proneel.
o IO-683: CircularBufferInputStream.read() fails to convert byte to unsigned int
o Fix SpotBugs issues in org.apache.commons.io.FileUtils. Thanks to Gary Gregory.
o IO-672: Copying a File sets last modified date to 01 January 1970.
o IO-676: Prevent NullPointerException in ReversedLinesFileReader constructors
#117. Thanks to Michael Ernst, Gary Gregory.
Changes:
o Replace FindBugs with SpotBugs. Thanks to Gary Gregory.
o maven-checkstyle-plugin 3.1.0 -> 3.1.1. Thanks to Gary Gregory.
o Update tests from org.apache.commons:commons-lang3 3.10 to 3.11. Thanks to Gary
Gregory.
o Update commons-parent from 50 to 51 #129. Thanks to Gary Gregory.
o Update actions/checkout from v1 to v2.3.1 #126. Thanks to Gary Gregory.
o Update junit-pioneer from 0.6.0 to 0.8.0, #127, #135. Thanks to Gary Gregory.
o Update mockito-core from 3.3.3 to 3.5.9 #128, #133, #145, #149, #151. Thanks to
Gary Gregory.
o Update spotbugs from 4.0.6 to 4.1.1 #134. Thanks to Dependabot.
o Update junit-pioneer from 0.8.0 to 0.9.0 #138. Thanks to Dependabot.
o Update actions/checkout from v2.3.1 to v2.3.2 #140. Thanks to Dependabot.
o Update actions/setup-java from v1.4.0 to v1.4.2 #141, #148. Thanks to Dependabot.
https://commons.apache.org/proper/commons-io/
Have fun!
-Apache Commons Team
==============================================================================
Apache Commons IO
Version 2.7
Release Notes
INTRODUCTION:
==============================================================================
Apache Commons IO Version 2.7
==============================================================================
Java 8 required.
New features:
o Adding the CircularBufferInputStream, and the PeekableInputStream.
o IO-553: Add org.apache.commons.io.FilenameUtils.isIllegalWindowsFileName(char).
o IO-577: Add readers to filter out given characters: CharacterSetFilterReader and
CharacterFilterReader. Thanks to Gary Gregory.
o IO-594: Add IOUtils copy methods with java.lang.Appendable as the target. Thanks
to Gary Gregory.
o IO-605: Add class CanExecuteFileFilter. Thanks to Gary Gregory.
o IO-578: Support java.nio.Path and non-default file systems for
ReversedLinesFileReader (#62). Thanks to Mark Chesney.
o IO-608: Add a convenience NullPrintStream. Thanks to Gary Gregory.
o IO-612: Add class TeeReader. Thanks to Rob Spoor, Gary Gregory.
o IO-613: Add classes ClosedReader and CloseShieldReader. #84. Thanks to Rob
Spoor, Gary Gregory.
o IO-614: Add classes TaggedWriter, ClosedWriter and BrokenWriter. #86. Thanks to
Rob Spoor.
o IO-615: Add classes TeeWriter, FilterCollectionWriter, ProxyCollectionWriter,
IOExceptionList, IOIndexedException. Thanks to Gary Gregory, Rob Spoor.
o IO-616: Add class AppendableWriter. #87. Thanks to Rob Spoor.
o IO-617: Add class CloseShieldWriter. #83. Thanks to Rob Spoor, Gary Gregory.
o IO-618: Add classes Added TaggedReader, ClosedReader and BrokenReader. #85.
Thanks to Rob Spoor.
o IO-619: Support sub sequences in CharSequenceReader. #91. Thanks to Rob Spoor.
o IO-631: Add a CountingFileVisitor (as the basis for a forthcoming
DeletingFileVisitor). Thanks to Gary Gregory.
o IO-632: Add PathUtils for operations on NIO Path. Thanks to Gary Gregory.
o IO-633: Add DeletingFileVisitor. Thanks to Gary Gregory.
o IO-635: Add org.apache.commons.io.IOUtils.close(Closeable). Thanks to Gary
Gregory.
o IO-636: Add and reuse org.apache.commons.io.IOUtils.closeQuitely(Closeable,
Consumer<IOException>).
Add and reuse org.apache.commons.io.IOUtils.close(Closeable,
IOConsumer<IOException>). Thanks to Gary Gregory.
o IO-645: Add org.apache.commons.io.file.PathUtils.fileContentEquals(Path, Path,
OpenOption...). Thanks to Gary Gregory.
o IO-458: Add a SequenceReader similar to java.io.SequenceInputStream. Thanks to
Gary Gregory, Joshua Gitlin.
o IO-648: Implement directory content equality. 100#. Thanks to Gary Gregory.
o IO-648: Refactor ByteArrayOutputStream into synchronized and unsynchronized
versions #108. Thanks to Adam Retter, Alex Herbert, Gary Gregory.
o IO-662: Refactor ByteArrayOutputStream into synchronized and unsynchronized
versions #108. Thanks to Adam Retter, Gary Gregory.
Fixed Bugs:
o IO-589: Some tests fail if the base path contains a space.
o IO-582: Make methods in ObservableInputStream.Obsever public. Thanks to Bruno
Palos.
o IO-535: Thread bug in FileAlterationMonitor#stop(int). Thanks to Svetlin Zarev,
Anthony Raymond.
o IO-557: Perform locale independent upper case conversions. Thanks to luccioman.
o IO-570: Missing Javadoc in FilenameUtils causing Travis-CI build to fail. Thanks
to Pranet Verma.
o IO-571: Remove redundant isDirectory() check in
org.apache.commons.io.FileUtils.listFilesAndDirs(File, IOFileFilter, IOFileFilter).
Thanks to pranet.
o IO-559: FilenameUtils.normalize now verifies hostname syntax in UNC path.
o IO-554: FileUtils.copyToFile(InputStream source, File destination) should not
close input stream. Thanks to Michele Mariotti.
o IO-604: FileUtils.doCopyFile(File, File, boolean) can throw
ClosedByInterruptException. Thanks to Gary Gregory.
o IO-625: Corrected misleading exception message for
FileUtils.copyDirectoryToDirectory. Thanks to Mikko Maunu.
o IO-626: A mistake in the FilenameUtils.concat()'s Javadoc about an absolute
path. Thanks to Yuji Konishi.
o IO-640: NPE in org.apache.commons.io.IOUtils.contentEquals(InputStream,
InputStream) when only one input is null. Thanks to Gary Gregory.
o IO-641: NPE in org.apache.commons.io.IOUtils.contentEquals(Reader, Reader) when
only one input is null. Thanks to Gary Gregory.
o IO-643: NPE in org.apache.commons.io.IOUtils.contentEqualsIgnoreEOL(Reader,
Reader) when only one input is null. Thanks to Gary Gregory.
o IO-644: NPE in org.apache.commons.io.FileUtils.contentEqualsIgnoreEOL(File,
File) when only one input is null. Thanks to Gary Gregory.
o IO-664: org.apache.commons.io.FileUtils.copyURLToFile(*) open but do not close
streams. Thanks to Gary Gregory.
Changes:
o IO-572: Refactor duplicate code in org.apache.commons.io.FileUtils. Thanks to
Pranet Verma.
o IO-580: Update org.apache.commons.io.FilenameUtils.isExtension(String, String[])
to use var args.
o IO-701: Make array declaration in ThresholdingOutputStream consistent with other
array declarations in the library #77. Thanks to Raymond Tan.
o IO-607: Update from Java 7 to Java 8. Thanks to Gary Gregory.
o IO-610: Remove throws IOException in method isSymlink() #80. Thanks to
Sebastian.
o IO-628: Migration to JUnit Jupiter #97. Thanks to Allon Mureinik.
o IO-630: Deprecate
org.apache.commons.io.output.NullOutputStream.NullOutputStream() in favor of
org.apache.commons.io.output.NullOutputStream.NULL_OUTPUT_STREAM. Thanks to Gary
Gregory.
o IO-629: FileUtils#forceDelete should use Files#delete rather than File#delete so
exception messages includes reason for failure. Thanks to Ian Springer, Ian
Springer, Gary Gregory.
o IO-634: Make getCause synchronized and use a Deque instead of a Stack #64.
Thanks to V�clav Haisman, Bruno P. Kinoshita, Gary Gregory.
o Update tests from Apache Commons Lang 3.9 to 3.10. Thanks to Gary
Gregory.
o Update tests org.junit-pioneer:junit-pioneer 0.3.0 -> 0.6.0. Thanks to
Gary Gregory.
o Update tests org.junit.jupiter:junit-jupiter 5.5.2 -> 5.6.2. Thanks to
Gary Gregory.
o Update tests org.mockito:mockito-core 3.0.0 -> 3.3.3. Thanks to Gary
Gregory.
o IO-666: Normalize internal buffers to 8192 bytes. Thanks to Gary Gregory.
o IO-665: Ensure that passing a null InputStream results in NPE with tests #112.
Thanks to Otto Fowler, Gary Gregory.
o commons.jacoco.version 0.8.4 -> 0.8.5. Thanks to Gary Gregory.
o com.github.siom79.japicmp:japicmp-maven-plugin 0.14.1 -> 0.14.3.
Thanks to Gary Gregory.
o IO-667: Add functional interfaces IOFunction and IOSupplier #110. Thanks to Adam
Retter, Gary Gregory.
o Support sub sequences in CharSequenceReader #91. Thanks to Rob Spoor,
Gary Gregory.
o Remove deprecated sudo setting. #113. Thanks to dengliming.
https://commons.apache.org/proper/commons-io/
Have fun!
-Apache Commons Team
==============================================================================
Apache Commons IO Version 2.6
==============================================================================
INTRODUCTION:
DEPRECATIONS
============
All closeQuietly overloads in org.apache.commons.io.IOUtils have been
deprecated. Use the try-with-resources statement or handle suppressed
exceptions manually.
Automatic-Module-Name: org.apache.commons.io
This should make it possible to use Commons IO 2.6 as a module in the Java 9
module system. For more information see the corresponding issue:
https://issues.apache.org/jira/browse/IO-551
Building Commons IO 2.6 should work out of the box with the latest Java 9
release. Please report any Java 9 related issues at:
https://issues.apache.org/jira/browse/IO
NEW FEATURES
============
FIXED BUGS
==========
CHANGES
=======
REMOVED
=======
==============================================================================
Apache Commons IO Version 2.5
==============================================================================
New features and bug fixes.
Changes in this version include:
New features:
o IO-487: Add ValidatingObjectInputStream for controlled deserialization
o IO-471: Support for additional encodings in ReversedLinesFileReader Thanks to
Leandro Reis.
o IO-425: Setter method for threshold on ThresholdingOutputStream Thanks to Craig
Swank.
o IO-406: Introduce new class AppendableOutputStream Thanks to Niall Pemberton.
o IO-459: Add WindowsLineEndingInputStream and UnixLineEndingInputStream. Thanks
to Kristian Rosenvold.
o IO-457: Add a BoundedReader, a wrapper that can be used to constrain access
to an underlying stream when used with mark/reset -
to avoid overflowing the mark limit of the underlying buffer. Thanks to
Kristian Rosenvold.
o IO-426: Add API IOUtils.closeQuietly(Closeable...)
o IO-410: Readfully() That Returns A Byte Array Thanks to Beluga Behr.
o IO-395: Overload IOUtils buffer methods to accept buffer size Thanks to Beluga
Behr.
o IO-382: Chunked IO for large arrays.
Added writeChunked(byte[], OutputStream) and writeChunked(char[] Writer)
Added ChunkedOutputStream, ChunkedWriter
o IO-233: Add Methods for Buffering Streams/Writers To IOUtils
Added overloaded buffer() methods - see also IO-330
o IO-330: IOUtils#toBufferedOutputStream/toBufferedWriter to conditionally wrap
the output
Added overloaded buffer() methods - see also IO-233
o IO-381: Add FileUtils.copyInputStreamToFile API with option to leave the source
open.
See copyInputStreamToFile(final InputStream source, final File destination,
boolean closeSource)
o IO-379: CharSequenceInputStream - add tests for available()
Fix code so it really does reflect a minimum available.
o IO-346: Add ByteArrayOutputStream.toInputStream()
o IO-341: A constant for holding the BOM character (U+FEFF)
o IO-361: Add API FileUtils.forceMkdirsParent().
o IO-360: Add API Charsets.requiredCharsets().
o IO-359: Add IOUtils.skip and skipFully(ReadableByteChannel, long). Thanks to
yukoba.
o IO-358: Add IOUtils.read and readFully(ReadableByteChannel, ByteBuffer buffer).
Thanks to yukoba.
o IO-353: Add API IOUtils.copy(InputStream, OutputStream, int) Thanks to ggregory.
o IO-349: Add API with array offset and length argument to
FileUtils.writeByteArrayToFile. Thanks to scop.
o IO-348: Missing information in IllegalArgumentException thrown by
org.apache.commons.io.FileUtils#validateListFilesParameters. Thanks to plcstpierre.
o IO-345: Supply a hook method allowing Tailer actively determining stop
condition. Thanks to mkresse.
o IO-437: Make IOUtils.EOF public and reuse it in various classes.
Fixed Bugs:
o IO-446: adds an endOfFileReached method to the TailerListener Thanks to Jeffrey
Barrus.
o IO-484: FilenameUtils should handle embedded null bytes Thanks to Philippe
Arteau.
o IO-481: Changed/Corrected algorithm for waitFor
o IO-428: BOMInputStream.skip returns wrong count if stream contains no BOM Thanks
to Stefan Gmeiner.
o IO-488: FileUtils.waitFor(...) swallows thread interrupted status Thanks to
Bj�rn Buchner.
o IO-452: Support for symlinks with missing target. Added support for JDK7 symlink
features when present Thanks to David Standish.
o IO-453: Regression in FileUtils.readFileToString from 2.0.1 Thanks to Steven
Christou.
o IO-451: ant test fails - resources missing from test classpath Thanks to David
Standish.
o IO-435: Document that FileUtils.deleteDirectory, directoryContains and
cleanDirectory
may throw an IllegalArgumentException in case the passed directory does
not
exist or is not a directory. Thanks to Dominik Stadler.
o IO-424: Javadoc fixes, mostly to appease 1.8.0 Thanks to Ville Skytt�.
o IO-389: FileUtils.sizeOfDirectory can throw IllegalArgumentException Thanks to
Austin Doupnik.
o IO-390: FileUtils.sizeOfDirectoryAsBigInteger can overflow.
Ensure that recursive calls all use BigInteger
o IO-385: FileUtils.doCopyFile can potentially loop for ever
Exit loop if no data to copy
o IO-383: FileUtils.doCopyFile caches the file size; needs to be documented
Added Javadoc; show file lengths in exception message
o IO-380: FileUtils.copyInputStreamToFile should document it closes the input
source Thanks to claudio_ch.
o IO-279: Tailer erroneously considers file as new.
Fix to use file.lastModified() rather than System.currentTimeMillis()
o IO-356: CharSequenceInputStream#reset() behaves incorrectly in case when buffer
size is not dividable by data size.
Fix code so skip relates to the encoded bytes; reset now re-encodes the
data up to the point of the mark
o IO-368: ClassLoaderObjectInputStream does not handle primitive typed members
o IO-314: Deprecate all methods that use the default encoding
o IO-338: When a file is rotated, finish reading previous file prior to starting
new one
o IO-354: Commons IO Tailer does not respect UTF-8 Charset.
o IO-323: What should happen in FileUtils.sizeOf[Directory] when an overflow takes
place?
Added Javadoc.
o IO-372: FileUtils.moveDirectory can produce misleading error message on failiure
o IO-362: IOUtils.contentEquals* methods returns false if input1 == input2, should
return true. Thanks to mmadson, ggregory.
o IO-357: [Tailer] InterruptedException while the thread is sleeping is silently
ignored Thanks to mortenh.
o IO-352: Spelling fixes. Thanks to scop.
o IO-436: Improper Javadoc comment for FilenameUtils.indexOfExtension. Thanks to
christoph.schneegans.
Changes:
o IO-433: Converted all testcases to JUnit 4
o IO-466: Added testcase to show this was fixed with IO-423
o IO-479: Correct exception message in FileUtils.getFile(File, String...) Thanks
to Zhouce Chen.
o IO-465: Update to JUnit 4.12 Thanks to based2.
o IO-462: IOExceptionWithCause no longer needed
o IO-422: Deprecate Charsets Charset constants in favor of Java 7's
java.nio.charset.StandardCharsets
o IO-239: Convert IOCase to a Java 1.5+ Enumeration
[N.B. this is binary compatible]
o IO-328: getPrefixLength returns null if filename has leading slashes
Javadoc: add examples to show correct behavior; add unit tests
o IO-299: FileUtils.listFilesAndDirs includes original dir in results even when it
doesn't match filter
Javadoc: clarify that original dir is included in the results
o IO-375: FilenameUtils.splitOnTokens(String text) check for '**' could be
simplified
o IO-374: WildcardFileFilter ctors should not use null to mean IOCase.SENSITIVE
when delegating to other ctors
==============================================================================
Apache Commons IO Version 2.4
==============================================================================
New features:
o IO-269: Tailer locks file from deletion/rename on Windows. Thanks to
sebb.
o IO-333: Export OSGi packages at version 1.x in addition to 2.x. Thanks
to fmeschbe.
o IO-320: Add XmlStreamReader support for UTF-32. Thanks to ggregory.
o IO-331: BOMInputStream wrongly detects UTF-32LE_BOM files as
UTF-16LE_BOM files in method getBOM(). Thanks to ggregory.
o IO-327: Add byteCountToDisplaySize(BigInteger). Thanks to ggregory.
o IO-326: Add new FileUtils.sizeOf[Directory] APIs to return BigInteger.
Thanks to ggregory.
o IO-325: Add IOUtils.toByteArray methods to work with URL and URI. Thanks
to raviprak.
o IO-324: Add missing Charset sister APIs to method that take a String
charset name. Thanks to raviprak.
Fixed Bugs:
o IO-336: Yottabyte (YB) incorrectly defined in FileUtils. Thanks to
rleavelle.
o IO-279: Tailer erroneously considers file as new. Thanks to Sergio
Bossa, Chris Baron.
o IO-335: Tailer#readLines - incorrect CR handling.
o IO-334: FileUtils.toURLs throws NPE for null parameter; document the
behavior.
o IO-332: Improve tailer's reading performance. Thanks to liangly.
o IO-279: Improve Tailer performance with buffered reads (see IO-332).
o IO-329: FileUtils.writeLines uses unbuffered IO. Thanks to tivv.
o IO-319: FileUtils.sizeOfDirectory follows symbolic links. Thanks to
raviprak.
==============================================================================
Apache Commons IO Version 2.3
==============================================================================
New features:
o IO-322: Add and use class Charsets. Thanks to ggregory.
o IO-321: ByteOrderMark UTF_32LE is incorrect. Thanks to ggregory.
o IO-318: Add Charset sister APIs to method that take a String charset name.
Thanks to ggregory.
==============================================================================
Apache Commons IO Version 2.2
==============================================================================
New features:
o Add IOUTils.toBufferedReader(Reader) Issue: IO-313. Thanks to ggregory.
o Allow applications to provide buffer (or size) for copyLarge methods. Issue: IO-
308. Thanks to Manoj Mokashi.
o New copyLarge() method in IOUtils that takes additional offset, length arguments
Issue: IO-305. Thanks to Manoj Mokashi.
o Use terabyte (TB), petabyte (PB) and exabyte (EB) in
FileUtils.byteCountToDisplaySize(long size) Issue: IO-287. Thanks to Ron Kuris,
Gary Gregory.
o FileUtils.listFiles() doesn't return directories Issue: IO-173. Thanks to Marcos
Vin�cius da Silva.
o CharSequenceInputStream to efficiently stream content of a CharSequence Issue:
IO-297. Thanks to Oleg Kalnichevski.
o The second constructor of Tailer class does not pass 'delay' to the third one
Issue: IO-304. Thanks to liangly.
o TeeOutputStream does not call branch.close() when main.close() throws an
exception Issue: IO-303. Thanks to fabian.barney.
o ArrayIndexOutOfBoundsException in BOMInputStream when reading a file without BOM
multiple times Issue: IO-302. Thanks to jsteuerwald, detinho.
o Add IOUtils.closeQuietly(Selector) necessary Issue: IO-301. Thanks to
kaykay.unique.
o IOUtils.closeQuietly() should take a ServerSocket as a parameter Issue: IO-292.
Thanks to sebb.
o Add read/readFully methods to IOUtils Issue: IO-290. Thanks to sebb.
o Supply a ReversedLinesFileReader Issue: IO-288. Thanks to Georg Henzler.
o Add new function FileUtils.directoryContains. Issue: IO-291. Thanks to ggregory.
o FileUtils.contentEquals and IOUtils.contentEquals - Add option to ignore "line
endings"
Added contentEqualsIgnoreEOL methods to both classes Issue: IO-275. Thanks
to CJ Aspromgos.
Fixed Bugs:
o IOUtils.read(InputStream/Reader) ignores the offset parameter Issue: IO-311.
Thanks to Robert Muir.
o CharSequenceInputStream(CharSequence s, Charset charset, int bufferSize) ignores
bufferSize Issue: IO-312.
o FileUtils.moveDirectoryToDirectory removes source directory if destination is a
subdirectory Issue: IO-300.
o ReaderInputStream#read(byte[] b, int off, int len) should check for valid
parameters Issue: IO-307.
o ReaderInputStream#read(byte[] b, int off, int len) should always return 0 for
length == 0 Issue: IO-306.
o "FileUtils#deleteDirectoryOnExit(File)" does not work Issue: IO-276. Thanks to
nkami.
o BoundedInputStream.read() treats max differently from
BoundedInputStream.read(byte[]...) Issue: IO-273. Thanks to sebb.
o Various methods of class 'org.apache.commons.io.FileUtils' incorrectly suppress
'java.io.IOException' Issue: IO-298. Thanks to Christian Schulte.
Changes:
o ReaderInputStream optimization: more efficient reading of small chunks of data
Issue: IO-296. Thanks to Oleg Kalnichevski.
==============================================================================
Apache Commons IO Version 2.1
==============================================================================
New features:
o Use standard Maven directory layout Issue: IO-285. Thanks to ggregory.
o Add IOUtils API toString for URL and URI to get contents Issue: IO-284. Thanks
to ggregory.
o Add API FileUtils.copyFile(File input, OutputStream output) Issue: IO-282.
Thanks to ggregory.
o FileAlterationObserver has no getter for FileFilter Issue: IO-262.
o Add FileUtils.getFile API with varargs parameter Issue: IO-261.
o Add new APPEND parameter for writing string into files Issue: IO-182.
o Add new read method "toByteArray" to handle InputStream with known size. Issue:
IO-251. Thanks to Marco Albini.
Fixed Bugs:
o Dubious use of mkdirs() return code Issue: IO-280. Thanks to sebb.
o ReaderInputStream enters infinite loop when it encounters an unmappable character
Issue: IO-277.
o FileUtils.moveFile() Javadoc should specify FileExistsException thrown Issue:
IO-264.
o ClassLoaderObjectInputStream does not handle Proxy classes Issue: IO-260.
o Tailer returning partial lines when reaching EOF before EOL Issue: IO-274.
Thanks to Frank Grimes.
o FileUtils.copyFile() throws IOException when copying large files to a shared
directory (on Windows) Issue: IO-266. Thanks to Igor Smereka.
o FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible
files.
Improve coverage by also looking for hidden files. Issue: IO-263. Thanks
to Gil Adam.
Changes:
o FileAlterationMonitor.stop(boolean allowIntervalToFinish) Issue: IO-259.
==============================================================================
Apache Commons IO Package 2.0.1
==============================================================================
==============================================================================
Apache Commons IO Package 2.0
==============================================================================
Compatibility with 1.4
----------------------
Binary compatible - Yes
- IOUtils
- write(StringBuffer, Writer) in favour of write(CharSequence, Writer)
- write(StringBuffer, OutputStream) in favour of write(CharSequence,
OutputStream)
- write(StringBuffer, OutputStream, String) in favour of write(CharSequence,
OutputStream, String)
- FileFilterUtils
- andFileFilter(IOFileFilter, IOFileFilter) in favour of and(IOFileFilter...)
- orFileFilter(IOFileFilter, IOFileFilter) in favour of or(IOFileFilter...)
==============================================================================
Apache Commons IO Version 1.4
==============================================================================
Commons IO 1.4 introduces four new implementations which depend on Java 4 features
(CharSequenceReader, FileWriterWithEncoding, IOExceptionWithCause and
RegexFileFilter).
It has been built with the JDK source and target options set to Java 1.3 and,
except for
those implementations, can be used with Java 1.3 (see IO IO-127).
- 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]
- 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]
- 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
- IOCase
- Add a compare method to IOCase [IO-144]
==============================================================================
Apache Commons IO Version 1.3.2
==============================================================================
Source compatible - No
See [IO-113]
- Some tests, which are implicitly assuming a Unix-like file system, are
now skipped on Windows. [IO-115]
- EndianUtils
- Both readSwappedUnsignedInteger(...) methods could return negative
numbers due to int/long casting. [IO-117]
- FileUtils
- NPE in openOutputStream(File) when file has no parent in path [IO-112]
- readFileToString(File) is not static [IO-113]
==============================================================================
Apache Commons IO Version 1.3.1
==============================================================================
Source compatible - No
See [IO-113]
- FileUtils
- NPE in openOutputStream(File) when file has no parent in path [IO-112]
- readFileToString(File) is not static [IO-113]
==============================================================================
Apache Commons IO Version 1.3
==============================================================================
- FileSystemUtils.freeSpace/freeSpaceKb [IO-83]
- These should now work on AIX and HP-UX
- FileSystemUtils.freeSpace/freeSpaceKb [IO-90]
- Avoid infinite looping in Windows
- Catch more errors with nice messages
- FileSystemUtils.freeSpace [IO-91]
- This is now documented not to work on SunOS 5
- FileSystemUtils [IO-93]
- Fixed resource leak leading to 'Too many open files' error
- Previously did not destroy Process instances (as JDK Javadoc is so poor)
- http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4801027
- FileUtils.touch [IO-100]
- The touch method previously gave no indication when the file could not
be touched successfully (such as due to access restrictions) - it now
throws an IOException if the last modified date cannot be changed
- FileCleaner
- This now handles the situation where an error occurs when deleting the file
- IOUtils.copy [IO-84]
- Copy methods could return inaccurate byte/char count for large streams
- The copy(InputStream, OutputStream) method now returns -1 if the count is
greater than an int
- The copy(Reader, Writer) method now throws now returns -1 if the count is
greater than an int
- Added a new copyLarge(InputStream, OutputStream) method that returns a long
- Added a new copyLarge(Reader, Writer) method that returns a long
- CountingInputStream/CountingOutputStream [IO-84]
- Methods were declared as int thus the count was innacurate for large streams
- new long based methods getByteCount()/resetByteCount() added
- existing methods changed to throw an exception if the count is greater than an
int
- FileBasedTestCase
- Fixed bug in compare content methods identified by GNU classpath
- EndianUtils.writeSwappedLong(InputStream) [IO-102]
- The return of input.read(byte[]) was not being checked to ensure all 8 bytes
were read
- IOCase
- New class/enumeration for case-sensitivity control
- FilenameUtils
- New methods to handle case-sensitivity
- wildcardMatch - new method that has IOCase as a parameter
- equals - new method that has IOCase as a parameter
- FileUtils.openOutputStream [IO-107]
- new method to open a FileOutputStream, creating parent directories if required
- FileUtils.touch
- FileUtils.copyURLToFile
- FileUtils.writeStringToFile
- FileUtils.writeByteArrayToFile
- FileUtils.writeLines
- enhanced to create parent directories if required
- FileUtils.openInputStream [IO-107]
- new method to open a FileInputStream, providing better error messages than the
JDK
- FileUtils.isFileOlder
- new methods to check if a file is older (i.e. isFileOlder()) - counterparts
to the existing isFileNewer() methods.
- FileUtils.checksum, FileUtils.checksumCRC32
- new methods to create a checksum of a file
- FileUtils.copyFileToDirectory [IO-104]
- new variant that optionally retains the file date
- FileDeleteStrategy
- FileCleaner [IO-56,IO-70]
- FileDeleteStrategy is a strategy for handling file deletion
- This can be used as a calback in FileCleaner
- Together these allow FileCleaner to do a forceDelete to kill directories
- FileCleaner.exitWhenFinished [IO-99]
- A new method that allows the internal cleaner thread to be cleanly terminated
- WildcardFileFilter
- Replacement for WildcardFilter
- Accepts both files and directories
- Ability to control case-sensitivity
- NameFileFilter
- Ability to control case-sensitivity
- FileFileFilter
- New IOFileFilter implementation
- Accepts files where File.isFile() is true
- In other words it filters out directories
- Singleton instance provided (FILE)
- CanReadFileFilter
- New IOFileFilter implementation
- Accepts files where File.canRead() is true
- Singleton instances provided (CAN_READ/CANNOT_READ/READ_ONLY)
- CanWriteFileFilter
- New IOFileFilter implementation
- Accepts files where File.canWrite() is true
- Singleton instances provided (CAN_WRITE/CANNOT_WRITE)
- HiddenFileFilter
- New IOFileFilter implementation
- Accepts files where File.isHidden() is true
- Singleton instances provided (HIDDEN/VISIBLE)
- EmptyFileFilter
- New IOFileFilter implementation
- Accepts files or directories that are empty
- Singleton instances provided (EMPTY/NOT_EMPTY)
- TrueFileFilter/FalseFileFilter/DirectoryFileFilter
- New singleton instance constants (TRUE/FALSE/DIRECTORY)
- The new constants are more Java 5 friendly with regards to static imports
(whereas if everything uses INSTANCE, then they just clash)
- The old INSTANCE constants are still present and have not been deprecated
- FileFilterUtils.sizeRangeFileFilter
- new sizeRangeFileFilter(long minimumSize, long maximumSize) method which
creates a filter that accepts files within the specified size range.
- FileFilterUtils.makeDirectoryOnly/makeFileOnly
- two new methods that decorate a file filter to make it apply to
directories only or files only
- NullWriter
- New writer that acts as a sink for all data, as per /dev/null
- NullInputStream
- New input stream that emulates a stream of a specified size
- NullReader
- New reader that emulates a reader of a specified size
- ByteArrayOutputStream [IO-97]
- Performance enhancements
==============================================================================
Apache Commons IO Version 1.2
==============================================================================
- FileUtils.read*
Increase certainty that files are closed in case of error
- LockableFileWriter
Locking mechanism was broken and only provided limited protection [38942]
File deletion and locking in case of constructor error was broken
- FileSystemUtils.freeSpaceKb(drive)
New method that unifies result to be in kilobytes [38574]
- FileUtils.contentEquals(File,File)
Performance improved by adding length and file location checking
- FileUtils.iterateFiles
Two new method to provide direct access to iterators over files
- FileUtils.lineIterator
IOUtils.lineIterator
New methods to provide an iterator over the lines in a file [38083]
- FileUtils.copyDirectoryToDirectory
New method to copy a directory to within another directory [36315]
==============================================================================
Apache Commons IO Version 1.1
==============================================================================
- LockableFileWriter
Improved validation and now create directories if necesssary
- CountingInputStream [33336]
Fixed bug that caused the count to reduce by one at the end of the stream
- NullOutputStream [33481]
Remove unnecessary synchronization
- FileUtils [36801]
Previously threw NPE when listing files in a security restricted directory
Now throw IOException with a better message
- FileUtils - writeStringToFile()
Null encoding now correctly uses the platform default
- IOUtils - toByteArray(Reader,encoding)
Handles encodings when reading to a byte array
- IOUtils - write(...)
Write data to a stream/writer (moved from CopyUtils with better null handling)
- IOUtils - copy(...)
Copy data between streams (moved from CopyUtils with better null handling)
- IOUtils - contentEquals(Reader,Reader)
Method to compare the contents of two readers
- FileUtils - toFiles(URL[])
Converts an array of URLs to an array of Files
- FileUtils - readFileToByteArray(File)
Reads an entire file into a byte array
- FileUtils - writeByteArrayToFile(File,byte[])
Writes a byte array to a file
- FileUtils - writeLines(File,encoding,List)
writeLines(File,encoding,List,lineEnding)
Writes a collection to a file line by line
- FileUtils - EMPTY_FILE_ARRAY
Constant for an empty array of File objects
- WildcardFilter [31115]
New filter that can match using wildcard file names
- FileFilterUtils - makeSVNAware(IOFileFilter)
New method, like makeCVSAware, that ignores Subversion source control
directories
- ClassLoaderObjectInputStream
An ObjectInputStream that supports a ClassLoader
- DeferredFileOutputStream [34142]
Performance optimizations avoiding double buffering
==============================================================================
Feedback
==============================================================================