How do I append files to a .tar archive in Java?

前端 未结 2 844
野的像风
野的像风 2021-01-23 10:11

I would like to create a tar archive in Java. I have files which are constantly being created and I\'d like a worker thread to take a reference to those files from a queue and c

2条回答
  •  时光说笑
    2021-01-23 10:47

    I use a library called Java Tar: http://www.trustice.com/java/tar/

    It's worked for me. In that package, look for:

    http://www.gjt.org/javadoc/com/ice/tar/TarArchive.html#writeEntry(com.ice.tar.TarEntry, boolean)

    Which lets you add an entry to the file without using a stream at the user level. I don't know about file size - but it would be a simple matter to test this aspect.

提交回复
热议问题