Skip to content

Commit

Permalink
TIKA-4199: replace deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
THausherr committed Feb 21, 2024
1 parent 1617c92 commit 0599afd
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,11 @@ public void parse(InputStream stream, ContentHandler handler, Metadata metadata,

SevenZFile sevenz;
try {
SevenZFile.Builder builder = new SevenZFile.Builder().setFile(tstream.getFile());
if (password == null) {
sevenz = new SevenZFile(tstream.getFile());
sevenz = builder.get();
} else {
sevenz = new SevenZFile(tstream.getFile(), password.toCharArray());
sevenz = builder.setPassword(password.toCharArray()).get();
}
} catch (PasswordRequiredException e) {
throw new EncryptedDocumentException(e);
Expand Down

0 comments on commit 0599afd

Please sign in to comment.