xref: /aosp_15_r20/external/apache-commons-io/src/site/xdoc/upgradeto2_0.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 1.4 to 2.0</title>
21  <author email="[email protected]">Commons Documentation Team</author>
22 </properties>
23<body>
24
25<section name="Upgrade">
26<p>
27These are the release notes and advice for upgrading Commons-IO from
28version 1.4 to version 2.0.
29<source>
30Commons IO is a package of Java utility classes for java.io's hierarchy.
31Classes in this package are considered to be so standard and of such high
32reuse as to justify existence in java.io.
33
34Commons IO contains utility classes, stream implementations, file filters,
35file comparators and endian transformation classes.
36
37
38Compatibility with 1.4
39----------------------
40Binary compatible - Yes
41
42Source compatible - Yes
43
44Semantic compatible - Yes
45  Check the bug fixes section for semantic bug fixes
46
47Commons IO 2.0 requires a minimum of JDK 1.5
48 (Commons IO 1.4 had a minimum of JDK 1.3)
49
50
51Deprecations from 1.4
52---------------------
53
54- IOUtils
55  - write(StringBuffer, Writer) in favour of write(CharSequence, Writer)
56  - write(StringBuffer, OutputStream)  in favour of write(CharSequence, OutputStream)
57  - write(StringBuffer, OutputStream, String) in favour of write(CharSequence, OutputStream, String)
58
59- FileFilterUtils
60  - andFileFilter(IOFileFilter, IOFileFilter) in favour of and(IOFileFilter...)
61  - orFileFilter(IOFileFilter, IOFileFilter)  in favour of or(IOFileFilter...)
62
63
64Enhancements from 1.4
65---------------------
66
67  * [IO-140] Move minimum Java requirement from JDK 1.3 to JDK 1.5
68             - use Generics
69             - add new CharSequence write() flavour methods to IOUtils and FileUtils
70             - replace StringBuffer with StringBuilder, where appropriate
71             - add new Reader/Writer methods to ProxyReader and ProxyWriter
72             - Annotate with @Override and @Deprecated
73
74  * [IO-178] New BOMInputStream and ByteOrderMark implementations - to detect and optionally exclude an initial Byte Order mark (BOM)
75  * [IO-197] New BoundedInputStream (copied from Apache JackRabbit)
76  * [IO-193] New Broken Input and Output streams
77  * [IO-132] New File Listener/Monitor facility
78  * [IO-158] New ReaderInputStream and WriterOutputStream implementations
79  * [IO-139] New StringBuilder Writer implementation
80  * [IO-192] New Tagged Input and Output streams
81  * [IO-177] New Tailer class - simple implementation of the Unix "tail -f" functionality
82  * [IO-162] New XML Stream Reader/Writer implementations (from ROME via plexus-utils)
83
84  * [IO-142] Comparators - add facility to sort file lists/arrays
85  * [IO-186] Comparators - new Composite and Directory File Comparator implementations
86  * [IO-176] DirectoryWalker - add filterDirectoryContents() callback method for filtering directory contents
87  * [IO-210] FileFilter - new Magic Number FileFilter
88  * [IO-221] FileFilterUtils - add methods for suffix and prefix filters which take an IOCase object
89  * [IO-232] FileFilterUtils - add method for name filters which take an IOCase object
90  * [IO-229] FileFilterUtils - add varargs and() and or() methods
91  * [IO-198] FileFilterUtils - add ability to apply file filters to collections and arrays
92  * [IO-156] FilenameUtils - add normalize() and normalizeNoEndSeparator() methods which allow the separator character to be specified
93  * [IO-194] FileSystemUtils - add freeSpaceKb() method with no input arguments
94  * [IO-185] FileSystemUtils - add freeSpaceKb() methods that take a timeout parameter - fixes freeSpaceWindows() blocks
95  * [IO-155] FileUtils - use NIO to copy files
96  * [IO-168] FileUtils - add new isSymlink() method
97  * [IO-219] FileUtils - throw FileExistsException when moving a file or directory if the destination already exists
98  * [IO-234] FileUtils - add Methods for retrieving System User/Temp directories/paths
99  * [IO-208] FileUtils - add timeout (connection and read) support for copyURLToFile() method
100  * [IO-238] FileUtils - add sizeOf(File) method
101  * [IO-181] LineIterator now implements Iterable
102  * [IO-224] IOUtils - add closeQuietly(Closeable) and closeQuietly(Socket) methods
103  * [IO-203] IOUtils - add skipFully() method for InputStreams
104  * [IO-137] IOUtils and ByteArrayOutputStream - add toBufferedInputStream() method to avoid unnecessary array allocation/copy
105  * [IO-195] Proxy streams/Reader/Writer - provide exception handling methods
106  * [IO-211] Proxy Input/Output streams - add pre/post processing support
107  * [IO-242] Proxy Reader/Writer - add pre/post processing support
108
109
110Bug fixes from 1.4
111------------------
112  * [IO-214] ByteArrayOutputStream - fix inconsistent synchronization of fields
113  * [IO-201] Counting Input/Output streams - fix inconsistent synchronization
114  * [IO-159] FileCleaningTracker - fix remove() never returns null
115  * [IO-220] FileCleaningTracker - fix Vector performs badly under load
116  * [IO-167] FilenameUtils - fix case-insensitive string handling in FilenameUtils and FilesystemUtils
117  * [IO-179] FilenameUtils - fix StringIndexOutOfBounds exception in getPathNoEndSeparator()
118  * [IO-248] FilenameUtils - fix getFullPathNoEndSeparator() returns empty while path is a one level directory
119  * [IO-246] FilenameUtils - fix wildcardMatch gives incorrect results
120  * [IO-187] FileSystemUtils - fix freeSpaceKb() doesn't work with relative paths on Linux
121  * [IO-160] FileSystemUtils - fix freeSpace() fails on solaris
122  * [IO-209] FileSystemUtils - fix freeSpaceKb() fails to return correct size for a windows mount point
123  * [IO-163] FileUtils - fix toURLs() using deprecated method of conversion to URL
124  * [IO-168] FileUtils - fix Symbolic links followed when deleting directory
125  * [IO-231] FileUtils - fix wrong exception message generated in isFileNewer() method
126  * [IO-207] FileUtils - fix race condition in forceMkdir() method
127  * [IO-217] FileUtils - fix copyDirectoryToDirectory() makes infinite loops
128  * [IO-166] FileUtils - fix URL decoding in toFile(URL)
129  * [IO-190] FileUtils - fix copyDirectory not preserving lastmodified date on subdirectories
130  * [IO-240] FileFilterUtils - ensure cvsFilter and svnFilter are only created once.
131  * [IO-175] IOUtils - fix copyFile() issues with very large files
132  * [IO-191] Improvements from static analysis
133  * [IO-216] LockableFileWriter - delete files quietly when an exception is thrown during initialization
134  * [IO-243] SwappedDataInputStream - fix readBoolean is inverted
135  * [IO-235] Tests - remove unused YellOnFlushAndCloseOutputStream from CopyUtilsTest
136  * [IO-161] Tests - fix FileCleaningTrackerTestCase hanging
137
138
139Documentation changes from 1.4
140------------------------------
141  * [IO-183 FilenameUtils.getExtension() method documentation improvements
142  * [IO-226 FileUtils.byteCountToDisplaySize() documentation corrections
143  * [IO-205 FileUtils.forceMkdir() documentation improvements
144  * [IO-215 FileUtils copy file/directory improve documentation regarding preserving the last modified date
145  * [IO-189 HexDump.dump() method documentation improvements
146  * [IO-171 IOCase document that it assumes there are only two OSes: Windows and Unix
147  * [IO-223 IOUtils.copy() documentation corrections
148  * [IO-247 IOUtils.closeQuietly() improve documentation with examples
149  * [IO-202 NotFileFilter documentation corrections
150  * [IO-206 ProxyInputStream - fix misleading parameter names
151  * [IO-212 ProxyInputStream.skip() documentation corrections
152</source>
153</p>
154</section>
155
156</body>
157</document>
158