xref: /aosp_15_r20/external/apache-commons-io/src/site/xdoc/upgradeto2_5.xml (revision 0c4d7b72e49a04598d65c566f44504b95342d75a)
1<?xml version="1.0"?>
2<!--
3Licensed to the Apache Software Foundation (ASF) under one or more
4contributor license agreements.  See the NOTICE file distributed with
5this work for additional information regarding copyright ownership.
6The ASF licenses this file to You under the Apache License, Version 2.0
7(the "License"); you may not use this file except in compliance with
8the License.  You may obtain a copy of the License at
9
10     http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing, software
13distributed under the License is distributed on an "AS IS" BASIS,
14WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15See the License for the specific language governing permissions and
16limitations under the License.
17-->
18<document>
19    <properties>
20        <title>Upgrade from 2.4 to 2.5</title>
21        <author email="[email protected]">Commons Documentation Team</author>
22    </properties>
23    <body>
24
25        <section name="Upgrade">
26            <p>
27                These are the release notes and advice for upgrading Commons-IO from
28                version 2.4 to version 2.5
29                <source>
30                    Commons IO is a package of Java utility classes like java.io.
31                    Classes in this package are considered to be so standard and of such high
32                    reuse as to justify existence in java.io.
33
34                    The Apache Commons IO library contains utility classes, stream implementations, file filters,
35                    file comparators, endian transformation classes, and much more.
36
37                    ==============================================================================
38                    Apache Commons IO Version 2.5
39                    ==============================================================================
40                    New features and bug fixes.
41
42                    Changes in this version include:
43
44                    New features:
45                    o IO-487:  Add ValidatingObjectInputStream for controlled deserialization
46                    o IO-471:  Support for additional encodings in ReversedLinesFileReader Thanks to Leandro Reis.
47                    o IO-425:  Setter method for threshold on ThresholdingOutputStream Thanks to Craig Swank.
48                    o IO-406:  Introduce new class AppendableOutputStream Thanks to Niall Pemberton.
49                    o IO-459:  Add WindowsLineEndingInputStream and UnixLineEndingInputStream. Thanks to Kristian Rosenvold.
50                    o IO-457:  Add a BoundedReader, a wrapper that can be used to constrain access
51                            to an underlying stream when used with mark/reset -
52                            to avoid overflowing the mark limit of the underlying buffer. Thanks to Kristian Rosenvold.
53                    o IO-426:  Add API IOUtils.closeQuietly(Closeable...)
54                    o IO-410:  Readfully() That Returns A Byte Array Thanks to Beluga Behr.
55                    o IO-395:  Overload IOUtils buffer methods to accept buffer size Thanks to Beluga Behr.
56                    o IO-382:  Chunked IO for large arrays.
57                             Added writeChunked(byte[], OutputStream) and writeChunked(char[] Writer)
58                             Added ChunkedOutputStream, ChunkedWriter
59                    o IO-233:  Add Methods for Buffering Streams/Writers To IOUtils
60                             Added overloaded buffer() methods - see also IO-330
61                    o IO-330:  IOUtils#toBufferedOutputStream/toBufferedWriter to conditionally wrap the output
62                             Added overloaded buffer() methods - see also IO-233
63                    o IO-381:  Add FileUtils.copyInputStreamToFile API with option to leave the source open.
64                            See copyInputStreamToFile(final InputStream source, final File destination, boolean closeSource)
65                    o IO-379:  CharSequenceInputStream - add tests for available()
66                             Fix code so it really does reflect a minimum available.
67                    o IO-346:  Add ByteArrayOutputStream.toInputStream()
68                    o IO-341:  A constant for holding the BOM character (U+FEFF)
69                    o IO-361:  Add API FileUtils.forceMkdirsParent().
70                    o IO-360:  Add API Charsets.requiredCharsets().
71                    o IO-359:  Add IOUtils.skip and skipFully(ReadableByteChannel, long). Thanks to yukoba.
72                    o IO-358:  Add IOUtils.read and readFully(ReadableByteChannel, ByteBuffer buffer). Thanks to yukoba.
73                    o IO-353:  Add API IOUtils.copy(InputStream, OutputStream, int) Thanks to ggregory.
74                    o IO-349:  Add API with array offset and length argument to FileUtils.writeByteArrayToFile. Thanks to scop.
75                    o IO-348:  Missing information in IllegalArgumentException thrown by org.apache.commons.io.FileUtils#validateListFilesParameters. Thanks to plcstpierre.
76                    o IO-345:  Supply a hook method allowing Tailer actively determining stop condition. Thanks to mkresse.
77                    o IO-437:  Make IOUtils.EOF public and reuse it in various classes.
78
79                    Fixed Bugs:
80                    o IO-446:  adds an endOfFileReached method to the TailerListener Thanks to Jeffrey Barrus.
81                    o IO-484:  FilenameUtils should handle embedded null bytes Thanks to Philippe Arteau.
82                    o IO-481:  Changed/Corrected algorithm for waitFor
83                    o IO-428:  BOMInputStream.skip returns wrong count if stream contains no BOM Thanks to Stefan Gmeiner.
84                    o IO-488:  FileUtils.waitFor(...) swallows thread interrupted status Thanks to Bj�rn Buchner.
85                    o IO-452:  Support for symlinks with missing target. Added support for JDK7 symlink features when present Thanks to David Standish.
86                    o IO-453:  Regression in FileUtils.readFileToString from 2.0.1 Thanks to Steven Christou.
87                    o IO-451:  ant test fails - resources missing from test classpath Thanks to David Standish.
88                    o IO-435:  Document that FileUtils.deleteDirectory, directoryContains and cleanDirectory
89                             may throw an IllegalArgumentException in case the passed directory does not
90                             exist or is not a directory. Thanks to Dominik Stadler.
91                    o IO-424:  Javadoc fixes, mostly to appease 1.8.0 Thanks to Ville Skytt�.
92                    o IO-389:  FileUtils.sizeOfDirectory can throw IllegalArgumentException Thanks to Austin Doupnik.
93                    o IO-390:  FileUtils.sizeOfDirectoryAsBigInteger can overflow.
94                             Ensure that recursive calls all use BigInteger
95                    o IO-385:  FileUtils.doCopyFile can potentially loop forever
96                             Exit loop if no data to copy
97                    o IO-383:  FileUtils.doCopyFile caches the file size; needs to be documented
98                             Added Javadoc; show file lengths in exception message
99                    o IO-380:  FileUtils.copyInputStreamToFile should document it closes the input source Thanks to claudio_ch.
100                    o IO-279:  Tailer erroneously considers file as new.
101                            Fix to use file.lastModified() rather than System.currentTimeMillis()
102                    o IO-356:  CharSequenceInputStream#reset() behaves incorrectly in case when buffer size is not dividable by data size.
103                             Fix code so skip relates to the encoded bytes; reset now re-encodes the data up to the point of the mark
104                    o IO-368:  ClassLoaderObjectInputStream does not handle primitive typed members
105                    o IO-314:  Deprecate all methods that use the default encoding
106                    o IO-338:  When a file is rotated, finish reading previous file prior to starting new one
107                    o IO-354:  Commons IO Tailer does not respect UTF-8 Charset.
108                    o IO-323:  What should happen in FileUtils.sizeOf[Directory] when an overflow takes place?
109                            Added Javadoc.
110                    o IO-372:  FileUtils.moveDirectory can produce misleading error message on failure
111                    o IO-362:  IOUtils.contentEquals* methods returns false if input1 == input2, should return true. Thanks to mmadson, ggregory.
112                    o IO-357:  [Tailer] InterruptedException while the thread is sleeping is silently ignored Thanks to mortenh.
113                    o IO-352:  Spelling fixes. Thanks to scop.
114                    o IO-436:  Improper Javadoc comment for FilenameUtils.indexOfExtension. Thanks to christoph.schneegans.
115
116                    Changes:
117                    o IO-433:  Converted all testcases to JUnit 4
118                    o IO-466:  Added testcase to show this was fixed with IO-423
119                    o IO-479:  Correct exception message in FileUtils.getFile(File, String...) Thanks to Zhouce Chen.
120                    o IO-465:  Update to JUnit 4.12 Thanks to based2.
121                    o IO-462:  IOExceptionWithCause no longer needed
122                    o IO-422:  Deprecate Charsets Charset constants in favor of Java 7's java.nio.charset.StandardCharsets
123                    o IO-239:  Convert IOCase to a Java 1.5+ Enumeration
124                             [N.B. this is binary compatible]
125                    o IO-328:  getPrefixLength returns null if filename has leading slashes
126                            Javadoc: add examples to show correct behavior; add unit tests
127                    o IO-299:  FileUtils.listFilesAndDirs includes original dir in results even when it doesn't match filter
128                            Javadoc: clarify that original dir is included in the results
129                    o IO-375:  FilenameUtils.splitOnTokens(String text) check for '**' could be simplified
130                    o IO-374:  WildcardFileFilter ctors should not use null to mean IOCase.SENSITIVE when delegating to other ctors
131
132                    Compatibility with 2.4:
133                    Binary compatible: Yes.
134                    Source compatible: Yes.
135                    Semantic compatible: Yes.
136
137                    Compatibility with 2.2 and 1.4:
138                    Binary compatible: Yes.
139                    Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318.
140                    Semantic compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318.
141
142                    Commons IO 2.5 requires JDK 1.6 or later.
143                    Commons IO 2.4 requires JDK 1.6 or later.
144                    Commons IO 2.3 requires JDK 1.6 or later.
145                    Commons IO 2.2 requires JDK 1.5 or later.
146                    Commons IO 1.4 requires JDK 1.3 or later.
147                </source>
148            </p>
149        </section>
150
151    </body>
152</document>
153