commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Burch (JIRA)" <>
Subject [jira] [Created] (COMPRESS-298) Cleaner way to catch/detect Seven7 files which are password protected
Date Sun, 18 Jan 2015 23:01:34 GMT
Nick Burch created COMPRESS-298:

             Summary: Cleaner way to catch/detect Seven7 files which are password protected
                 Key: COMPRESS-298
             Project: Commons Compress
          Issue Type: Improvement
          Components: Archivers
    Affects Versions: 1.8.1
            Reporter: Nick Burch

Currently, if we open a password protected 7z file and call {{getNextEntry()}} on it, it will
blow up with an IOException with a specific string:

{code} Cannot read encrypted files without a password
	at org.apache.commons.compress.archivers.sevenz.AES256SHA256Decoder$1.init(
	at org.apache.commons.compress.archivers.sevenz.AES256SHA256Decoder$
	at org.tukaani.xz.rangecoder.RangeDecoderFromStream.<init>(Unknown Source)
	at org.tukaani.xz.LZMAInputStream.initialize(Unknown Source)
	at org.tukaani.xz.LZMAInputStream.initialize(Unknown Source)
	at org.tukaani.xz.LZMAInputStream.<init>(Unknown Source)
	at org.apache.commons.compress.archivers.sevenz.Coders$LZMADecoder.decode(
	at org.apache.commons.compress.archivers.sevenz.Coders.addDecoder(
	at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecoderStack(
	at org.apache.commons.compress.archivers.sevenz.SevenZFile.buildDecodingStream(
	at org.apache.commons.compress.archivers.sevenz.SevenZFile.getNextEntry(

It would be good if either a specific subtype of IOException could be thrown (which could
then be caught to differentiate this from other kinds of IO problems), or if a method could
be added to SevenZFile which could be called to see if a password is needed / given password
is correct

(If implemented, this would help make the code in Tika dealing with 7z files cleaner)

This message was sent by Atlassian JIRA

View raw message