简体   繁体   中英

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

    ...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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