Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while compressing folders in java - This archives contains unclosed entries

I am using Apache commons-compress 1.12 to compress a folder. The parent folder that I am trying to compress has files and more subfolders with files. After compressing, I am trying to place the compressed file in the parent folder itself. I have written code that is written in the answer of http://stackoverflow.com/questions/13461393/compress-directory-to-tar-gz-with-commons-compress

But I am getting an error - java.io.IOException: This archives contains unclosed entries. I am using version 2.5 of apache commons-io. What could be the reason for the error?

like image 946
krackoder Avatar asked Sep 07 '25 06:09

krackoder


1 Answers

I had this issue when I could not access the file that was being archived. It was a permission issue. After changing the file permissions to 644, everything worked again.

like image 144
Marty Avatar answered Sep 10 '25 11:09

Marty