https://bz.apache.org/bugzilla/show_bug.cgi?id=62811

John Kleiser <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from John Kleiser <[email protected]> ---
Yes adding os.close() as below resolves the issue. Thank you.

        POIFSFileSystem fs = new POIFSFileSystem( );
        EncryptionInfo info = new EncryptionInfo( EncryptionMode.agile );
        // EncryptionInfo info = new EncryptionInfo(EncryptionMode.agile,
        // CipherAlgorithm.aes192, HashAlgorithm.sha384, -1, -1, null);

        Encryptor enc = info.getEncryptor( );
        enc.confirmPassword( "foobar" );

        // Read in an existing OOXML file
        OPCPackage opc = OPCPackage.open( new File( "input.xlsx" ),
PackageAccess.READ_WRITE );
        OutputStream os = enc.getDataStream( fs );
        opc.save( os );
        opc.close( );
        os.close( );

        // Write out the encrypted version
        FileOutputStream fos = new FileOutputStream( "output.xlsx" );
        fs.writeFilesystem( fos );
        fos.close( );

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to