Brunaldo
Brunaldo

Reputation: 3

Extracting large password protected 7zip files whilst streaming?

I have a requirement to unzip password protected 7zip files from AWS S3 to a container that has limited space.

The problem is I can't download the entire zip file and then attempt to extract it because there is not enough space assigned to the container and I am unable to change the size of the volume.

I was thinking of streaming and extracting the password protected file on the fly so that only the extracted file takes up space on the container.

At the moment I have attempted to do this with Apache Compress but I have been unsuccessful in doing so.

For instance you can attempt to build a SevenZipFile like so in Apache Compress

SevenZFile.builder()
            .setInputStream(inputStream)
            .setPassword(password)
            .get()

but this throws

java.lang.UnsupportedOperationException: InputStreamOrigin#getPath() for FileInputStream origin java.io.FileInputStream@3b30eec5

I am able to download the entire file and to extract it but this only works with smaller .7z files due to the space limitation.

I am open to using other Java libraries if they're free for commercial use.

Upvotes: 0

Views: 102

Answers (0)

Related Questions