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
1
vote
1 answer

uncompress ArchiveInputStream in memory

Is it possible that if an ArchiveEntry coming from an ArchiveInputStream in the apache commons compress lib is another Archive, that I could then uncompress that archiveEntry into memory? Thanks
Derek
  • 11,715
  • 32
  • 127
  • 228
0
votes
1 answer

How to get list of files in an archive file without download

I try to get list of file names in large archive files (zip, 7z, tar, rar etc.) located in remote server. I avoid to download files due to network cost. An alternative is to use an HTTP range request (1, 2, 3); however, each archive file type has a…
Alper M.
  • 143
  • 3
  • 8
0
votes
0 answers

Libgdx and android studio

EDIT: I fixed it, the problem was that I was not using the same android api and sdks as the ones used by libgdx. I am trying to build my first libgdx project on android studio but I get an error: A build operation failed. 'void…
0
votes
0 answers

Compress directory to tar.gz with Commons Compress remove parent directory

I'm running into a problem using the commons compress library to create a tar.gz of a directory. I have a directory structure that is as follows. parent/ child/ file1.raw file2.raw file3.raw I hope the compressed…
OP027
  • 1
  • 2
0
votes
1 answer

FileOutputStream(No such file or directory)(No such file or directory)

I am extracting a TarGz file and am getting a (No such file or directory) with the following line: FileOutputStream fos = new FileOutputStream(outputPath + entry.getName()); My code: private static void extractTarGz(String filePath, String…
0
votes
2 answers

How to create a .tar.gz file, RETAINING the same folder/directory structure, in Java

I am looking to create a .tar.gz file of the following folder/directory structure, while retaining the same folder/ directory structure ParentDir\ ChildDir1\ -file1 ChildDir2\ -file2 -file3 ChildDir3\ …
0
votes
0 answers

How to locally download a .tar.gz file on the server created using TarArchiveOutputStream

I am using the owner accepted best answer in Compress directory to tar.gz with Commons Compress for my project. I am able to create the .tar.gz file on the server, but I am unable to download it locally. ... File f = new File(path); …
0
votes
0 answers

SXSSFWorkbook "File contains corrupted data" Error using OpenXml after upgrading from 3.17 to 5.2 or 5.2.2

At first I thought the workbook is not disposed as in here : xlsx file content is corrupted... but this wasn’t the case. I was closing it explicitly by workbook .close(), I even had a workbook.dispose() I then switched to try-with-resource,none…
0
votes
0 answers

BZip2 "selectorMtf value too big" error when decompressing

I'm getting error "Corrupted input, selectorMtf value too big" when trying to decompress the string compressed by bzip2. Below is my decompress java code private void decompress() throws IOException { InputStream fin =…
Kingo Mostafa
  • 357
  • 5
  • 21
0
votes
1 answer

I'm getting a problem with apache commons compress

I'm getting this error while extracting a .7z protected file org.tukaani.xz.CorruptedInputException: Compressed data is corrupt and I'm using this code public static void unSevenZipFile(String from,String to,String pass) throws Exception { //…
0
votes
1 answer

org.tukaani.xz.CorruptedInputException: Compressed data is corrupt while extracting 7z archive File in java

Getting org.tukaani.xz.CorruptedInputException: Compressed data is corrupt error while extracting 7z file. i am using common-compress-1.21.jar and xz-1.9.jar.here is my code File f = new File("/home/local/Documents/7zFile/7zFile.7z"); …
user3629
  • 57
  • 8
0
votes
2 answers

Apache Commons Compress: ZipArchiveEntry.getUnixMode() always returns 0

When analyzing the resulting file, the value is written correctly so setUnixMode() probably works ok, but getUnixMode() always returns 0. Does anyone have any experience with this? File file = new File("Test.file"); ZipArchiveOutputStream…
Jolinar
  • 866
  • 8
  • 16
0
votes
1 answer

Random file access from a tar archive in java

How to do random file access from a tar archive in java? Using apache-commons-compress tarArchiveInputStream there is no method to get the specific file based on its tarArchiveEntry name. For each query for a file object(bytes[]) it is required to…
Arunavo
  • 34
  • 2
  • 8
0
votes
1 answer

Get specific file inputstream from TarArchiveInputStream

I have a tar file and which contains many files. I need to get a specific file from tar file and read data from that file. I am untaring file using the below code and I will read this returned input stream using some other function. private …
Vipin Gupta
  • 213
  • 3
  • 15
0
votes
1 answer

Apache Commons: UnsupportedZipFeatureException (LZMA)

I want to unzip .zip files (with .jpg files inside) that were created using Windows 10's zipping feature. First I tested it with Java 8's native util.zip.ZipEntry but kept getting an invalid CEN header (bad compression method) error, which seems to…
Neph
  • 1,823
  • 2
  • 31
  • 69