Apache Commons IO Release Notes IOUtils.toByteArray size validation does not match documentation. Fix Javadoc links to the JRE Javadoc 8. FileWriterWithEncoding for an existing file no longer truncates the file. #251. A null Charset or Charset name in FileWriterWithEncoding constructors uses the default Charset. Fix usage of assertNotNull #269. FilenameUtils directoryContains() should handle files with the same prefix #217. Drop unnecessary casts and conversions #267. FileUtils.moveToDirectory() exception documentation and exception message error. ThreadMonitor.sleep(Duration) ignores nanoseconds. Fix Javadoc in ThreadMonitor#run() method. #273. FileUtils.listFiles() does not list matching files if File parameter is a symbolic link. Fix typo in Javadocs for FileUtils#convertFileCollectionToFileArray() #276. Avoid Code Duplication: Reuse Sleep from ThreadMonitor #66. FileUtils.iterateFiles also lists directories. Wrong exception message in FileUtils.setLastModified(File, File). Infinite loop in ReaderInputStream instead of throwing exception for CodingErrorAction.REPORT. ReaderInputStream enter infinite loop for too small buffer sizes. Infinite loop in CharSequenceInputStream.read for 4-byte characters with UTF-8 and 3-byte buffer. PathUtils.setReadOnly(Path, boolean, LinkOption...) should add READ_* file attributes when using POSIX. PathUtils.setReadOnly(Path, boolean, LinkOption...) readOnly argument is always assumed true on POSIX. Prevent IllegalArgumentExceptions in BrokenInputStream/Reader/OutputStream/Writer #278. FileUtils.copyURLToFile(URL, File, int, int) leaks its URLConnection. Called by FileUtils.copyURLToFile(URL, File). Fixed ReaderInputStream not calling CharsetEncoder.flush issue #283. Minor changes #287. Update FileWriterWithEncoding to extend ProxyWriter #296. Initialize the message of an IOExceptionList to a default if null. When deleting symlinks, File/PathUtils.deleteDirectory() changes file permissions of the target. ReaderInputStream maps null Charset, Charset name, and CharsetEncoder to the platform default instead of throwing a NullPointerException. CharSequenceInputStream maps null Charset and Charset name to the platform default instead of throwing a NullPointerException. WriterOutputStream maps null Charset, Charset name, and CharsetEncoder name to the platform default instead of throwing a NullPointerException. FileUtils.copyURLToFile should create target parent directories and overwrite target file #319. Fix incorrect FilenameUtils Javadoc for null bytes #310. Change to uppercase variable constant. #323. IOCase.isCaseSensitive(IOCase) result is backward #325. Deprecate PathUtils.NOFOLLOW_LINK_OPTION_ARRAY in favor of noFollowLinkOptionArray(). Improve ReaderInputStream documentation #291. Fix misleading comments in FileFilterTest #334. Add missing javadoc for exceptions thrown for invalid arguments #339. FileFilterTest minor fixes #340. IOUtils.write() throws OutOfMemoryError/NegativeArraySizeException while writing big strings #343. Add reserved Windows file names CONIN$ and CONOUT$ to FileSystem #355. RegexFileFilter is no longer Serializable. [Javadoc] FileFilterUtils doc does not match impl: missing some file filters. FileSystem.WINDOWS.isReservedFileName doesn't check for file extension. Confusing Javadoc on IOUtils#resourceToURL() and other resource* methods. FileUtils.copyFile methods throw an unnecessary "Failed to copy full contents from" exception. Pick up Javadoc from super for override write() methods in AbstractByteArrayOutputStream and ByteArrayOutputStream. Fix minor typos #367. Fix parameters to requireNonNull call in DeferredOutputSteam #368. Fix PathUtils.copyFileToDirectory(URL,Path,CopyOption[]). FileUtils.doCopyFile uses different methods to check the file sizes. Fix typos #375. FilenameUtils.normalize javadoc and tests #383. Better docs in IOUtils and IOUtils.byteArray(int size) #374. SequenceReader should close readers when its close method is called #391. Add GitHub coverage.yml. Add MemoryMappedFileInputStream #215. Add BrokenReader.INSTANCE. Add UncheckedBufferedReader. Add UncheckedFilterReader. Add UncheckedFilterWriter. Add StringInputStream. Add UncheckedFilterInputStream. Add UncheckedFilterOutputStream. Add BrokenInputStream.INSTANCE. Add ClosedInputStream.INSTANCE and deprecate CLOSED_INPUT_STREAM. Add ClosedReader.INSTANCE and deprecate CLOSED_READER. Add BrokenWriter.INSTANCE. Add ClosedOutputStream.INSTANCE and deprecate CLOSED_OUTPUT_STREAM. Add ClosedWriter.INSTANCE and deprecate CLOSED_WRITER. Add NullOutputStream.INSTANCE and deprecate NULL_OUTPUT_STREAM. Add NullPrintStream.INSTANCE and deprecate NULL_PRINT_STREAM. Add NullWriter.INSTANCE and deprecate NULL_WRITER. Add NullInputStream.INSTANCE. Add NullReader.INSTANCE. Add PathUtils.readString(Path, Charset). Add FileUtils.newOutputStream(File, boolean). Add PathUtils.newOutputStream(Path, boolean). Add UncheckedAppendable. Add and reuse UncheckedIOExceptions. Add PathUtils.getTempDirectory(). Add FileSystem.getNameSeparator(). Add FileSystem.normalizeSeparators(). Add PathUtils.isNewer(Path, FileTime, LinkOption...). Add PathUtils.isNewer(Path, Instant, LinkOption...). Add AgeFileFilter.AgeFileFilter(Instant). Add AgeFileFilter.AgeFileFilter(Instant, boolean). Add FileUtils.lastModifiedFileTime(File). Add FileTimes. Add PathUtils.waitFor(Path, Duration, LinkOption...). Add org.apache.commons.io.input.Tailer.getDelayDuration(). Add FileUtils.current(). Add and use PathUtils.setLastModifiedTime(Path) for more precision. Add and use PathUtils.setLastModifiedTime(Path, Path) for more precision. Add and use PathUtils.isNewer(Path, ChronoZonedDateTime, LinkOption...) for more precision. Add and use PathUtils.isNewer(Path, Path) for more precision. Add and use FileUtils.isNewer(File, FileTime) for more precision. Add and use PathUtils.isOlder(Path, FileTime, LinkOption...). Add and use PathUtils.isOlder(Path, Instant, LinkOption...). Add and use PathUtils.isOlder(Path, long, LinkOption...). Add and use PathUtils.isOlder(Path, Path). Add and use PathUtils.sizeOf(Path). Add and use PathUtils.sizeOfAsBigInteger(Path). Add and use PathUtils.sizeOfDirectory(Path). Add and use PathUtils.sizeOfDirectoryAsBigInteger(Path). Add and use IOCase.value(IOCase, IOCase). Add Tailer.Tailable interface to allow tailing of remote files for example using jCIFS. Add and use RandomAccessFileMode. Add PathUtils.writeString(Path, CharSequence, Charset, OpenOption...). Add PathUtiFiles.getFileAttributeView() shorthands: - PathUtils.getAclFileAttributeView(Path, LinkOption...) - PathUtils.getDosFileAttributeView(Path, LinkOption...) - PathUtils.getPosixFileAttributeView(Path, LinkOption...) Make commons-io a JPMS module by adding module-info.class. Add IOUtils method to copy output stream to input stream #281. Add PathUtils.isPosix(Path, LinkOption...). #290 Add PathUtils.readAttributes(Path, Class, LinkOption...). #290 Add IOExceptionList.checkEmpty(List, Object). Add IOBiConsumer, IOTriConsumer, IOComparator, IOUnaryOperator, IOBinaryOperator. Add and reuse IOConsumer forAll(*), forEach(*), and forEachIndexed(*). Add CharsetEncoders. Add CharsetDecoders. Add PathUtils.createParentDirectories(Path, LinkOption, FileAttribute...). Update FileEntry to use FileTime instead of long for file time stamps. Add more tests for IOUtils.contentEqualsIgnoreEOL #137. Reduce boilerplate through new UncheckedIO class and friends in org.apache.commons.io.function. Add PathUtils.touch(Path). Add FileSystem.getIllegalFileNameCodePoints(). Add FileUtils.isFileNewer(File, ChronoLocalDate, OffsetTime). Add FileUtils.isFileNewer(File, OffsetDateTime). Add FileUtils.isFileOlder(File, ChronoLocalDate, OffsetTime). Add FileUtils.isFileOlder(File, OffsetDateTime). Add IOBiConsumer.noop(). Add IOUtils.closeQuietly(Iterable<Closeable>). Add IOUtils.closeQuietly(Stream<Closeable>). Add Charsets.toCharset(Charset, Charset). Add Charsets.toCharset(String, Charset). Add XmlStreamWriter(OutputStream, Charset). Add PathUtils.getLastModifiedFileTime(*). Add IOBiFunction, IOTriFunction, IOQuadFunction, IOPredicate, IOIterator, IOSpliterator, IOBaseStream, IOStream, FilesUncheck. Add IOUtils.consume(Reader). Add IOSupplier.asSupplier(). Add IOFunction.asFunction(). Add IOConsumer.asConsumer(). Add TimestampedObserver.isClosed(). IOExceptionList implements Iterable. Bump actions/cache from 2.1.6 to 3.0.10 #307, #337, #393. Bump actions/checkout from 2.3.4 to 3.1.0 #286, #298, #330, #392. Bump actions/setup-java from 2 to 3.6.0 #346, #397. Bump github/codeql-action from 1 to 2 #353. Bump Maven Javadoc plugin from 3.2.0 to 3.4.1. Bump spotbugs-maven-plugin from 4.2.3 to 4.7.3.0 #250, #259, #272, #274, #285, #288, #289, #305, #315, #326, #338, #360, #366, #370, #380, #395, #403. Bump spotbugs from 4.5.2 to 4.7.3 #313, #317, #357, #382, #398. Bump JUnit from 5.7.2 to 5.8.2. Bump maven-enforcer-plugin from 3.0.0-M3 to 3.1.0 #255, #363. Bump checkstyle from 8.44 to 9.3 #256, #257, #266, #279, #292. #308. Bump junit-bom from 5.8.0-M1 to 5.9.1 #260, #271, #275, #309, #386. Bump mockito-inline from 3.11.2 to 4.8.1 #262, #264, #282, #306, #314, #331, #348, #359, #381, #399. Bump jmh.version from 1.32 to 1.35 #258, #316, #342. Bump moditect-maven-plugin from 1.0.0.RC1 to 1.0.0.RC2 #280. Bump junit-pioneer from 1.4.2 to 1.7.2 #304. #335, #362, #402. Bump japicmp-maven-plugin from 0.15.3 to 0.16.0. Bump commons-parent from 52 to 54 #388. Bump jacoco-maven-plugin from 0.8.7 to 0.8.8. Bump maven-antrun-plugin from 3.0.0 to 3.1.0 #354. Bump commons.surefire.version 3.0.0-M5 to 3.0.0-M7. Bump PMD from 6.44.0 to 6.51.0. Bump maven-pmd-plugin from 3.16.0 to 3.19.0. Bump apache-rat from 0.13 to 0.14. Bump exec-maven-plugin from 3.0.0 to 3.1.0 #369. Bump maven-checkstyle-plugin from 3.1.2 to 3.2.0 #376. Bump apache-rat-plugin from 0.14 to 0.15 #387. FileUtils.listFiles does not list matching files if File parameter is a symbolic link. FileUtils#deleteDirectory(File) exception Javadoc inaccurate update #245. Minor changes #243. Replace construction of FileInputStream and FileOutputStream objects with Files NIO APIs. #221. Fix IndexOutOfBoundsException in IOExceptionList constructors. Remove IOException from the method signatures that no longer throw IOException. This maintains binary compatibility but not source compatibility. - FilenameUtils directoryContains(String, String) - BoundedReader BoundedReader(java.io.Reader, int) - IOUtils lineIterator(java.io.InputStream, Charset) lineIterator(java.io.InputStream, String) toByteArray(String) toInputStream(CharSequence, String) toInputStream(String, String) toString(byte[]) toString(byte[], String) Add SymbolicLinkFileFilter. Add test to make sure the setter of AndFileFilter works correctly #244. Add XmlStreamReader(Path). Bump mockito-inline from 3.11.0 to 3.11.2 #247. Bump jmh.version from 1.27 to 1.32 #237. RegexFileFilter uses the path and file name instead of just the file name. The OSGi manifest now contains sun.* import packages #239. Sanitize double slash after prefix #79. Add and use RegexFileFilter.toString(). Add and use RegexFileFilter.RegexFileFilter(Pattern, Function<Path>, String>) Add and use IOCase.isCaseSensitive(IOCase). Bump actions/cache from 2.1.5 to 2.1.6 #238. Bump junit-pioneer from 1.4.1 to 1.4.2 #240. Bump checkstyle from 8.42 to 8.44 #241, #248. Bump mockito-inline from 3.10.0 to 3.11.0 #242. IOUtils.toByteArray(InputStream) Javadoc does not match code. FileUtils: Remove Instant->ZonedDateTime->Instant round-trip. Make FilenameUtils.equals() not throw an exception #154. Un-deprecate IOUtils.closeQuietly() methods. FileUtils#copyDirectory(File, File, FileFilter, preserveFileDate) clean up #163. AccumulatorPathVisitor does not track directories properly. FileUtils.iterateFiles runs out of memory when executed for a directory with large number of files. Re-implement FileUtils' iterateFiles(), iterateFilesAndDirs(), listFiles(), listFilesAndDirs() to use NIO file tree walking instead of IO file listings to avoid memory consumption issues on large file trees. FileUtils.forceDelete(File) actually forces deletion of read-only files as it did in version 2.6. PathUtils.deleteFile() no longer throws a NoSuchFileException when applied on a symbolic link pointing to a file that doesn't exist. Behavior change in FileUtils.copyDirectory() file last modified timestamp preservation. Match Javadoc to code. Fix getPrefixLength method for Linux filename #179. Wrong logging in FileUtils.setLastModified. IOUtils.toByteArray(InputStream) Javadoc does not match code. CopyUtils deprecation message gives wrong version. Make PathUtils.setReadOnly deal with LinuxDosFileAttributeView #186. FileUtils.forceDelete does not delete invalid links. #187. IOUtils.toByteArray(null) no longer throws a NullPointerException. MarkShieldInputStream#reset should throw UnsupportedOperationException. LockableFileWriter.close() should fail when the lock file cannot be deleted. Fix infinite loops in ObservableInputStream read(*) when an exception is caught but not re-thrown. Fixed error of copying directories between different file systems #203. Fix Typos in JavaDoc, Comments and Tests #201. FileUtils.checksumCRC32 and FileUtils.checksum are not thread safe. Fix error about usage of DirectBuffer in JRE 16/17 #205. Prevent infinite loop with AbstractCharacterFilterReader if EOF is filtered out #226. Check for long streams in IOUtils.toByteArray #175. Add FileSystemProviders class. Let org.apache.commons.io.filefilter classes work with java.nio.file.Files.walk* APIs. Let org.apache.commons.io.filefilter classes work with java.nio.file.Files#newDirectoryStream(Path, DirectoryStream.Filter). Add and adapt ReadAheadInputStream and BufferedFileChannelInputStream from Apache Spark. Add PathUtils.createParentDirectories(Path, FileAttribute...). Add factory methods to CloseShieldInputStream, CloseShieldReader, CloseShieldOutputStream, CloseShieldWriter, #173. Add QueueInputStream and QueueOutputStream as simpler alternatives to PipedInputStream and PipedOutputStream #171. Add StandardLineSeparator. Replace magic numbers with constants with the new IOUtils.CR and LF. Add FileSystem#supportsDriveLetter(). Add FileUtils.delete(File). Add FileUtils.moveFile(File, File, CopyOption...) #185. Add FileUtils.isEmptyDirectory(File). Add FileUtils.lastModified[Unchecked](File) to workaround https://bugs.openjdk.java.net/browse/JDK-8177809. Add null safe variants of isDirectory and isRegularFile. Add and use IOExceptionList(String, List). Add and use ObservableInputStream.ObservableInputStream(InputStream, Observer...). Make ObservableInputStream.getObservers() public. Add TimestampedObserver. Add and use IOUtils.byteArray(*). Make public and reuse IOUtils.EMPTY_BYTE_ARRAY. Add IOUtils.copy(URL, File). Add copy(URL, OutputStream). Add DeferredFileOutputStream.toInputStream() #206. Add CharacterSetFilterReader.CharacterSetFilterReader(Reader, Integer...). Add AbstractCharacterFilterReader(Reader, IntPredicate), #227. Add CharacterFilterReader(Reader, IntPredicate), #227. Add CharacterFilterReaderIntPredicateTest, #227. Add IOConsumer.noop(). Add constructor ThresholdingOutputStream(int, IOConsumer, IOFunction) and make the class concrete. Add constructor accepting collection of file alteration observers #236. Update junit-jupiter from 5.6.2 to 5.7.0 #153. Update mockito-core from 3.5.9 to 3.10.0, #152, #155, #157, #166, #167, #169, #182. Bump mockito-inline from 3.7.0 to 3.10.0 #188, #207, #230. Update commons.jacoco.version 0.8.5 to 0.8.7, fixes Java 15 builds and up. Update spotbugs from 4.1.2 to 4.5.0, #158, #164, #165, #180, #199, #213, #224, #302. Bump spotbugs-maven-plugin from 4.0.4 to 4.2.3, #161, #172, #223. Update org.junit-pioneer:junit-pioneer 0.9.0 -> 1.4,1, #159, #162, #170, #189, #191, #210, #229. Update actions/checkout from v2.3.2 to v2.3.4, #156, #168. Bump actions/setup-java from v1.4.2 to v2 #160. Update maven-surefire-plugin from 2.22.2 to 3.0.0-M5. Minor improvements, #176, 177, #190. Update commons.japicmp.version 0.14.4 -> 0.15.3. Tiny performance improvement in FileUtils#moveDirectoryToDirectory() #174. Bump checkstyle from 8.38 to 8.42 #689, #209, #225. Bump maven-checkstyle-plugin from 3.1.1 to 3.1.2 #198. Bump jimfs from 1.1 to 1.2 #183. Improve performance of IOUtils.contentEquals(InputStream, InputStream). Improve performance of IOUtils.contentEquals(Reader, Reader). Bump actions/cache from v2 to v2.1.5 #202, #228. Bump junit-bom from 5.7.0 to 5.7.2 #200, #232. Update from Apache Commons Lang 3.11 to 3.12.0. Minor improvements #233. Simplify Assertions in tests #234. Add org.apache.commons.io.input.CircularInputStream. Add org.apache.commons.io.file.PathUtils.cleanDirectory(Path, FileVisitOption...). Add org.apache.commons.io.file.PathUtils.deleteDirectory(Path, FileVisitOption...). Add NullAppendable. CharSequenceReader.skip should return 0 instead of EOF on stream end #123. Implement CharSequenceReader.ready() #122. Fix code smells; fix typos #115. Add caching for required charsets #120. Make some simplifications #121. InfiniteCircularInputStream is not infinite if its input buffer contains -1. InfiniteCircularInputStream throws a divide-by-zero exception when reading if its input buffer is size 0. FileSystem.getCurrent() does not return the correct enum. input.AbstractCharacterFilterReader passes count of chars read #132. Add PathUtils.getAclEntryList(Path). Null-guard IOUtils.close(Closeable, IOConsumer). Add ReversedLinesFileReader.readLines(int). Add ReversedLinesFileReader.toString(int). 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...). CircularBufferInputStream.read() fails to convert byte to unsigned int Fix SpotBugs issues in org.apache.commons.io.FileUtils. Add RandomAccessFileInputStream. IOUtils.close(Closeable) should allow a list of closeables. Copying a File sets last modified date to 01 January 1970. Add IOUtils.consume(InputStream). Add isFileNewer() and isFileOlder() methods that support the Java 8 Date/Time API. #124. Prevent NullPointerException in ReversedLinesFileReader constructors #117. Add a MarkShieldInputStream #119. Deprecate IOUtils.LINE_SEPARATOR in favor of Java 7's System.lineSeparator(). Replace FindBugs with SpotBugs. maven-checkstyle-plugin 3.1.0 -> 3.1.1. Update tests from org.apache.commons:commons-lang3 3.10 to 3.11. Update commons-parent from 50 to 51 #129. Update actions/checkout from v1 to v2.3.1 #126. Update junit-pioneer from 0.6.0 to 0.9.0, #127, #135, #138. Update mockito-core from 3.3.3 to 3.5.9 #128, #133, #145, #149, #151. Update spotbugs from 4.0.6 to 4.6.0 #134, #332. Update actions/checkout from v2.3.1 to v2.3.2 #140. Update actions/setup-java from v1.4.0 to v1.4.2 #141, #148. Update com.github.siom79.japicmp:japicmp-maven-plugin 0.14.3 -> 0.14.4. Some tests fail if the base path contains a space. Adding the CircularBufferInputStream, and the PeekableInputStream. Make methods in ObservableInputStream.Observer public. Thread bug in FileAlterationMonitor#stop(int). Add org.apache.commons.io.FilenameUtils.isIllegalWindowsFileName(char). Perform locale independent upper case conversions. Missing Javadoc in FilenameUtils causing Travis-CI build to fail. Remove redundant isDirectory() check in org.apache.commons.io.FileUtils.listFilesAndDirs(File, IOFileFilter, IOFileFilter). Refactor duplicate code in org.apache.commons.io.FileUtils. Add readers to filter out given characters: CharacterSetFilterReader and CharacterFilterReader. FilenameUtils.normalize now verifies hostname syntax in UNC path. Update org.apache.commons.io.FilenameUtils.isExtension(String, String[]) to use var args. FileUtils.copyToFile(InputStream source, File destination) should not close input stream. Add IOUtils copy methods with java.lang.Appendable as the target. FileUtils.doCopyFile(File, File, boolean) can throw ClosedByInterruptException. Add class CanExecuteFileFilter. Make array declaration in ThresholdingOutputStream consistent with other array declarations in the library #77. Support java.nio.Path and non-default file systems for ReversedLinesFileReader (#62). Add a convenience NullPrintStream. Update from Java 7 to Java 8. Remove throws IOException in method isSymlink() #80. Add class TeeReader. Add classes ClosedReader and CloseShieldReader. #84. Add classes TaggedWriter, ClosedWriter and BrokenWriter. #86. Add classes TeeWriter, FilterCollectionWriter, ProxyCollectionWriter, IOExceptionList, IOIndexedException. Add class AppendableWriter. #87. Add class CloseShieldWriter. #83. Add classes Added TaggedReader, ClosedReader and BrokenReader. #85. Support sub sequences in CharSequenceReader. #91. Corrected misleading exception message for FileUtils.copyDirectoryToDirectory. A mistake in the FilenameUtils.concat()'s Javadoc about an absolute path. Migration to JUnit Jupiter #97. Deprecate org.apache.commons.io.output.NullOutputStream.NullOutputStream() in favor of org.apache.commons.io.output.NullOutputStream.NULL_OUTPUT_STREAM. Add a CountingFileVisitor (as the basis for a forthcoming DeletingFileVisitor). Add PathUtils for operations on NIO Path. Add DeletingFileVisitor. FileUtils#forceDelete should use Files#delete rather than File#delete so exception messages includes reason for failure. Make getCause synchronized and use a Deque instead of a Stack #64. Add org.apache.commons.io.IOUtils.close(Closeable). Add and reuse org.apache.commons.io.IOUtils.closeQuitely(Closeable, Consumer<IOException>). Add and reuse org.apache.commons.io.IOUtils.close(Closeable, IOConsumer<IOException>). NPE in org.apache.commons.io.IOUtils.contentEquals(InputStream, InputStream) when only one input is null. NPE in org.apache.commons.io.IOUtils.contentEquals(Reader, Reader) when only one input is null. NPE in org.apache.commons.io.IOUtils.contentEqualsIgnoreEOL(Reader, Reader) when only one input is null. NPE in org.apache.commons.io.FileUtils.contentEqualsIgnoreEOL(File, File) when only one input is null. Add org.apache.commons.io.file.PathUtils.fileContentEquals(Path, Path, OpenOption...). Add a SequenceReader similar to java.io.SequenceInputStream. Implement directory content equality. 100#. Update tests from Apache Commons Lang 3.9 to 3.10. Update tests org.junit-pioneer:junit-pioneer 0.3.0 -> 0.6.0. Update tests org.junit.jupiter:junit-jupiter 5.5.2 -> 5.6.2. Update tests org.mockito:mockito-core 3.0.0 -> 3.3.3. Refactor ByteArrayOutputStream into synchronized and unsynchronized versions #108. Refactor ByteArrayOutputStream into synchronized and unsynchronized versions #108. org.apache.commons.io.FileUtils.copyURLToFile(*) open but do not close streams. Normalize internal buffers to 8192 bytes. Ensure that passing a null InputStream results in NPE with tests #112. commons.jacoco.version 0.8.4 -> 0.8.5. com.github.siom79.japicmp:japicmp-maven-plugin 0.14.1 -> 0.14.3. Add functional interfaces IOFunction and IOSupplier #110. Support sub sequences in CharSequenceReader #91. Remove deprecated sudo setting. #113. Make code style of hasBOM() consistent with getBOMCharsetName() ClosedOutputStream#flush should throw Add Automatic-Module-Name MANIFEST entry for Java 9 compatibility Documentation issue, fix 404 Javadoc issues in the description page FileUtils#readFileToByteArray: optimize reading of files with known size Throw a IllegalArgumentException instead of NullPointerException in FileSystemUtils.freeSpaceWindows(). Add convenience methods for copyToDirectory Javadoc contradictory for FileFilterUtils.ageFileFilter(cutoff) and the filter it constructs: AgeFileFilter(cutoff) FileUtilTestCase.testForceDeleteDir() should not delete testDirectory parent fix Tailer.run race condition runaway logging getPrefixLength return -1 if unix file contains colon FileUtilsTestCase#testContentEqualsIgnoreEOL fails on Windows .gitattributes not correctly applied Allow Specifying Initial Buffer Size of DeferredFileOutputStream. ThresholdingOutputStream.thresholdReached() results in FileNotFoundException. After a few unit tests, a few newly created directories not cleaned completely. Exceptions are suppressed incorrectly when copying files. Update platform requirement to Java 7. BOMInputStream shouldn't sort array of BOMs in-place. Deprecate methods FileSystemUtils.freeSpaceKb(). Make LineIterator implement Closeable to support try-with-resources statements. Deprecated of all IOUtils.closeQuietly() methods and use try-with-resources internally. Add infinite circular input stream Add a ByteOrderParser class. Add ObservableInputStream Add MessageDigestCalculatingInputStream Add convenience methods for reading class path resources. Remove org.apache.commons.io.Java7Support Implement special case handling for NTFS ADS names: FilenameUtils.getExtension(String), and FilenameUtils.indexOfExtension(String) are now throwing an IllegalArgumentException, if the file name in question appears to identify an alternate data stream (Windows only). Typo: In an IOUtils.java comment it says "focussed" instead of "focused". Converted all test cases to JUnit 4 Add ValidatingObjectInputStream for controlled deserialization adds an endOfFileReached method to the TailerListener FilenameUtils should handle embedded null bytes Changed/Corrected algorithm for waitFor Support for additional encodings in ReversedLinesFileReader BOMInputStream.skip returns wrong count if stream contains no BOM Setter method for threshold on ThresholdingOutputStream FileUtils.waitFor(...) swallows thread interrupted status Support for symlinks with missing target. Added support for JDK7 symlink features when present Added testcase to show this was fixed with IO-423 Correct exception message in FileUtils.getFile(File, String...) Introduce new class AppendableOutputStream Update to JUnit 4.12 IOExceptionWithCause no longer needed Add WindowsLineEndingInputStream and UnixLineEndingInputStream. 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. Regression in FileUtils.readFileToString from 2.0.1 ant test fails - resources missing from test classpath Document that FileUtils.deleteDirectory, directoryContains and cleanDirectory may throw an IllegalArgumentException in case the passed directory does not exist or is not a directory. Add API IOUtils.closeQuietly(Closeable...) Javadoc fixes, mostly to appease 1.8.0 Deprecate Charsets Charset constants in favor of Java 7's java.nio.charset.StandardCharsets Readfully() That Returns A Byte Array Overload IOUtils buffer methods to accept buffer size FileUtils.sizeOfDirectory can throw IllegalArgumentException FileUtils.sizeOfDirectoryAsBigInteger can overflow. Ensure that recursive calls all use BigInteger Chunked IO for large arrays. Added writeChunked(byte[], OutputStream) and writeChunked(char[] Writer) Added ChunkedOutputStream, ChunkedWriter FileUtils.doCopyFile can potentially loop forever Exit loop if no data to copy FileUtils.doCopyFile caches the file size; needs to be documented Added Javadoc; show file lengths in exception message Convert IOCase to a Java 1.5+ Enumeration [N.B. this is binary compatible] Add Methods for Buffering Streams/Writers To IOUtils Added overloaded buffer() methods - see also IO-330 IOUtils#toBufferedOutputStream/toBufferedWriter to conditionally wrap the output Added overloaded buffer() methods - see also IO-233 Add FileUtils.copyInputStreamToFile API with option to leave the source open. See copyInputStreamToFile(final InputStream source, final File destination, boolean closeSource) FileUtils.copyInputStreamToFile should document it closes the input source Tailer erroneously considers file as new. Fix to use file.lastModified() rather than System.currentTimeMillis() 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 CharSequenceInputStream - add tests for available() Fix code so it really does reflect a minimum available. getPrefixLength returns null if filename has leading slashes Javadoc: add examples to show correct behavior; add unit tests FileUtils.listFilesAndDirs includes original dir in results even when it doesn't match filter Javadoc: clarify that original dir is included in the results Add ByteArrayOutputStream.toInputStream() ClassLoaderObjectInputStream does not handle primitive typed members A constant for holding the BOM character (U+FEFF) Deprecate all methods that use the default encoding When a file is rotated, finish reading previous file prior to starting new one Commons IO Tailer does not respect UTF-8 Charset. What should happen in FileUtils.sizeOf[Directory] when an overflow takes place? Added Javadoc. FileUtils.moveDirectory can produce misleading error message on failure FilenameUtils.splitOnTokens(String text) check for '**' could be simplified WildcardFileFilter ctors should not use null to mean IOCase.SENSITIVE when delegating to other ctors IOUtils.contentEquals* methods returns false if input1 == input2, should return true. Add API FileUtils.forceMkdirsParent(). Add API Charsets.requiredCharsets(). Add IOUtils.skip and skipFully(ReadableByteChannel, long). Add IOUtils.read and readFully(ReadableByteChannel, ByteBuffer buffer). [Tailer] InterruptedException while the thread is sleeping is silently ignored Add API IOUtils.copy(InputStream, OutputStream, int) Add API with array offset and length argument to FileUtils.writeByteArrayToFile. Spelling fixes. Missing information in IllegalArgumentException thrown by org.apache.commons.io.FileUtils#validateListFilesParameters. Supply a hook method allowing Tailer actively determining stop condition. Improper Javadoc comment for FilenameUtils.indexOfExtension. Make IOUtils.EOF public and reuse it in various classes. org.apache.commons.io.comparator Javadoc is inconsistent with real code. Yottabyte (YB) incorrectly defined in FileUtils. Tailer locks file from deletion/rename on Windows. Tailer erroneously considers file as new. Tailer#readLines - incorrect CR handling. FileUtils.toURLs throws NPE for null parameter; document the behavior. Export OSGi packages at version 1.x in addition to 2.x. Add XmlStreamReader support for UTF-32. BOMInputStream wrongly detects UTF-32LE_BOM files as UTF-16LE_BOM files in method getBOM(). Improve tailer's reading performance. Improve Tailer performance with buffered reads (see IO-332). FileUtils.writeLines uses unbuffered IO. Add byteCountToDisplaySize(BigInteger). Add new FileUtils.sizeOf[Directory] APIs to return BigInteger. Add IOUtils.toByteArray methods to work with URL and URI. Add missing Charset sister APIs to method that take a String charset name. FileUtils.sizeOfDirectory follows symbolic links. Add and use class Charsets. ByteOrderMark UTF_32LE is incorrect. Add Charset sister APIs to method that take a String charset name. Add IOUtils.toBufferedReader(Reader) Allow applications to provide buffer (or size) for copyLarge methods. IOUtils.read(InputStream/Reader) ignores the offset parameter CharSequenceInputStream(CharSequence s, Charset charset, int bufferSize) ignores bufferSize New copyLarge() method in IOUtils that takes additional offset, length arguments FileUtils.moveDirectoryToDirectory removes source directory if destination is a sub-directory ReaderInputStream#read(byte[] b, int off, int len) should check for valid parameters Use terabyte (TB), petabyte (PB) and exabyte (EB) in FileUtils.byteCountToDisplaySize(long size) ReaderInputStream#read(byte[] b, int off, int len) should always return 0 for length == 0 FileUtils.listFiles() doesn't return directories "FileUtils#deleteDirectoryOnExit(File)" does not work BoundedInputStream.read() treats max differently from BoundedInputStream.read(byte[]...) CharSequenceInputStream to efficiently stream content of a CharSequence ReaderInputStream optimization: more efficient reading of small chunks of data Various methods of class 'org.apache.commons.io.FileUtils' incorrectly suppress 'java.io.IOException' The second constructor of Tailer class does not pass 'delay' to the third one TeeOutputStream does not call branch.close() when main.close() throws an exception ArrayIndexOutOfBoundsException in BOMInputStream when reading a file without BOM multiple times Add IOUtils.closeQuietly(Selector) necessary IOUtils.closeQuietly() should take a ServerSocket as a parameter Add read/readFully methods to IOUtils Supply a ReversedLinesFileReader Add new function FileUtils.directoryContains. FileUtils.contentEquals and IOUtils.contentEquals - Add option to ignore "line endings" Added contentEqualsIgnoreEOL methods to both classes Use standard Maven directory layout Add IOUtils API toString for URL and URI to get contents Add API FileUtils.copyFile(File input, OutputStream output) Dubious use of mkdirs() return code ReaderInputStream enters infinite loop when it encounters an unmappable character FileUtils.moveFile() Javadoc should specify FileExistsException thrown FileAlterationObserver has no getter for FileFilter Add FileUtils.getFile API with varargs parameter ClassLoaderObjectInputStream does not handle Proxy classes FileAlterationMonitor.stop(boolean allowIntervalToFinish) Add new APPEND parameter for writing string into files Tailer returning partial lines when reaching EOF before EOL FileUtils.copyFile() throws IOException when copying large files to a shared directory (on Windows) FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files. Improve coverage by also looking for hidden files. Add new read method "toByteArray" to handle InputStream with known size. TODO: Convert RELEASE-NOTES.txt from 2.0.1? TODO: Convert RELEASE-NOTES.txt from 2.0? TODO: Convert RELEASE-NOTES.txt from 1.4? Some tests, which are implicitly assuming a Unix-like file system, are now skipped on Windows. Created the FileCleaningTracker, basically a non-static version of the FileCleaner, which can be controlled by the user. EndianUtils - both readSwappedUnsignedInteger(...) methods could return negative numbers due to int/long casting.