Questions tagged [apache-commons-compress]

Apache Commons Compress is a compression toolkit that supports several compression and archival formats not included with the Java programming language.

Apache Commons Compress is a component of the Apache Commons project. Apache Commons Compress is a compression and archival library, is open source software distributed under the Apache License, Version 2.0, and supports numerous formats including: ar, cpio, xz, and bzip2.

87 questions
3
votes
1 answer

java.util.zip.ZipException: invalid stored block lengths

I am trying to read a ZipArchiveEntry to String. I have the below code and i run into exception My code is as below StringWriter writer = new StringWriter(); IOUtils.copy(zipFile.getInputStream(zipArchiveEntry), writer, …
Vinod Jayachandran
  • 3,726
  • 8
  • 51
  • 88
3
votes
1 answer

android dlavikvm-heap out ot memory allocation upon XZ compression

I am trying to compress a tar to a tar.xz on API 2.3.3. No matter what I do I get this error: 06-09 20:56:32.230: V/CameraDemo(23418): filesPath -- > /mnt/sdcard/myimages 06-09 20:56:32.336: D/dalvikvm(23418): GC_FOR_ALLOC freed 75K, 2% free…
Jadeye
  • 3,551
  • 4
  • 47
  • 63
2
votes
1 answer

How to convert TarArchiveOutputStream to byte array without saving into file system

I have a byte array representation of a tar.gz file. I want to get the byte array representation of a new tar.gz file after adding a new config file. I wanted to do this entirely in the code itself without creating any files to the local disk. Below…
jsk
  • 23
  • 3
2
votes
1 answer

Exception happened when untarring the Tar file using Apache Commons compress

I am trying to untar the tar file to a map using Apache commons compress in Java. I am able to untar most of the tar files but few are failing with the below Exception. I am not sure what is causing the issue. is the tar file corrupted? I am able to…
sparker
  • 1,666
  • 4
  • 21
  • 35
2
votes
1 answer

Apache Commons Compress Cannot Resolve Class SeekableInMemoryByteChannel Prior to Android N

Whenever I try to use the SeekableInMemoryByteChannel class from the Apache commons-compress package the application crashes with a java.lang.NoClassDefFoundError: org.apache.commons.compress.utils.SeekableInMemoryByteChannel exception. The…
Kazimieras
  • 607
  • 4
  • 14
2
votes
1 answer

How can you read select few files from a tar file in s3 without having to download the tar?

You do not want to download the tar file. Just download select few files inside the tar. Does s3 provide any API to do this or is Apache Commons Compress my best bet?
Righto
  • 855
  • 3
  • 11
  • 32
2
votes
0 answers

Recursive zip file processing using apache commons compress library

I have been trying but unsuccessfully to recursively access a archive files using Apache commons compress in java. I have a recursive zip file with the inner zips being of any type, like tar, jar, bz2, gzip etc and of any depth eg: zip -> rar ->…
Nag
  • 21
  • 1
2
votes
1 answer

What is the best way to compare tar archives in junit testing

I am attempting to create jUnit tests for some code that generates tar files. During testing I will be creating a variety of tar files and comparing them to "Gold" tar images of the expected output. I have been struggling to create an…
Mike Storey
  • 1,029
  • 3
  • 11
  • 21
2
votes
1 answer

Creation of single zip containing multiple zips fails for ServletOutputStream

I am using commons compress to zip multiple files and send it the client from a Servlet. The files could be a combination of any type of files(text, video, audio, archives, images etc). I take the inputStream of file and write to ServletOutputStream…
Raj Saxena
  • 852
  • 10
  • 18
2
votes
2 answers

Decompressing tar file with Apache Commons Compress

I'm using Apache Commons Compress to create tar archives and decompress them. My problems start with this method: private void decompressFile(File file) throws IOException { logger.info("Decompressing " + file.getName()); …
David Moreno García
  • 4,423
  • 8
  • 49
  • 82
2
votes
1 answer

Unzip 64bit zip file with ColdFusion

I was using java.util.zip.ZipFile to unzip large files with ColdFusion. However, I am now getting this error: "invalid CEN header (bad signature)". I found a post that shows that this is related to zip 64 bit format and that I could use…
jessieloo
  • 1,759
  • 17
  • 24
1
vote
1 answer

Apache Commons Compress as solution to Zip Bomb

Java Code is implemented to uncompress zip file using java.util.zip library. Sonarqube reports Security Hotspots vulnerability as prone to "Zip Bomb" security issue with message "Make sure that expanding this archive file is safe here" in the line…
Vasanth Subramanian
  • 1,040
  • 1
  • 13
  • 32
1
vote
1 answer

What is this package source starting with gav:// and how to upgrade a package from this source?

Came across the following artefact in one of the docker images that I built. So, wondering what this package source (gav://) is and how can I upgrade it? gav://org.apache.commons:commons-compress:1.19
1
vote
0 answers

TestNG Unit Testing Tar and 7z

folder structure is here console output is here I'd like to write a test class for the 2 methods below package jfe; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import…
1
vote
1 answer

The jar libs\commons-compress-1.18.jar has a main class org.apache.commons.compress.archivers.Lister that does not match the declared main

I am developing a Javafx application and its ready for the build. In order to read and write excel files I,m using org.apache.commons.compress library (a jar file), which has a main class named Lister in it. Where as, my application has its own…