Nov 232012
 

This is a maintenance release for both TrueVFS and TrueZIP which fixes some major bugs, so please update your dependencies. Please accept my apologies if you have been affected by any of these bugs.

Because this is double release, rather than including the Release Notes in this announcement, please follow the respective link to get the Release Notes:

  2 Responses to “TrueVFS 0.10.1 / TrueZIP 7.7.1 released”

  1. Hi,

    I have a requirement to Zip files in Java where it has to be unzipped with Winzip 9 and above.

    I tried with below code but no luck. Could you please let me know what parameters has to be set?

    ZipOutputStream zipOutput = new ZipOutputStream(out);
    zipOutput.setCryptoParameters(new MyWinZipAesParameters());
    ZipEntry zipEntry = new ZipEntry(“data.txt”);
    zipEntry.setEncrypted(true);
    zipOutput.putNextEntry(zipEntry);

    class MyWinZipAesParameters implements WinZipAesParameters{

    @Override
    public AesKeyStrength getKeyStrength(String arg0)
    throws ZipKeyException {
    return AesKeyStrength.BITS_256;
    }

    @Override
    public byte[] getReadPassword(String arg0, boolean arg1)
    throws ZipKeyException {
    return “test”.getBytes();
    }

    @Override
    public byte[] getWritePassword(String arg0) throws ZipKeyException {
    return “test”.getBytes();
    }

    @Override
    public void setKeyStrength(String arg0, AesKeyStrength arg1)
    throws ZipKeyException {

    }
    };

    • The code shown is almost ok, but is incomplete. First, you still need to write entry contents to the stream. Second, you should not ignore the boolean parameter invalid for getReadPassword. If it’s set, then you should throw a ZipKeyException. Other than that, the code looks alright.

      BTW: I assume you are using TrueZIP. In TrueVFS, the ZIP API is subject to change and I cannot recommend to use it directly. Rather than that, you should use the API of the module TrueVFS Access.

Sorry, the comment form is closed at this time.