简体   繁体   English

使用 TrueZip 将文件附加到 zip

[英]append a file to zip using TrueZip

I want to use the TrueZip library to append a file to an existing archive (not by unpacking, adding a file and repacking - the new versions are supposed to have this feature), but I find it a bit difficult to understand the API.我想使用 TrueZip 库将文件附加到现有存档中(不是通过解包、添加文件和重新打包 - 新版本应该具有此功能),但我发现理解 API 有点困难。 Can please someone, more knowledgeable than me, suggest how to do this in a few lines?可以请比我知识渊博的人建议如何在几行中做到这一点吗?

Google is your friend:谷歌是你的朋友:

class MyApplication extends TApplication {

    @Override
    protected void setup() {
        // This should obtain the global configuration.
        TConfig config = TConfig.get();
        // Set FsOutputOption.GROW for appending-to rather than reassembling an
        // archive file.
        config.setOutputPreferences(
                config.getOutputPreferences.set(FsOutputOption.GROW));
    }

    ...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM