Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
1 answer
29 views

Trying to read Split Zip File throws ZipException in zip4j

I am having a split zip file test_10G.zip.001 and test_10G.zip.002. I am trying to use isSplitArchive() Function from zip4j. But I am getting an exception saying Zip headers not found. Probably not a ...
Diliban B's user avatar
0 votes
0 answers
89 views

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 ...
Brunaldo's user avatar
1 vote
1 answer
204 views

Compress using 7zip with password protection in java

I have an encrypted file which I need to compress using 7zip with password protection. I couldn't find any useful reference online. I'm new to this zip file stuff and I don't have an idea if this ...
Thejus32's user avatar
  • 351
2 votes
1 answer
96 views

Unable to delete file after using SevenZip.openArchive method in java

In my endpoint I receive the content of a file as String in format base64. Unzipping works fine with SevenZip library, no problems there. But after executing this line archive = SevenZip.openInArchive(...
S H's user avatar
  • 117
0 votes
1 answer
556 views

Java code for unzip 7z file with password

I have tried to unzip the 7z file in Java code but I'm getting "Bad 7z signature" Any suggestions would be helpful.. I've used UTF-16LE and UTF-16 both throwing same error Below is the code ...
Pintu's user avatar
  • 1
-1 votes
1 answer
323 views

Compress a folder using 7-zip in Linux with Java

I have the following function in my code. public static void runExecutable(String filePath, String command, boolean commandLine, boolean wait) { InputStream inputStream = CommonMethods.class....
ThePiGuy's user avatar
0 votes
0 answers
215 views

7za command line from java process builder

I have a Docker container where the base image is Corretto 17. I have also installed p7zip in the image using 'yum install -y p7zip'. Additionally, I created a user, switched to that user, and copied ...
GouthamRio's user avatar
0 votes
0 answers
370 views

7z compression and AES 256 encryption in java

I am trying to write Java code which can compress any file in .7z format and encrypt it with AES 256. I need to compress and encrypt a file through Java code and send it to a user. They then ...
GouthamRio's user avatar
1 vote
0 answers
284 views

How to correctly unzip .7z archive with SevenZFile class?

I want to unzip a .7z archive but I'm facing a weird issue. Maybe I didn't understood well how to use the "SevenZFile" class from org.apache.commons:commons-compress:1.20. Here is my method ...
Louis Chabert's user avatar
0 votes
0 answers
229 views

Java 7 Zip-JBinding Truncated zip file extracted from ISO

I am using below code (link to full code) to extract zip file which is inside iso file using 7-zip-JBinding. for (ISimpleInArchiveItem item : simpleInArchive.getArchiveItems()) { ...
Anonymous Creator's user avatar
0 votes
1 answer
1k views

How to create password protected zip/7zip file using apache.compress

In my Android project, I'm using below dependency in my build.gradle file to support extraction/compression of archive files implementation 'org.apache.commons:commons-compress:1.21' I want to know ...
Astha Garg's user avatar
  • 1,122
0 votes
0 answers
1k views

Command to extract password protected zip file using p7zip

I'm using an open source GitHub project AndroidP7Zip which is an Android wrapper over p7zip to support zip, 7zip and other archive formats for Android project. From android side implementation we pass ...
Astha Garg's user avatar
  • 1,122
0 votes
1 answer
1k views

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(&...
user3629's user avatar
1 vote
1 answer
839 views

How to check if an InputStream 7Z archive file is password protected or not?

I have used commons-compress-1.21.jar File f = new File("/home/user/Desktop/test.7z"); SevenZFile sevenZFile = new SevenZFile(f); SevenZArchiveEntry entry = sevenZFile.getNextEntry(); ...
user3629's user avatar
0 votes
0 answers
438 views

How to extract 7z files content in String

I am trying to extract a 7z file which contains multiple XML entries. I am able to do this for zip format but for 7z its giving me error. For zip format I am using Enumeration to get the entries which ...
Vaishali Ahlawat's user avatar
1 vote
0 answers
74 views

Extracting 7z files as String fails with ArrayIndexOutofBoundsException -1

I am trying to extract 7z file containing XMLs as String, I am using below code: private static String getXML( InputStream in ) { String content = null; try { ...
Vaishali Ahlawat's user avatar
0 votes
1 answer
1k views

How to create 7z file with Password protection?

I am able to create a 7z file but want to create the file with a password, I tried with the set compression method but there is not an option to set the key, Please help me how I can create a password-...
Mitul Khamar's user avatar
0 votes
0 answers
127 views

sevenzipjbinding: How do I properly close file handles as they become unneeded?

We have an application that uses sevenzipjbinding to bundle and transport content. 99% of the time, everything goes smoothly, however there are some edge cases where these zip files contain upwards of ...
Mirrana's user avatar
  • 1,731
0 votes
2 answers
1k views

Extract 7z file in android

I am working on android application that requires extracting .7z files. I am getting error at the first step. All the parameters look fine in function call. I would be very thankful if someone could ...
Kumar's user avatar
  • 1
5 votes
1 answer
2k views

Spark Reading .7z files

I am trying to read the spark .7z files using scala or java. I dont find any appropriate methods or functionality. For the zip file, i am able to read as the ZipInputStream class takes a Input stream, ...
loneStar's user avatar
  • 4,000
1 vote
0 answers
61 views

Java un-compres 5G 7z file

I am trying to decompress a 5G text file with Apache commons compress version 1.9... public String unZipFile(String pathFileName, String saveFilePath) throws IOException { SevenZFile ...
Pedro Sosa's user avatar
5 votes
4 answers
2k views

Java 7zip compression of a String

I would like to compress an String manually defined to 7z in Java. So then I could convert it to base64. I found many examples compressing files to 7z and then saving into new File. I just try the ...
Asier Gomez's user avatar
  • 6,538
0 votes
0 answers
134 views

How to read only the names of files inside the 7zip file?

I have the requirement to read only the names of files inside 7zip file using java.I do not want to decompress the file . I String archiveFilename="002.7z"; SevenZFile sevenZFile = new ...
Mayank kumar's user avatar
1 vote
0 answers
3k views

How to unarchive a symbolic link from a .7z file, keeping it as symbolic link?

Trying to write java code to extract .7z file in Linux. My .7z file contains symbolic link, but after extraction symbolic links are converted to text files. How can I extract symbolic link from a .7z ...
Nilanjan's user avatar
3 votes
0 answers
183 views

Java NIO 7-Zip FileSystem Provider

I've been trying to find a 7-ZIP FileSystem Provider for Java NIO, unsuccessfully. I'm a bit surprised that one does not seem to exist. Is anyone aware of one?
user38725's user avatar
  • 901
8 votes
3 answers
4k views

Java 7zip compression is too big

I have a Java program which searches for a folder with the date of yesterday and compresses it to a 7zip file and deletes it at the end. Now I have noticed that the generated 7zip archive files by my ...
Mad Scientist's user avatar
-2 votes
1 answer
540 views

How to check for an encrption for a 7z file?

I need to check a 7z file for encryption. I am using sevenzipjbind and using the property ENCRYPTED, but it seems it involves a lot more steps after that which I am not able to certain.
Dheeraj K Sharma's user avatar
2 votes
1 answer
879 views

Apache commons compress 7z file size way bigger than p7zip compression

When I zip 500mb of html files, p7zip does it in a couple of seconds and the filesize is 7mb (Without any custom settings, just 7z a filename.7z /folder). Thus I expected apache commons compress to ...
Kevin Van Den Broek's user avatar
2 votes
1 answer
1k views

7zip cmd extracting using ProcessBuilder in java

I have a problem extracting an archive to the desired category using Java 10 ProcessBuilder and 7z.exe (18.05) with command line. The exact same command works as intended when I use Windows CMD, but ...
Bloodlex's user avatar
  • 487
-1 votes
1 answer
70 views

Java WAR file deployment issue

we are trying to replace a class file in the WAR using 7-zip. While redeploying the WAR in jboss server we are facing bean exception error.Any help on this... "org.jboss.msc.service.StartException in ...
user416's user avatar
  • 536
3 votes
1 answer
1k views

Commons Compress using 7z gives Stream is not in the BZip2 format

I have this password protected 7z archive that can be properly opened and extracted with 7z alone. But using the code below: byte[] PASSWORD = "secret".getBytes(); String fileName = "r:/txt....
Cromax's user avatar
  • 2,042
2 votes
0 answers
368 views

Unable to unzip a file using 7z from Java on Linux machine

I have a Java code that is running on a Linux machine. While the code is running it downloads certain files from the internet. Those '.Z' files, so i am trying to use the '7z' program to extract the ...
Dan's user avatar
  • 195
0 votes
1 answer
1k views

SevenZFile - Apache Commons Compress 1.15, Uncompress

While Uncompressing .7z file, Empty folders are ignored, I want to consider Empty folders as well after uncompressing any .7z file. My Code is as below SevenZFile sevenZFile = new SevenZFile(new ...
Nilesh Morey's user avatar
0 votes
1 answer
348 views

Unable to use SevenZFile at Java6 to unzip 7z File

I can unzip 7z File by using org.apache.commons.compress.archivers.sevenz.SevenZFile at Java 7 and java 8. But I cant do that by using Java6. Can you please help me to fix that issue by Java 6 ? ...
Tonyukuk's user avatar
  • 6,165
1 vote
1 answer
2k views

Issue with unpacking/decrypt password protected (AES 256) 7z file in java using apache compress/org.tukaani.xz

Getting org.tukaani.xz.CorruptedInputException: Compressed data is corrupt error while trying to decrypt a password protected (AES 256) 7z file. Whereas without password protected 7z file getting ...
Raj's user avatar
  • 71
0 votes
0 answers
463 views

Reading a spring boot "jar" and/or changing (injecting a class to) a spring boot fat jar

By default, spring-boot builds a "fat" "jar" (not a normal jar). Is it possible to unjar a "fat" spring-boot jar? Is it possible to change a "fat" spring-boot jar? Obviously, my questions aren't ...
user2522941's user avatar
1 vote
1 answer
706 views

How to decomrepss a password protected 7zip archive with Java on Linux?

In my project, we need to extract a file from a password protected 7zip archive. My source code as following: try { ProcessBuilder pb = new ProcessBuilder("7z", "e", "bootstrap.7z", "-so", "...
yw5643's user avatar
  • 189
-2 votes
1 answer
290 views

Zip files in particular folder using Java

I just wanted a code to 7Z files(only .pdf and .txt files) in a particular folder and place it in same folder. The input I can give is the folder location. Can anyone help in this out? Is it can be ...
jeja's user avatar
  • 52
0 votes
1 answer
1k views

No changes after I edit a jar file

Sorry if the title doesn't say what I'm trying to do very accurately but I wasn't really sure how to describe it in one sentence. Basically I have a jar file with a java file inside it, and I want to ...
Evan's user avatar
  • 191
1 vote
0 answers
1k views

Android : decrypt and copy sqlite file from assets folder

I have an encrypted sqlite db file that I am copying to the memory on install and decrypting.I am doing this as a safety feature to protect my db. I encrypted the sqlite file using 7zip program using ...
Jovo Krneta's user avatar
0 votes
1 answer
100 views

Getting jar content

I'm trying to open some .jar archieve and get files from it. What i've got now: As i know .jar==.zip, so i used 7zip. It opens my jar and says that headers broken and still succeeded extraction. I ...
Jin's user avatar
  • 31
2 votes
1 answer
3k views

Java Code to Open a password protected zip file which is opening only with 7zx and keka in mac OS

I have a password protected zip file which is opening only with 7zx and keka in mac. I have to write the code in java to decompress password protected zip file and then do some operation on it. I have ...
mahan07's user avatar
  • 907
0 votes
2 answers
857 views

how to fix OutOfMemoryError android studio

i have a application for extract 7zip file i use this two lib for extract compile 'org.apache.commons:commons-compress:1.12' compile files('libs/xz-1.3.jar') and this is my code public void ...
ali molaie's user avatar
0 votes
2 answers
1k views

Programatically Extract Single Specific File From 7zip Archive - Java - Linux

I would really appreciate your input on the below scenario please. The requirements: - I have a 7zip archive file with several thousands of files in it - I have a java application running on linux ...
Tobias Wittur's user avatar
0 votes
0 answers
677 views

ZipEntry setSize not working + How does 7Zip do it? (JAVA)

I was wondering. I have this code to zip multiple files: try (ZipOutputStream out = new ZipOutputStream(new FileOutputStream(outputZip))) { for (Entry<File, String> entry : fileMap....
Eskir's user avatar
  • 784
3 votes
1 answer
946 views

Compressing folder into 7z in java

I want to compress a folder into .7z extension using java. Iam trying using the below code but it is creating a new file and appending all the source files content into one single file. Can anyone ...
Jagadeeswar's user avatar
6 votes
3 answers
12k views

Decompressing a file like 7zip with Java

I need to open a compresed file (zml, i don't couldn't find information about that extension) like 7zip does it with java. I have a zml file, if I open it with 7zip it asks me for the password, then ...
Juan Enrique Riquelme's user avatar
1 vote
0 answers
447 views

Find specific file in 7zip archive

I'm using Apache Commons Compress to parse entries in a 7zip archive. I need to be able to find a specific file (e.g. "thisfile.xml"), I was wondering if there is a better way of doing it other than ...
J Lewis's user avatar
  • 512
2 votes
1 answer
6k views

How to self-extract .jar file and auto run

I am wondering how I can self-extract a .jar file (and supporting files) then auto run the .jar file. This would basically mean the application as a whole would run from the one click. I have read ...
MrAnderson1992's user avatar
0 votes
1 answer
74 views

FileNotFound Exception with

I have the following code; String files=""; for (int i=0; i<filelist.size()-1;i++) { files=files+filelist.get(i).getPath()+", "; } files=files+filelist.get(filelist.size()-1).getPath(); System....
Yusuf Kaya Kuzu's user avatar