From ce04adaf4719cb34c650c522e96c2028f9b4f486 Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Thu, 11 Sep 2014 12:07:22 +0000 Subject: [PATCH] More from Daniel Bonniot from bug #56956 - Make the FileChannel default read-only too, more in keeping with 3.10 behaviour git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1624266 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java index fd3529af3a..f21f6a39a0 100644 --- a/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java +++ b/src/java/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.java @@ -167,20 +167,20 @@ public class NPOIFSFileSystem extends BlockStore /** *

Creates a POIFSFileSystem from an open FileChannel. This uses * less memory than creating from an InputStream. The stream will - * be used in read-write mode.

+ * be used in read-only mode.

* *

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.

* - * @param channel the FileChannel from which to read and write the data + * @param channel the FileChannel from which to read the data * * @exception IOException on errors reading, or on invalid data */ public NPOIFSFileSystem(FileChannel channel) throws IOException { - this(channel, null, false, false); + this(channel, true); } /** -- 2.39.5