Is there a way in Java to compress or combine a group of files that will preserve file permissions and file ownerships? I have tried JarOuputStream and ZipOutputStream and neither seem to work.
Java has built-in support for compression in the java.util.zip and java.util.jar packages. These packages provide implementations of several standard and widely used compression utilities such as Zip, GZip, and Jar. However, none of these utilities supports preserving permission and ownership - no matter what programming language is used. In other words, there is no such thing as a Zip file which contains permission or ownership information.
If you need your archive to contain this meta information, you will need to use a scheme which explicitly preserves permission and ownership, such as the tar utility found on Unix. (Note that the standard implementation of tar doesn't do compression - it just does archiving. You can however GZip your tar archive to reduce its size.)