I have a Java process (daemon) which is running. This process is used like a service. With that service I can download a signed zip archive from a trusted server. After I unpack the ZIP archive I want to execute a binary in the "unpacked" folder.
The problem is that this binary is not executable (no 'x' in its file mode) ... I know it's possible to set it with Java but I want a generic way.
Do you have any ideas how to do the deployment in a nice way?
(Yes, it needs to be Java)
Basically I want to restore the Unix file mode bits after I unpacked the ZIP archive. Is there a Java Lib which can do this?
You could easily call the chmod
command from your Java application to add that missing x
bit. chmod
is as standard on Unix as the executable (x
) bit itself.
Or you could do it straight from Java.
If you want the executable bit to remain set at decompression, though, you should probably not use the Java decompression libraries. Try using the Unix unzip
command to decompress your archive - it has supported storing and restoring the Unix file mode bits for quite some time. If your Unix vendor does not have it, you can get it from the source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With