I want to unzip files from a zip package which can have text, executable files in it. I have figured out way using Java interop to unzip the contents of the file at given location.
However, after everthing's unzipped at given locations, I am not able to run the executable files, because the permissions are not set as executable on the files.
I am using ZipInputStream and BufferedOutputStream from Java APIs, to read and write respectively. I don't think there's anything wrong with my code, because I can see the side effect and the files are unzipped as expected. Also, I checked the permissions on files and none of the executables have x permission on it.
Sure, I can run the unzip command instead and that should take care of everything, but I am not sure which platform the program would run on. So, I thought I'd programmatically unzip everything.
Can I really use, unzip command? Or is there any other recommended way?
Thanks.