You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2021/10/09 13:21:25 UTC
svn commit: r1894069 -
/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
Author: fanningpj
Date: Sat Oct 9 13:21:25 2021
New Revision: 1894069
URL: http://svn.apache.org/viewvc?rev=1894069&view=rev
Log:
[bug-64542] allow file channel closing to be controlled by calling code
Modified:
poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
Modified: poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java?rev=1894069&r1=1894068&r2=1894069&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java (original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java Sat Oct 9 13:21:25 2021
@@ -174,10 +174,13 @@ public class POIFSFileSystem extends Blo
*
* <p>Note that with this constructor, you will need to call {@link #close()}
* when you're done to have the underlying Channel closed, as the channel is
- * kept open during normal operation to read the data out.</p>
+ * kept open during normal operation to read the data out. For legacy reasons,
+ * the channel is not closed if there is an error creating the POIFSFileSystem.</p>
*
* @param channel the FileChannel from which to read the data
* @throws IOException on errors reading, or on invalid data
+ * @see POIFSFileSystem(FileChannel, boolean, boolean) this constructor gives more control over whether to
+ * close the provided channel
*/
public POIFSFileSystem(FileChannel channel)
throws IOException {
@@ -190,11 +193,14 @@ public class POIFSFileSystem extends Blo
*
* <p>Note that with this constructor, you will need to call {@link #close()}
* when you're done to have the underlying Channel closed, as the channel is
- * kept open during normal operation to read the data out.</p>
+ * kept open during normal operation to read the data out. For legacy reasons,
+ * the channel is not closed if there is an error creating the POIFSFileSystem.</p>
*
* @param channel the FileChannel from which to read or read/write the data
* @param readOnly whether the POIFileSystem will only be used in read-only mode
* @throws IOException on errors reading, or on invalid data
+ * @see POIFSFileSystem(FileChannel, boolean, boolean) this constructor gives more control over whether to
+ * close the provided channel
*/
public POIFSFileSystem(FileChannel channel, boolean readOnly)
throws IOException {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org