RELEASE-NOTES.txt 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994
  1. Apache Commons IO
  2. Version 2.5
  3. Release Notes
  4. INTRODUCTION:
  5. Commons IO is a package of Java utility classes like java.io.
  6. Classes in this package are considered to be so standard and of such high
  7. reuse as to justify existence in java.io.
  8. The Apache Commons IO library contains utility classes, stream implementations, file filters,
  9. file comparators, endian transformation classes, and much more.
  10. ==============================================================================
  11. Apache Commons IO Version 2.5
  12. ==============================================================================
  13. New features and bug fixes.
  14. Changes in this version include:
  15. New features:
  16. o IO-487: Add ValidatingObjectInputStream for controlled deserialization
  17. o IO-471: Support for additional encodings in ReversedLinesFileReader Thanks to Leandro Reis.
  18. o IO-425: Setter method for threshold on ThresholdingOutputStream Thanks to Craig Swank.
  19. o IO-406: Introduce new class AppendableOutputStream Thanks to Niall Pemberton.
  20. o IO-459: Add WindowsLineEndingInputStream and UnixLineEndingInputStream. Thanks to Kristian Rosenvold.
  21. o IO-457: Add a BoundedReader, a wrapper that can be used to constrain access
  22. to an underlying stream when used with mark/reset -
  23. to avoid overflowing the mark limit of the underlying buffer. Thanks to Kristian Rosenvold.
  24. o IO-426: Add API IOUtils.closeQuietly(Closeable...)
  25. o IO-410: Readfully() That Returns A Byte Array Thanks to Beluga Behr.
  26. o IO-395: Overload IOUtils buffer methods to accept buffer size Thanks to Beluga Behr.
  27. o IO-382: Chunked IO for large arrays.
  28. Added writeChunked(byte[], OutputStream) and writeChunked(char[] Writer)
  29. Added ChunkedOutputStream, ChunkedWriter
  30. o IO-233: Add Methods for Buffering Streams/Writers To IOUtils
  31. Added overloaded buffer() methods - see also IO-330
  32. o IO-330: IOUtils#toBufferedOutputStream/toBufferedWriter to conditionally wrap the output
  33. Added overloaded buffer() methods - see also IO-233
  34. o IO-381: Add FileUtils.copyInputStreamToFile API with option to leave the source open.
  35. See copyInputStreamToFile(final InputStream source, final File destination, boolean closeSource)
  36. o IO-379: CharSequenceInputStream - add tests for available()
  37. Fix code so it really does reflect a minimum available.
  38. o IO-346: Add ByteArrayOutputStream.toInputStream()
  39. o IO-341: A constant for holding the BOM character (U+FEFF)
  40. o IO-361: Add API FileUtils.forceMkdirsParent().
  41. o IO-360: Add API Charsets.requiredCharsets().
  42. o IO-359: Add IOUtils.skip and skipFully(ReadableByteChannel, long). Thanks to yukoba.
  43. o IO-358: Add IOUtils.read and readFully(ReadableByteChannel, ByteBuffer buffer). Thanks to yukoba.
  44. o IO-353: Add API IOUtils.copy(InputStream, OutputStream, int) Thanks to ggregory.
  45. o IO-349: Add API with array offset and length argument to FileUtils.writeByteArrayToFile. Thanks to scop.
  46. o IO-348: Missing information in IllegalArgumentException thrown by org.apache.commons.io.FileUtils#validateListFilesParameters. Thanks to plcstpierre.
  47. o IO-345: Supply a hook method allowing Tailer actively determining stop condition. Thanks to mkresse.
  48. o IO-437: Make IOUtils.EOF public and reuse it in various classes.
  49. Fixed Bugs:
  50. o IO-446: adds an endOfFileReached method to the TailerListener Thanks to Jeffrey Barrus.
  51. o IO-484: FilenameUtils should handle embedded null bytes Thanks to Philippe Arteau.
  52. o IO-481: Changed/Corrected algorithm for waitFor
  53. o IO-428: BOMInputStream.skip returns wrong count if stream contains no BOM Thanks to Stefan Gmeiner.
  54. o IO-488: FileUtils.waitFor(...) swallows thread interrupted status Thanks to Björn Buchner.
  55. o IO-452: Support for symlinks with missing target. Added support for JDK7 symlink features when present Thanks to David Standish.
  56. o IO-453: Regression in FileUtils.readFileToString from 2.0.1 Thanks to Steven Christou.
  57. o IO-451: ant test fails - resources missing from test classpath Thanks to David Standish.
  58. o IO-435: Document that FileUtils.deleteDirectory, directoryContains and cleanDirectory
  59. may throw an IllegalArgumentException in case the passed directory does not
  60. exist or is not a directory. Thanks to Dominik Stadler.
  61. o IO-424: Javadoc fixes, mostly to appease 1.8.0 Thanks to Ville Skyttä.
  62. o IO-389: FileUtils.sizeOfDirectory can throw IllegalArgumentException Thanks to Austin Doupnik.
  63. o IO-390: FileUtils.sizeOfDirectoryAsBigInteger can overflow.
  64. Ensure that recursive calls all use BigInteger
  65. o IO-385: FileUtils.doCopyFile can potentially loop for ever
  66. Exit loop if no data to copy
  67. o IO-383: FileUtils.doCopyFile caches the file size; needs to be documented
  68. Added Javadoc; show file lengths in exception message
  69. o IO-380: FileUtils.copyInputStreamToFile should document it closes the input source Thanks to claudio_ch.
  70. o IO-279: Tailer erroneously considers file as new.
  71. Fix to use file.lastModified() rather than System.currentTimeMillis()
  72. o IO-356: CharSequenceInputStream#reset() behaves incorrectly in case when buffer size is not dividable by data size.
  73. Fix code so skip relates to the encoded bytes; reset now re-encodes the data up to the point of the mark
  74. o IO-368: ClassLoaderObjectInputStream does not handle primitive typed members
  75. o IO-314: Deprecate all methods that use the default encoding
  76. o IO-338: When a file is rotated, finish reading previous file prior to starting new one
  77. o IO-354: Commons IO Tailer does not respect UTF-8 Charset.
  78. o IO-323: What should happen in FileUtils.sizeOf[Directory] when an overflow takes place?
  79. Added Javadoc.
  80. o IO-372: FileUtils.moveDirectory can produce misleading error message on failiure
  81. o IO-362: IOUtils.contentEquals* methods returns false if input1 == input2, should return true. Thanks to mmadson, ggregory.
  82. o IO-357: [Tailer] InterruptedException while the thread is sleeping is silently ignored Thanks to mortenh.
  83. o IO-352: Spelling fixes. Thanks to scop.
  84. o IO-436: Improper JavaDoc comment for FilenameUtils.indexOfExtension. Thanks to christoph.schneegans.
  85. Changes:
  86. o IO-433: Converted all testcases to JUnit 4
  87. o IO-466: Added testcase to show this was fixed with IO-423
  88. o IO-479: Correct exception message in FileUtils.getFile(File, String...) Thanks to Zhouce Chen.
  89. o IO-465: Update to JUnit 4.12 Thanks to based2.
  90. o IO-462: IOExceptionWithCause no longer needed
  91. o IO-422: Deprecate Charsets Charset constants in favor of Java 7's java.nio.charset.StandardCharsets
  92. o IO-239: Convert IOCase to a Java 1.5+ Enumeration
  93. [N.B. this is binary compatible]
  94. o IO-328: getPrefixLength returns null if filename has leading slashes
  95. Javadoc: add examples to show correct behaviour; add unit tests
  96. o IO-299: FileUtils.listFilesAndDirs includes original dir in results even when it doesn't match filter
  97. Javadoc: clarify that original dir is included in the results
  98. o IO-375: FilenameUtils.splitOnTokens(String text) check for '**' could be simplified
  99. o IO-374: WildcardFileFilter ctors should not use null to mean IOCase.SENSITIVE when delegating to other ctors
  100. Compatibility with 2.4:
  101. Binary compatible: Yes.
  102. Source compatible: Yes.
  103. Semantic compatible: Yes.
  104. Compatibility with 2.2 and 1.4:
  105. Binary compatible: Yes.
  106. Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318.
  107. Semantic compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318.
  108. Commons IO 2.5 requires JDK 1.6 or later.
  109. Commons IO 2.4 requires JDK 1.6 or later.
  110. Commons IO 2.3 requires JDK 1.6 or later.
  111. Commons IO 2.2 requires JDK 1.5 or later.
  112. Commons IO 1.4 requires JDK 1.3 or later.
  113. ==============================================================================
  114. Apache Commons IO Version 2.4
  115. ==============================================================================
  116. Changes in this version include:
  117. New features:
  118. o IO-269: Tailer locks file from deletion/rename on Windows. Thanks to
  119. sebb.
  120. o IO-333: Export OSGi packages at version 1.x in addition to 2.x. Thanks
  121. to fmeschbe.
  122. o IO-320: Add XmlStreamReader support for UTF-32. Thanks to ggregory.
  123. o IO-331: BOMInputStream wrongly detects UTF-32LE_BOM files as
  124. UTF-16LE_BOM files in method getBOM(). Thanks to ggregory.
  125. o IO-327: Add byteCountToDisplaySize(BigInteger). Thanks to ggregory.
  126. o IO-326: Add new FileUtils.sizeOf[Directory] APIs to return BigInteger.
  127. Thanks to ggregory.
  128. o IO-325: Add IOUtils.toByteArray methods to work with URL and URI. Thanks
  129. to raviprak.
  130. o IO-324: Add missing Charset sister APIs to method that take a String
  131. charset name. Thanks to raviprak.
  132. Fixed Bugs:
  133. o IO-336: Yottabyte (YB) incorrectly defined in FileUtils. Thanks to
  134. rleavelle.
  135. o IO-279: Tailer erroneously considers file as new. Thanks to Sergio
  136. Bossa, Chris Baron.
  137. o IO-335: Tailer#readLines - incorrect CR handling.
  138. o IO-334: FileUtils.toURLs throws NPE for null parameter; document the
  139. behavior.
  140. o IO-332: Improve tailer's reading performance. Thanks to liangly.
  141. o IO-279: Improve Tailer performance with buffered reads (see IO-332).
  142. o IO-329: FileUtils.writeLines uses unbuffered IO. Thanks to tivv.
  143. o IO-319: FileUtils.sizeOfDirectory follows symbolic links. Thanks to
  144. raviprak.
  145. Compatibility with 2.3:
  146. Binary compatible: Yes.
  147. Source compatible: Yes.
  148. Semantic compatible: Yes.
  149. Compatibility with 2.2 and 1.4:
  150. Binary compatible: Yes.
  151. Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318.
  152. Semantic compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318.
  153. Commons IO 2.4 requires JDK 1.6 or later.
  154. Commons IO 2.3 requires JDK 1.6 or later.
  155. Commons IO 2.2 requires JDK 1.5 or later.
  156. Commons IO 1.4 requires JDK 1.3 or later.
  157. ==============================================================================
  158. Apache Commons IO Version 2.3
  159. ==============================================================================
  160. Changes in this version include:
  161. New features:
  162. o IO-322: Add and use class Charsets. Thanks to ggregory.
  163. o IO-321: ByteOrderMark UTF_32LE is incorrect. Thanks to ggregory.
  164. o IO-318: Add Charset sister APIs to method that take a String charset name. Thanks to ggregory.
  165. Compatibility with 2.2 and 1.4:
  166. Binary compatible: Yes.
  167. Source compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318.
  168. Semantic compatible: No, see the rare case in https://issues.apache.org/jira/browse/IO-318.
  169. Commons IO 2.3 requires JDK 1.6 or later.
  170. Commons IO 2.2 requires JDK 1.5 or later.
  171. Commons IO 1.4 requires JDK 1.3 or later.
  172. ==============================================================================
  173. Apache Commons IO Version 2.2
  174. ==============================================================================
  175. Changes in this version include:
  176. New features:
  177. o Add IOUTils.toBufferedReader(Reader) Issue: IO-313. Thanks to ggregory.
  178. o Allow applications to provide buffer (or size) for copyLarge methods. Issue: IO-308. Thanks to Manoj Mokashi.
  179. o New copyLarge() method in IOUtils that takes additional offset, length arguments Issue: IO-305. Thanks to Manoj Mokashi.
  180. o Use terabyte (TB), petabyte (PB) and exabyte (EB) in FileUtils.byteCountToDisplaySize(long size) Issue: IO-287. Thanks to Ron Kuris, Gary Gregory.
  181. o FileUtils.listFiles() doesn't return directories Issue: IO-173. Thanks to Marcos Vinícius da Silva.
  182. o CharSequenceInputStream to efficiently stream content of a CharSequence Issue: IO-297. Thanks to Oleg Kalnichevski.
  183. o The second constructor of Tailer class does not pass 'delay' to the third one Issue: IO-304. Thanks to liangly.
  184. o TeeOutputStream does not call branch.close() when main.close() throws an exception Issue: IO-303. Thanks to fabian.barney.
  185. o ArrayIndexOutOfBoundsException in BOMInputStream when reading a file without BOM multiple times Issue: IO-302. Thanks to jsteuerwald, detinho.
  186. o Add IOUtils.closeQuietly(Selector) necessary Issue: IO-301. Thanks to kaykay.unique.
  187. o IOUtils.closeQuietly() should take a ServerSocket as a parameter Issue: IO-292. Thanks to sebb.
  188. o Add read/readFully methods to IOUtils Issue: IO-290. Thanks to sebb.
  189. o Supply a ReversedLinesFileReader Issue: IO-288. Thanks to Georg Henzler.
  190. o Add new function FileUtils.directoryContains. Issue: IO-291. Thanks to ggregory.
  191. o FileUtils.contentEquals and IOUtils.contentEquals - Add option to ignore "line endings"
  192. Added contentEqualsIgnoreEOL methods to both classes Issue: IO-275. Thanks to CJ Aspromgos.
  193. Fixed Bugs:
  194. o IOUtils.read(InputStream/Reader) ignores the offset parameter Issue: IO-311. Thanks to Robert Muir.
  195. o CharSequenceInputStream(CharSequence s, Charset charset, int bufferSize) ignores bufferSize Issue: IO-312.
  196. o FileUtils.moveDirectoryToDirectory removes source directory if destination is a subdirectory Issue: IO-300.
  197. o ReaderInputStream#read(byte[] b, int off, int len) should check for valid parameters Issue: IO-307.
  198. o ReaderInputStream#read(byte[] b, int off, int len) should always return 0 for length == 0 Issue: IO-306.
  199. o "FileUtils#deleteDirectoryOnExit(File)" does not work Issue: IO-276. Thanks to nkami.
  200. o BoundedInputStream.read() treats max differently from BoundedInputStream.read(byte[]...) Issue: IO-273. Thanks to sebb.
  201. o Various methods of class 'org.apache.commons.io.FileUtils' incorrectly suppress 'java.io.IOException' Issue: IO-298. Thanks to Christian Schulte.
  202. Changes:
  203. o ReaderInputStream optimization: more efficient reading of small chunks of data Issue: IO-296. Thanks to Oleg Kalnichevski.
  204. Compatibility with 2.1 and 1.4:
  205. Binary compatible: Yes
  206. Source compatible: Yes
  207. Semantic compatible: Yes. Check the bug fixes section for semantic bug fixes
  208. Commons IO 2.2 requires a minimum of JDK 1.5.
  209. Commons IO 1.4 requires a minimum of JDK 1.3.
  210. ==============================================================================
  211. Apache Commons IO Version 2.1
  212. ==============================================================================
  213. New features:
  214. o Use standard Maven directory layout Issue: IO-285. Thanks to ggregory.
  215. o Add IOUtils API toString for URL and URI to get contents Issue: IO-284. Thanks to ggregory.
  216. o Add API FileUtils.copyFile(File input, OutputStream output) Issue: IO-282. Thanks to ggregory.
  217. o FileAlterationObserver has no getter for FileFilter Issue: IO-262.
  218. o Add FileUtils.getFile API with varargs parameter Issue: IO-261.
  219. o Add new APPEND parameter for writing string into files Issue: IO-182.
  220. o Add new read method "toByteArray" to handle InputStream with known size. Issue: IO-251. Thanks to Marco Albini.
  221. Fixed Bugs:
  222. o Dubious use of mkdirs() return code Issue: IO-280. Thanks to sebb.
  223. o ReaderInputStream enters infinite loop when it encounters an unmappable character Issue: IO-277.
  224. o FileUtils.moveFile() JavaDoc should specify FileExistsException thrown Issue: IO-264.
  225. o ClassLoaderObjectInputStream does not handle Proxy classes Issue: IO-260.
  226. o Tailer returning partial lines when reaching EOF before EOL Issue: IO-274. Thanks to Frank Grimes.
  227. o FileUtils.copyFile() throws IOException when copying large files to a shared directory (on Windows) Issue: IO-266. Thanks to Igor Smereka.
  228. o FileSystemUtils.freeSpaceKb throws exception for Windows volumes with no visible files.
  229. Improve coverage by also looking for hidden files. Issue: IO-263. Thanks to Gil Adam.
  230. Changes:
  231. o FileAlterationMonitor.stop(boolean allowIntervalToFinish) Issue: IO-259.
  232. ==============================================================================
  233. Apache Commons IO Package 2.0.1
  234. ==============================================================================
  235. Compatibility with 2.0 and 1.4
  236. ------------------------------
  237. Binary compatible - Yes
  238. Source compatible - Yes
  239. Semantic compatible - Yes
  240. Check the bug fixes section for semantic bug fixes
  241. Commons IO 2.0.1 requires a minimum of JDK 1.5
  242. (Commons IO 1.4 had a minimum of JDK 1.3)
  243. Enhancements from 2.0
  244. ---------------------
  245. * [IO-256] - Provide thread factory for FileAlternationMonitor
  246. Bug fixes from 2.0
  247. ------------------
  248. * [IO-257] - BOMInputStream.read(byte[]) can return 0 which it should not
  249. * [IO-258] - XmlStreamReader consumes the stream during encoding detection
  250. ==============================================================================
  251. Apache Commons IO Package 2.0
  252. ==============================================================================
  253. Compatibility with 1.4
  254. ----------------------
  255. Binary compatible - Yes
  256. Source compatible - Yes
  257. Semantic compatible - Yes
  258. Check the bug fixes section for semantic bug fixes
  259. Commons IO 2.0 requires a minimum of JDK 1.5
  260. (Commons IO 1.4 had a minimum of JDK 1.3)
  261. Deprecations from 1.4
  262. ---------------------
  263. - IOUtils
  264. - write(StringBuffer, Writer) in favour of write(CharSequence, Writer)
  265. - write(StringBuffer, OutputStream) in favour of write(CharSequence, OutputStream)
  266. - write(StringBuffer, OutputStream, String) in favour of write(CharSequence, OutputStream, String)
  267. - FileFilterUtils
  268. - andFileFilter(IOFileFilter, IOFileFilter) in favour of and(IOFileFilter...)
  269. - orFileFilter(IOFileFilter, IOFileFilter) in favour of or(IOFileFilter...)
  270. Enhancements from 1.4
  271. ---------------------
  272. * [IO-140] Move minimum Java requirement from JDK 1.3 to JDK 1.5
  273. - use Generics
  274. - add new CharSequence write() flavour methods to IOUtils and FileUtils
  275. - replace StringBuffer with StringBuilder, where appropriate
  276. - add new Reader/Writer methods to ProxyReader and ProxyWriter
  277. - Annotate with @Override and @Deprecated
  278. * [IO-178] New BOMInputStream and ByteOrderMark implementations - to detect and optionally exclude an initial Byte Order mark (BOM)
  279. * [IO-197] New BoundedInputStream (copied from from Apache JackRabbit)
  280. * [IO-193] New Broken Input and Output streams
  281. * [IO-132] New File Listener/Monitor facility
  282. * [IO-158] New ReaderInputStream and WriterOutputStream implementations
  283. * [IO-139] New StringBuilder Writer implementation
  284. * [IO-192] New Tagged Input and Output streams
  285. * [IO-177] New Tailer class - simple implementation of the Unix "tail -f" functionality
  286. * [IO-162] New XML Stream Reader/Writer implementations (from ROME via plexus-utils)
  287. * [IO-142] Comparators - add facility to sort file lists/arrays
  288. * [IO-186] Comparators - new Composite and Directory File Comparator implementations
  289. * [IO-176] DirectoryWalker - add filterDirectoryContents() callback method for filtering directory contents
  290. * [IO-210] FileFilter - new Magic Number FileFilter
  291. * [IO-221] FileFilterUtils - add methods for suffix and prefix filters which take an IOCase object
  292. * [IO-232] FileFilterUtils - add method for name filters which take an IOCase object
  293. * [IO-229] FileFilterUtils - add varargs and() and or() methods
  294. * [IO-198] FileFilterUtils - add ability to apply file filters to collections and arrays
  295. * [IO-156] FilenameUtils - add normalize() and normalizeNoEndSeparator() methods which allow the separator character to be specified
  296. * [IO-194] FileSystemUtils - add freeSpaceKb() method with no input arguments
  297. * [IO-185] FileSystemUtils - add freeSpaceKb() methods that take a timeout parameter - fixes freeSpaceWindows() blocks
  298. * [IO-155] FileUtils - use NIO to copy files
  299. * [IO-168] FileUtils - add new isSymlink() method
  300. * [IO-219] FileUtils - throw FileExistsException when moving a file or directory if the destination already exists
  301. * [IO-234] FileUtils - add Methods for retrieving System User/Temp directories/paths
  302. * [IO-208] FileUtils - add timeout (connection and read) support for copyURLToFile() method
  303. * [IO-238] FileUtils - add sizeOf(File) method
  304. * [IO-181] LineIterator now implements Iterable
  305. * [IO-224] IOUtils - add closeQuietly(Closeable) and closeQuietly(Socket) methods
  306. * [IO-203] IOUtils - add skipFully() method for InputStreams
  307. * [IO-137] IOUtils and ByteArrayOutputStream - add toBufferedInputStream() method to avoid unnecessary array allocation/copy
  308. * [IO-195] Proxy streams/Reader/Writer - provide exception handling methods
  309. * [IO-211] Proxy Input/Output streams - add pre/post processing support
  310. * [IO-242] Proxy Reader/Writer - add pre/post processing support
  311. Bug fixes from 1.4
  312. ------------------
  313. * [IO-214] ByteArrayOutputStream - fix inconsistent synchronization of fields
  314. * [IO-201] Counting Input/Output streams - fix inconsistent synchronization
  315. * [IO-159] FileCleaningTracker - fix remove() never returns null
  316. * [IO-220] FileCleaningTracker - fix Vector performs badly under load
  317. * [IO-167] FilenameUtils - fix case-insensitive string handling in FilenameUtils and FilesystemUtils
  318. * [IO-179] FilenameUtils - fix StringIndexOutOfBounds exception in getPathNoEndSeparator()
  319. * [IO-248] FilenameUtils - fix getFullPathNoEndSeparator() returns empty while path is a one level directory
  320. * [IO-246] FilenameUtils - fix wildcardMatch gives incorrect results
  321. * [IO-187] FileSystemUtils - fix freeSpaceKb() doesn't work with relative paths on Linux
  322. * [IO-160] FileSystemUtils - fix freeSpace() fails on solaris
  323. * [IO-209] FileSystemUtils - fix freeSpaceKb() fails to return correct size for a windows mount point
  324. * [IO-163] FileUtils - fix toURLs() using deprecated method of conversion to URL
  325. * [IO-168] FileUtils - fix Symbolic links followed when deleting directory
  326. * [IO-231] FileUtils - fix wrong exception message generated in isFileNewer() method
  327. * [IO-207] FileUtils - fix race condition in forceMkdir() method
  328. * [IO-217] FileUtils - fix copyDirectoryToDirectory() makes infinite loops
  329. * [IO-166] FileUtils - fix URL decoding in toFile(URL)
  330. * [IO-190] FileUtils - fix copyDirectory not preserving lastmodified date on sub-directories
  331. * [IO-240] FileFilterUtils - ensure cvsFilter and svnFilter are only created once.
  332. * [IO-175] IOUtils - fix copyFile() issues with very large files
  333. * [IO-191] Improvements from static analysis
  334. * [IO-216] LockableFileWriter - delete files quietly when an exception is thrown during initialization
  335. * [IO-243] SwappedDataInputStream - fix readBoolean is inverted
  336. * [IO-235] Tests - remove unused YellOnFlushAndCloseOutputStream from CopyUtilsTest
  337. * [IO-161] Tests - fix FileCleaningTrackerTestCase hanging
  338. Documentation changes from 1.4
  339. ------------------------------
  340. * [IO-183 FilenameUtils.getExtension() method documentation improvements
  341. * [IO-226 FileUtils.byteCountToDisplaySize() documentation corrections
  342. * [IO-205 FileUtils.forceMkdir() documentation improvements
  343. * [IO-215 FileUtils copy file/directory improve documentation regarding preserving the last modified date
  344. * [IO-189 HexDump.dump() method documentation improvements
  345. * [IO-171 IOCase document that it assumes there are only two OSes: Windows and Unix
  346. * [IO-223 IOUtils.copy() documentation corrections
  347. * [IO-247 IOUtils.closeQuietly() improve documentation with examples
  348. * [IO-202 NotFileFilter documentation corrections
  349. * [IO-206 ProxyInputStream - fix misleading parameter names
  350. * [IO-212 ProxyInputStream.skip() documentation corrections
  351. ==============================================================================
  352. Apache Commons IO Version 1.4
  353. ==============================================================================
  354. Compatibility with 1.3.2
  355. ------------------------
  356. Binary compatible - Yes
  357. Source compatible - Yes
  358. Semantic compatible - Yes
  359. Check the bug fixes section for semantic bug fixes
  360. Commons IO 1.4 introduces four new implementations which depend on JDK 1.4 features
  361. (CharSequenceReader, FileWriterWithEncoding, IOExceptionWithCause and RegexFileFilter).
  362. It has been built with the JDK source and target options set to JDK 1.3 and, except for
  363. those implementations, can be used with JDK 1.3 (see IO IO-127).
  364. Deprecations from 1.3.2
  365. -----------------------
  366. - FileCleaner deprecated in favour of FileCleaningTracker [see IO-116]
  367. Bug fixes from 1.3.2
  368. --------------------
  369. - FileUtils
  370. - forceDelete of orphaned Softlinks does not work [IO-147]
  371. - Infinite loop on FileUtils.copyDirectory when the destination directory is within
  372. the source directory [IO-141]
  373. - Add a copyDirectory() method that makes use of FileFilter [IO-105]
  374. - Add moveDirectory() and moveFile() methods [IO-77]
  375. - HexDump
  376. - HexDump's use of static StringBuffers isn't thread-safe [IO-136]
  377. Enhancements from 1.3.2
  378. -----------------------
  379. - FileUtils
  380. - Add a deleteQuietly method [IO-135]
  381. - FilenameUtils
  382. - Add file name extension separator constants[IO-149]
  383. - IOExceptionWithCause [IO-148]
  384. - Add a new IOException implementation with constructors which take a cause
  385. - TeeInputStream [IO-129]
  386. - Add new Tee input stream implementation
  387. - FileWriterWithEncoding [IO-153]
  388. - Add new File Writer implementation that accepts an encoding
  389. - CharSequenceReader [IO-138]
  390. - Add new Reader implementation that handles any CharSequence (String,
  391. StringBuffer, StringBuilder or CharBuffer)
  392. - ThesholdingOuputStream [IO-121]
  393. - Add a reset() method which sets the count of the bytes written back to zero.
  394. - DeferredFileOutputStream [IO-130]
  395. - Add support for temporary files
  396. - ByteArrayOutputStream
  397. - Add a new write(InputStream) method [IO-152]
  398. - New Closed Input/Output stream implementations [IO-122]
  399. - AutoCloseInputStream - automatically closes and discards the underlying input stream
  400. - ClosedInputStream - returns -1 for any read attempts
  401. - ClosedOutputStream - throws an IOException for any write attempts
  402. - CloseShieldInputStream - prevents the underlying input stream from being closed.
  403. - CloseShieldOutputStream - prevents the underlying output stream from being closed.
  404. - Add Singleton Constants to several stream classes [IO-143]
  405. - PrefixFileFilter [IO-126]
  406. - Add faciltiy to specify case sensitivity on prefix matching
  407. - SuffixFileFilter [IO-126]
  408. - Add faciltiy to specify case sensitivity on suffix matching
  409. - RegexFileFilter [IO-74]
  410. - Add new regular expression file filter implementation
  411. - Make IOFileFilter implementations Serializable [IO-131]
  412. - Improve IOFileFilter toString() methods [IO-120]
  413. - Make fields final so classes are immutable/threadsafe [IO-133]
  414. - changes to Age, Delegate, Name, Not, Prefix, Regex, Size, Suffix and Wildcard IOFileFilter
  415. implementations.
  416. - IOCase
  417. - Add a compare method to IOCase [IO-144]
  418. - Add a package of java.util.Comparator implementations for files [IO-145]
  419. - DefaultFileComparator - compare files using the default File.compareTo(File) method.
  420. - ExtensionFileComparator - compares files using file name extensions.
  421. - LastModifiedFileComparator - compares files using the last modified date/time.
  422. - NameFileComparator - compares files using file names.
  423. - PathFileComparator - compares files using file paths.
  424. - SizeFileComparator - compares files using file sizes.
  425. ==============================================================================
  426. Apache Commons IO Version 1.3.2
  427. ==============================================================================
  428. Compatibility with 1.3.1
  429. ----------------------
  430. Binary compatible - Yes
  431. Source compatible - Yes
  432. Semantic compatible - Yes
  433. Compatibility with 1.3
  434. ----------------------
  435. Binary compatible - No
  436. See [IO-113]
  437. Source compatible - No
  438. See [IO-113]
  439. Semantic compatible - Yes
  440. Enhancements since 1.3.1
  441. ------------------------
  442. - Created the FileCleaningTracker, basically a non-static version of the
  443. FileCleaner, which can be controlled by the user. [IO-116]
  444. - The FileCleaner is deprecated.
  445. Bug fixes from 1.3.1
  446. --------------------
  447. - Some tests, which are implicitly assuming a Unix-like file system, are
  448. now skipped on Windows. [IO-115]
  449. - EndianUtils
  450. - Both readSwappedUnsignedInteger(...) methods could return negative
  451. numbers due to int/long casting. [IO-117]
  452. Bug fixes from 1.3
  453. ------------------
  454. - FileUtils
  455. - NPE in openOutputStream(File) when file has no parent in path [IO-112]
  456. - readFileToString(File) is not static [IO-113]
  457. ==============================================================================
  458. Apache Commons IO Version 1.3.1
  459. ==============================================================================
  460. Compatibility with 1.3
  461. ----------------------
  462. Binary compatible - No
  463. See [IO-113]
  464. Source compatible - No
  465. See [IO-113]
  466. Semantic compatible - Yes
  467. Bug fixes from 1.3
  468. ------------------
  469. - FileUtils
  470. - NPE in openOutputStream(File) when file has no parent in path [IO-112]
  471. - readFileToString(File) is not static [IO-113]
  472. ==============================================================================
  473. Apache Commons IO Version 1.3
  474. ==============================================================================
  475. Compatibility with 1.2
  476. ----------------------
  477. Binary compatible - Yes
  478. Source compatible - Yes
  479. Semantic compatible - Yes
  480. Check the bug fixes section for semantic bug fixes
  481. Deprecations from 1.2
  482. ---------------------
  483. - WildcardFilter deprecated, replaced by WildcardFileFilter
  484. - old class only accepted files, thus had a confusing dual purpose
  485. - FileSystemUtils.freeSpace deprecated, replaced by freeSpaceKb
  486. - freeSpace returns a result that varies by operating system and
  487. thus isn't that useful
  488. - freeSpaceKb returns much better and more consistent results
  489. - freeSpaceKb existed in v1.2, so this is a gentle cutover
  490. Bug fixes from 1.2
  491. ------------------
  492. - LineIterator now implements Iterator
  493. - It was always supposed to...
  494. - FileSystemUtils.freeSpace/freeSpaceKb [IO-83]
  495. - These should now work on AIX and HP-UX
  496. - FileSystemUtils.freeSpace/freeSpaceKb [IO-90]
  497. - Avoid infinite looping in Windows
  498. - Catch more errors with nice messages
  499. - FileSystemUtils.freeSpace [IO-91]
  500. - This is now documented not to work on SunOS 5
  501. - FileSystemUtils [IO-93]
  502. - Fixed resource leak leading to 'Too many open files' error
  503. - Previously did not destroy Process instances (as JDK Javadoc is so poor)
  504. - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4801027
  505. - FileUtils.touch [IO-100]
  506. - The touch method previously gave no indication when the file could not
  507. be touched successfully (such as due to access restrictions) - it now
  508. throws an IOException if the last modified date cannot be changed
  509. - FileCleaner
  510. - This now handles the situation where an error occurs when deleting the file
  511. - IOUtils.copy [IO-84]
  512. - Copy methods could return inaccurate byte/char count for large streams
  513. - The copy(InputStream, OutputStream) method now returns -1 if the count is greater than an int
  514. - The copy(Reader, Writer) method now throws now returns -1 if the count is greater than an int
  515. - Added a new copyLarge(InputStream, OutputStream) method that returns a long
  516. - Added a new copyLarge(Reader, Writer) method that returns a long
  517. - CountingInputStream/CountingOutputStream [IO-84]
  518. - Methods were declared as int thus the count was innacurate for large streams
  519. - new long based methods getByteCount()/resetByteCount() added
  520. - existing methods changed to throw an exception if the count is greater than an int
  521. - FileBasedTestCase
  522. - Fixed bug in compare content methods identified by GNU classpath
  523. - EndianUtils.writeSwappedLong(byte[], int) [IO-101]
  524. - An int overrun in the bit shifting when it should have been a long
  525. - EndianUtils.writeSwappedLong(InputStream) [IO-102]
  526. - The return of input.read(byte[]) was not being checked to ensure all 8 bytes were read
  527. Enhancements from 1.2
  528. ---------------------
  529. - DirectoryWalker [IO-86]
  530. - New class designed for subclassing to walk through a set of files.
  531. DirectoryWalker provides the walk of the directories, filtering of
  532. directories and files, and cancellation support. The subclass must provide
  533. the specific behaviour, such as text searching or image processing.
  534. - IOCase
  535. - New class/enumeration for case-sensitivity control
  536. - FilenameUtils
  537. - New methods to handle case-sensitivity
  538. - wildcardMatch - new method that has IOCase as a parameter
  539. - equals - new method that has IOCase as a parameter
  540. - FileUtils [IO-108] - new default encoding methods for:
  541. - readFileToString(File)
  542. - readLines(File)
  543. - lineIterator(File)
  544. - writeStringToFile(File, String)
  545. - writeLines(File, Collection)
  546. - writeLines(File, Collection, String)
  547. - FileUtils.openOutputStream [IO-107]
  548. - new method to open a FileOutputStream, creating parent directories if required
  549. - FileUtils.touch
  550. - FileUtils.copyURLToFile
  551. - FileUtils.writeStringToFile
  552. - FileUtils.writeByteArrayToFile
  553. - FileUtils.writeLines
  554. - enhanced to create parent directories if required
  555. - FileUtils.openInputStream [IO-107]
  556. - new method to open a FileInputStream, providing better error messages than the JDK
  557. - FileUtils.isFileOlder
  558. - new methods to check if a file is older (i.e. isFileOlder()) - counterparts
  559. to the existing isFileNewer() methods.
  560. - FileUtils.checksum, FileUtils.checksumCRC32
  561. - new methods to create a checksum of a file
  562. - FileUtils.copyFileToDirectory [IO-104]
  563. - new variant that optionally retains the file date
  564. - FileDeleteStrategy
  565. - FileCleaner [IO-56,IO-70]
  566. - FileDeleteStrategy is a strategy for handling file deletion
  567. - This can be used as a calback in FileCleaner
  568. - Together these allow FileCleaner to do a forceDelete to kill directories
  569. - FileCleaner.exitWhenFinished [IO-99]
  570. - A new method that allows the internal cleaner thread to be cleanly terminated
  571. - WildcardFileFilter
  572. - Replacement for WildcardFilter
  573. - Accepts both files and directories
  574. - Ability to control case-sensitivity
  575. - NameFileFilter
  576. - Ability to control case-sensitivity
  577. - FileFileFilter
  578. - New IOFileFilter implementation
  579. - Accepts files where File.isFile() is true
  580. - In other words it filters out directories
  581. - Singleton instance provided (FILE)
  582. - CanReadFileFilter
  583. - New IOFileFilter implementation
  584. - Accepts files where File.canRead() is true
  585. - Singleton instances provided (CAN_READ/CANNOT_READ/READ_ONLY)
  586. - CanWriteFileFilter
  587. - New IOFileFilter implementation
  588. - Accepts files where File.canWrite() is true
  589. - Singleton instances provided (CAN_WRITE/CANNOT_WRITE)
  590. - HiddenFileFilter
  591. - New IOFileFilter implementation
  592. - Accepts files where File.isHidden() is true
  593. - Singleton instances provided (HIDDEN/VISIBLE)
  594. - EmptyFileFilter
  595. - New IOFileFilter implementation
  596. - Accepts files or directories that are empty
  597. - Singleton instances provided (EMPTY/NOT_EMPTY)
  598. - TrueFileFilter/FalseFileFilter/DirectoryFileFilter
  599. - New singleton instance constants (TRUE/FALSE/DIRECTORY)
  600. - The new constants are more JDK 1.5 friendly with regards to static imports
  601. (whereas if everything uses INSTANCE, then they just clash)
  602. - The old INSTANCE constants are still present and have not been deprecated
  603. - FileFilterUtils.sizeRangeFileFilter
  604. - new sizeRangeFileFilter(long minimumSize, long maximumSize) method which
  605. creates a filter that accepts files within the specified size range.
  606. - FileFilterUtils.makeDirectoryOnly/makeFileOnly
  607. - two new methods that decorate a file filter to make it apply to
  608. directories only or files only
  609. - NullWriter
  610. - New writer that acts as a sink for all data, as per /dev/null
  611. - NullInputStream
  612. - New input stream that emulates a stream of a specified size
  613. - NullReader
  614. - New reader that emulates a reader of a specified size
  615. - ByteArrayOutputStream [IO-97]
  616. - Performance enhancements
  617. ==============================================================================
  618. Apache Commons IO Version 1.2
  619. ==============================================================================
  620. Compatibility with 1.1
  621. ----------------------
  622. Binary compatible - Yes
  623. Source compatible - Yes
  624. Semantic compatible - Yes
  625. Deprecations from 1.1
  626. ---------------------
  627. Bug fixes from 1.1
  628. ------------------
  629. - FileSystemUtils.freeSpace(drive)
  630. Fix to allow Windows based command to function in French locale
  631. - FileUtils.read*
  632. Increase certainty that files are closed in case of error
  633. - LockableFileWriter
  634. Locking mechanism was broken and only provided limited protection [38942]
  635. File deletion and locking in case of constructor error was broken
  636. Enhancements from 1.1
  637. ---------------------
  638. - AgeFileFilter/SizeFileFilter
  639. New file filters that compares against the age and size of the file
  640. - FileSystemUtils.freeSpaceKb(drive)
  641. New method that unifies result to be in kilobytes [38574]
  642. - FileUtils.contentEquals(File,File)
  643. Performance improved by adding length and file location checking
  644. - FileUtils.iterateFiles
  645. Two new method to provide direct access to iterators over files
  646. - FileUtils.lineIterator
  647. IOUtils.lineIterator
  648. New methods to provide an iterator over the lines in a file [38083]
  649. - FileUtils.copyDirectoryToDirectory
  650. New method to copy a directory to within another directory [36315]
  651. ==============================================================================
  652. Apache Commons IO Version 1.1
  653. ==============================================================================
  654. Incompatible changes from 1.0
  655. -----------------------------
  656. Binary compatible - Yes
  657. Source compatible - Yes
  658. Semantic compatible - Yes, except:
  659. - FileUtils.writeStringToFile()
  660. A null encoding previously used 'ISO-8859-1', now it uses the platform default
  661. Generally this will make no difference
  662. - LockableFileWriter
  663. Improved validation and now create directories if necesssary
  664. plus these bug fixes may affect you semantically:
  665. - FileUtils.touch() (Bug fix 29821)
  666. Now creates the file if it did not previously exist
  667. - FileUtils.toFile(URL) (Bug fix 32575)
  668. Now handles escape syntax such as %20
  669. - FileUtils.sizeOfDirectory() (Bug fix 36801)
  670. May now return a size of 0 if the directory is security restricted
  671. Deprecations from 1.0
  672. ---------------------
  673. - CopyUtils has been deprecated.
  674. Its methods have been moved to IOUtils.
  675. The new IOUtils methods handle nulls better, and have clearer names.
  676. - IOUtils.toByteArray(String) - Use {@link String#getBytes()}
  677. - IOUtils.toString(byte[]) - Use {@link String#String(byte[])}
  678. - IOUtils.toString(byte[],String) - Use {@link String#String(byte[],String)}
  679. Bug fixes from 1.0
  680. ------------------
  681. - FileUtils - touch() [29821]
  682. Now creates the file if it did not previously exist
  683. - FileUtils - toFile(URL) [32575]
  684. Now handles escape syntax such as %20
  685. - FileFilterUtils - makeCVSAware(IOFileFilter) [33023]
  686. Fixed bug that caused method to be completely broken
  687. - CountingInputStream [33336]
  688. Fixed bug that caused the count to reduce by one at the end of the stream
  689. - CountingInputStream - skip(long) [34311]
  690. Bytes from calls to this method were not previously counted
  691. - NullOutputStream [33481]
  692. Remove unnecessary synchronization
  693. - AbstractFileFilter - accept(File, String) [30992]
  694. Fixed broken implementation
  695. - FileUtils [36801]
  696. Previously threw NPE when listing files in a security restricted directory
  697. Now throw IOException with a better message
  698. - FileUtils - writeStringToFile()
  699. Null encoding now correctly uses the platform default
  700. Enhancements from 1.0
  701. ---------------------
  702. - FilenameUtils - new class [33303,29351]
  703. A static utility class for working with filenames
  704. Seeks to ease the pain of developing on Windows and deploying on Unix
  705. - FileSystemUtils - new class [32982,36325]
  706. A static utility class for working with file systems
  707. Provides one method at present, to get the free space on the filing system
  708. - IOUtils - new public constants
  709. Constants for directory and line separators on Windows and Unix
  710. - IOUtils - toByteArray(Reader,encoding)
  711. Handles encodings when reading to a byte array
  712. - IOUtils - toCharArray(InputStream) [28979]
  713. - toCharArray(InputStream,encoding)
  714. - toCharArray(Reader)
  715. Reads a stream/reader into a charatcter array
  716. - IOUtils - readLines(InputStream) [36214]
  717. - readLines(InputStream,encoding)
  718. - readLines(Reader)
  719. Reads a stream/reader line by line into a List of Strings
  720. - IOUtils - toInputStream(String) [32958]
  721. - toInputStream(String,encoding)
  722. Creates an input stream that uses the string as a source of data
  723. - IOUtils - writeLines(Collection,lineEnding,OutputStream) [36214]
  724. - writeLines(Collection,lineEnding,OutputStream,encoding)
  725. - writeLines(Collection,lineEnding,Writer)
  726. Writes a collection to a stream/writer line by line
  727. - IOUtils - write(...)
  728. Write data to a stream/writer (moved from CopyUtils with better null handling)
  729. - IOUtils - copy(...)
  730. Copy data between streams (moved from CopyUtils with better null handling)
  731. - IOUtils - contentEquals(Reader,Reader)
  732. Method to compare the contents of two readers
  733. - FileUtils - toFiles(URL[])
  734. Converts an array of URLs to an array of Files
  735. - FileUtils - copyDirectory() [32944]
  736. New methods to copy a directory
  737. - FileUtils - readFileToByteArray(File)
  738. Reads an entire file into a byte array
  739. - FileUtils - writeByteArrayToFile(File,byte[])
  740. Writes a byte array to a file
  741. - FileUtils - readLines(File,encoding) [36214]
  742. Reads a file line by line into a List of Strings
  743. - FileUtils - writeLines(File,encoding,List)
  744. writeLines(File,encoding,List,lineEnding)
  745. Writes a collection to a file line by line
  746. - FileUtils - EMPTY_FILE_ARRAY
  747. Constant for an empty array of File objects
  748. - ConditionalFileFilter - new interface [30705]
  749. Defines the behaviour of list based filters
  750. - AndFileFilter, OrFileFilter [30705]
  751. Now support a list of filters to and/or
  752. - WildcardFilter [31115]
  753. New filter that can match using wildcard file names
  754. - FileFilterUtils - makeSVNAware(IOFileFilter)
  755. New method, like makeCVSAware, that ignores Subversion source control directories
  756. - ClassLoaderObjectInputStream
  757. An ObjectInputStream that supports a ClassLoader
  758. - CountingInputStream,CountingOutputStream - resetCount() [28976]
  759. Adds the ability to reset the count part way through reading/writing the stream
  760. - DeferredFileOutputStream - writeTo(OutputStream) [34173]
  761. New method to allow current contents to be written to a stream
  762. - DeferredFileOutputStream [34142]
  763. Performance optimizations avoiding double buffering
  764. - LockableFileWriter - encoding support [36825]
  765. Add support for character encodings to LockableFileWriter
  766. Improve the validation
  767. Create directories if necesssary
  768. - IOUtils and EndianUtils are no longer final [28978]
  769. Allows developers to have subclasses if desired
  770. ==============================================================================
  771. Feedback
  772. ==============================================================================
  773. Open source works best when you give feedback:
  774. http://commons.apache.org/io/
  775. Please direct all bug reports to JIRA
  776. http://issues.apache.org/jira/browse/IO
  777. Or subscribe to the commons-user mailing list (prefix emails by [io])
  778. http://commons.apache.org/mail-lists.html
  779. The Commons-IO Team