2

我想使用 TrueZip 库将文件附加到现有存档(而不是通过解包、添加文件和重新打包 - 新版本应该具有此功能),但我发现理解 API 有点困难。可以请比我更有知识的人建议如何在几行中做到这一点吗?

4

1 回答 1

2

谷歌是你的朋友:

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));
    }

    ...
}
于 2012-03-27T14:24:09.480 回答