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
0
votes
1 answer

Cant extract single files from Tar, 0kb size, Java

I have been created a application which shall extract single files from tar-archive. The application reads the *.tar properly, but when i try to extract files, the application just create new files with correct filename... The files is empty (0kb).…
user2734182
  • 1,835
  • 4
  • 17
  • 22
0
votes
1 answer

Use Apache commons-compress to automatically handle various compressed archives

I would like to use commons-compress to work with various compression/archive formats. However on first look it seems commons-compress only supports detecting some types of files, but only based on the first few bytes. Is there a way I can use…
centic
  • 15,565
  • 9
  • 68
  • 125
0
votes
1 answer

How to download WordPress with Java

I want to download WordPress with Java. My code looks like this: public void file(String surl, String pathToSave) throws IOException { URL url = new URL(surl); sun.net.www.protocol.http.HttpURLConnection con = (HttpURLConnection)…
benawad
  • 685
  • 7
  • 17
0
votes
0 answers

creating a gz file and adding the tar file into it

My task is to tar list of files and this tar should be kept in .gz file. I have succeeded in creating .tar file, but the next step like when creating .gz file I got an issue. After creating .gz file with a tar inside is converted into File format…
Yaswanth
  • 483
  • 1
  • 9
  • 25
0
votes
1 answer

Listing of files inside 7-zip archive takes some seconds to complete

I am trying to use the Apache Commons Compress to read the content of a 7-zip file. I'm not interested in reading/extracting the content, I just want to get the list of all the entries. I made this code, but with 4MB archives it takes 6 seconds to…
Vektor88
  • 4,841
  • 11
  • 59
  • 111
0
votes
1 answer

java.util.zip.ZipEntry and apache compress ZipEntry corrupt some image files

I have been using Spring's multipart uploader controllers to upload and store entries from zipped files, but I am finding that the occaisional PNG file being corrupted, where instead of begginning with something like "PNG..." in its byte[], it…
Michael Coxon
  • 3,337
  • 8
  • 46
  • 68
0
votes
2 answers

How can I encrypt java 7z archive?

I'm using Apache Commons Compress to compress files. How do I add a password to the archive so? public static void main(String args[]) throws FileNotFoundException, IOException { SevenZOutputFile sevenZOutput = new SevenZOutputFile(new…
sonik509
  • 119
  • 1
  • 11
0
votes
1 answer

Is this inputstream being closed?

I get some very odd errors when using org.apache.commons.compress to read embedded archive files and I suspect it's my inexperience that is haunting me. When running my code I get a variety of truncated zip file errors (along with other truncated…
nullByteMe
  • 6,141
  • 13
  • 62
  • 99
0
votes
1 answer

How do i create a "valid" unix TAR Archive in Windows with Java (apache compress)?

I'm trying to create a 'valid' tar.gz archive by using the apache commons compress librarys. The created archive will be read by an embedded device and has to be in the same format with the same file permissions i think. If i'm using Linux to create…
0
votes
1 answer

How to delete ZIP archive after decompressing with Commons Compress in Java?

I've written a program that decompresses a ZIP archive, then recursively decompresses or extracts archives found in it. The archives within the ZIP may be tar or ZIP archives and I can extract them just fine. After extracting the inner archives…
Sardtok
  • 449
  • 7
  • 18
0
votes
1 answer

How to get individual file contents from ZipArchiveInputStream using Apache commons compress library

I have org.apache.commons.compress.archivers.zip.ZipArchiveInputStream Object, from which I can get each ArchiveEntry item and get the individual file's metadata. But I need to know the way to get each file's contents as Blob. Using…
Kumaran
  • 19
  • 1
  • 3
-3
votes
2 answers

Unpack whole Tar easily in Java

Easiest way to unpack Tar (or BZip+Tar) archive in Java. Apache Commons Compress has classes for unpacking Tar. But you have to iterate through all archive entries and save each entry's InputStream to file. Is there way to simple unpack all files…
Aleks Ya
  • 859
  • 5
  • 15
  • 27
1 2 3 4 5
6