Make tar file by Java

前端 未结 4 871
迷失自我
迷失自我 2020-12-03 04:49

I want to use Java to compress a folder to a tar file (in programmatic way). I think there must be an open source or library to do it. However, I cannot find such method.

4条回答
  •  隐瞒了意图╮
    2020-12-03 05:49

    .tar archive files are not compressed. You have to run a file compression on it like gzip and turn it into something like .tar.gz.

    If you just want to just archive a directory, take a look at:

    • http://www.trustice.com/java/tar/
    • http://code.google.com/p/jtar/

提交回复
热议问题