xref: /aosp_15_r20/external/apache-commons-io/src/site/xdoc/upgradeto2_6.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.5 to 2.6</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 Apache Commons IO from
28                version 2.5 to version 2.6
29                <source>
30                    Apache 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,
35                    file filters, file comparators, endian transformation classes, and much more.
36
37                    Apache Commons IO 2.6 requires at least Java 7 to build and run.
38
39
40                    DEPRECATIONS
41                    ============
42
43                    All closeQuietly overloads in org.apache.commons.io.IOUtils have been
44                    deprecated. Use the try-with-resources statement or handle suppressed
45                    exceptions manually.
46
47                    The class org.apache.commons.io.FileSystemUtils has been deprecated.
48                    Use equivalent methods in java.nio.file.FileStore instead, e.g.
49                    Files.getFileStore(Paths.get("/home")).getUsableSpace() or iterate over
50                    FileSystems.getDefault().getFileStores().
51
52
53                    COMPATIBILITY WITH JAVA 9
54                    ==================
55
56                    The MANIFEST.MF now contains an additional entry:
57
58                    Automatic-Module-Name: org.apache.commons.io
59
60                    This should make it possible to use Commons IO 2.6 as a module in the Java 9
61                    module system. For more information see the corresponding issue:
62
63                    https://issues.apache.org/jira/browse/IO-551
64
65                    Building Commons IO 2.6 should work out of the box with the latest Java 9
66                    release. Please report any Java 9 related issues at:
67
68                    https://issues.apache.org/jira/browse/IO
69
70
71                    NEW FEATURES
72                    ============
73
74                    o IO-551: Add Automatic-Module-Name MANIFEST entry for Java 9 compatibility.
75                    o IO-367: Add convenience methods for copyToDirectory. Thanks to James Sawle.
76                    o IO-493: Add infinite circular input stream. Thanks to Piotr Turski.
77                    o IO-507: Add a ByteOrderUtils class.
78                    o IO-518: Add ObservableInputStream.
79                    o IO-519: Add MessageDigestCalculatingInputStream.
80                    o IO-513: Add convenience methods for reading class path resources.
81                    Thanks to Behrang Saeedzadeh.
82
83                    FIXED BUGS
84                    ==========
85
86                    o IO-550: Documentation issue, fix 404 Javadoc issues in the description page.
87                    Thanks to Jimi Adrian.
88                    o IO-442: Javadoc contradictory for FileFilterUtils.ageFileFilter(cutoff) and
89                    the filter it constructs: AgeFileFilter(cutoff).
90                    Thanks to Simon Robinson.
91                    o IO-534: FileUtilTestCase.testForceDeleteDir() should not delete testDirectory
92                    parent.
93                    o IO-528: Fix Tailer.run race condition runaway logging. Thanks to Dave Moten.
94                    o IO-483: getPrefixLength return -1 if Unix file contains colon.
95                    Thanks to Marko Vasic.
96                    o IO-520: FileUtilsTestCase#testContentEqualsIgnoreEOL fails on Windows.
97                    o IO-516: .gitattributes not correctly applied. Thanks to Jason Pyeron.
98                    o IO-515: Allow Specifying Initial Buffer Size of DeferredFileOutputStream.
99                    Thanks to Brett Lounsbury, Gary Gregory.
100                    o IO-512: ThresholdingOutputStream.thresholdReached() results in
101                    FileNotFoundException. Thanks to Ralf Hauser.
102                    o IO-511: After a few unit tests, a few newly created directories not cleaned
103                    completely. Thanks to Ahmet Celik.
104                    o IO-502: Exceptions are suppressed incorrectly when copying files.
105                    Thanks to Christian Schulte.
106                    o IO-503: Update platform requirement to Java 7.
107                    o IO-537: BOMInputStream shouldn't sort array of BOMs in-place.
108                    Thanks to Borys Zibrov.
109
110                    CHANGES
111                    =======
112
113                    o IO-542: FileUtils#readFileToByteArray: optimize reading of files with known
114                    size. Thanks to Ilmars Poikans.
115                    o IO-547: Throw a IllegalArgumentException instead of NullPointerException in
116                    FileSystemUtils.freeSpaceWindows(). Thanks to Nikhil Shinde,
117                    Michael Ernst, Gary Greory.
118                    o IO-506: Deprecate methods FileSystemUtils.freeSpaceKb().
119                    Thanks to Christian Schulte.
120                    o IO-505: Make LineIterator implement Closeable to support try-with-resources
121                    statements. Thanks to Christian Schulte.
122                    o IO-504: Deprecated of all IOUtils.closeQuietly() methods and use
123                    try-with-resources internally. Thanks to Christian Schulte.
124
125                    REMOVED
126                    =======
127
128                    o IO-514: Remove org.apache.commons.io.Java7Support.
129
130                    COMPATIBILITY WITH OLDER VERSIONS
131                    =================================
132
133                    Compatibility with 2.5:
134                    Binary compatible: Yes.
135                    Source compatible: Yes.
136                    Semantic compatible: Yes.
137
138                    Compatibility with 2.6 and 1.4:
139                    Binary compatible: Yes.
140                    Source compatible: No, see the rare case in
141                    https://issues.apache.org/jira/browse/IO-318.
142                    Semantic compatible: No, see the rare case in
143                    https://issues.apache.org/jira/browse/IO-318.
144
145                    Commons IO 2.6 requires Java 7 or later.
146                    Commons IO 2.5 requires Java 6 or later.
147                    Commons IO 2.4 requires Java 6 or later.
148                    Commons IO 2.3 requires Java 6 or later.
149                    Commons IO 2.2 requires Java 5 or later.
150                    Commons IO 1.4 requires Java 1.3 or later.
151                </source>
152            </p>
153        </section>
154
155    </body>
156</document>
157