append a file to zip using TrueZip

2.1k Views Asked by At

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?

1

There are 1 best solutions below

7
On

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

    ...
}