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 2026/03/05 00:50:29 UTC

(poi) branch trunk updated: add password support

This is an automated email from the ASF dual-hosted git repository.

fanningpj pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git


The following commit(s) were added to refs/heads/trunk by this push:
     new f669cec72f add password support
f669cec72f is described below

commit f669cec72f74ce09cae74a0d840b1c780b627871
Author: PJ Fanning <pj...@users.noreply.github.com>
AuthorDate: Thu Mar 5 01:50:22 2026 +0100

    add password support
---
 .../apache/poi/hwpf/extractor/WordExtractor.java   | 40 +++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java
index 06c4a202ae..f6ecdf0871 100644
--- a/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java
+++ b/poi-scratchpad/src/main/java/org/apache/poi/hwpf/extractor/WordExtractor.java
@@ -47,7 +47,18 @@ public final class WordExtractor implements POIOLE2TextExtractor {
      *            InputStream containing the word file
      */
     public WordExtractor( InputStream is ) throws IOException {
-        this(HWPFDocumentCore.verifyAndBuildPOIFS(is ) );
+        this(HWPFDocumentCore.verifyAndBuildPOIFS(is));
+    }
+
+    /**
+     * Create a new Word Extractor
+     *
+     * @param is InputStream containing the word file
+     * @param password as a char array (can be null)
+     * @since 6.0.0
+     */
+    public WordExtractor( InputStream is, char[] password ) throws IOException {
+        this(HWPFDocumentCore.verifyAndBuildPOIFS(is), password);
     }
 
     /**
@@ -60,10 +71,37 @@ public final class WordExtractor implements POIOLE2TextExtractor {
         this( new HWPFDocument( fs ) );
     }
 
+    /**
+     * Create a new Word Extractor
+     *
+     * @param fs POIFSFileSystem containing the word file
+     * @param password as a char array (can be null)
+     * @since 6.0.0
+     */
+    public WordExtractor( POIFSFileSystem fs, char[] password ) throws IOException {
+        this( new HWPFDocument( fs, password ) );
+    }
+
+    /**
+     * Create a new Word Extractor
+     *
+     * @param dir DirectoryNode containing the word file
+     */
     public WordExtractor( DirectoryNode dir ) throws IOException {
         this( new HWPFDocument( dir ) );
     }
 
+    /**
+     * Create a new Word Extractor
+     *
+     * @param dir DirectoryNode containing the word file
+     * @param password as a char array (can be null)
+     * @since 6.0.0
+     */
+    public WordExtractor( DirectoryNode dir, char[] password ) throws IOException {
+        this( new HWPFDocument( dir, password ) );
+    }
+
     /**
      * Create a new Word Extractor
      *


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org