diff options
author | PJ Fanning <fanningpj@apache.org> | 2021-10-09 13:21:25 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2021-10-09 13:21:25 +0000 |
commit | 6659536325b4976f709e95fa372f82bfcda6754c (patch) | |
tree | 09d25391ef839bb5b8552bd34a51bdaf91891b93 /poi/src | |
parent | e9b76ce3b1b960ee6e3f7b7ce30eaa024b20366d (diff) | |
download | poi-6659536325b4976f709e95fa372f82bfcda6754c.tar.gz poi-6659536325b4976f709e95fa372f82bfcda6754c.zip |
[bug-64542] allow file channel closing to be controlled by calling code
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894069 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi/src')
-rw-r--r-- | poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java b/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java index 1a625f38d0..e7ff65e01e 100644 --- a/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java +++ b/poi/src/main/java/org/apache/poi/poifs/filesystem/POIFSFileSystem.java @@ -174,10 +174,13 @@ public class POIFSFileSystem extends BlockStore * * <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 BlockStore * * <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 { |