You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2020/11/19 13:03:37 UTC

[tika] branch main updated: Remove deprecated method call in PackageParser (#365)

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

tallison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/main by this push:
     new ed73391  Remove deprecated method call in PackageParser (#365)
ed73391 is described below

commit ed73391ce867d82151578835611a5b063eac2abc
Author: Lee <55...@users.noreply.github.com>
AuthorDate: Thu Nov 19 21:03:28 2020 +0800

    Remove deprecated method call in PackageParser (#365)
    
    Method `SevenZFile` use byte[]-arg version for the password is deprecated.
    Use the char[]-arg version for the password instead.
---
 .../src/main/java/org/apache/tika/parser/pkg/PackageParser.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tika-parser-modules/tika-parser-pkg-module/src/main/java/org/apache/tika/parser/pkg/PackageParser.java b/tika-parser-modules/tika-parser-pkg-module/src/main/java/org/apache/tika/parser/pkg/PackageParser.java
index 0ad3c6b..519d503 100644
--- a/tika-parser-modules/tika-parser-pkg-module/src/main/java/org/apache/tika/parser/pkg/PackageParser.java
+++ b/tika-parser-modules/tika-parser-pkg-module/src/main/java/org/apache/tika/parser/pkg/PackageParser.java
@@ -246,7 +246,7 @@ public class PackageParser extends AbstractParser {
                     if (password == null) {
                         sevenz = new SevenZFile(tstream.getFile());
                     } else {
-                        sevenz = new SevenZFile(tstream.getFile(), password.getBytes("UnicodeLittleUnmarked"));
+                        sevenz = new SevenZFile(tstream.getFile(), password.toCharArray());
                     }
                 }catch(PasswordRequiredException e){
                     throw new EncryptedDocumentException(e);