poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 62717] Content type of parts could not always be saved
Date Fri, 14 Sep 2018 12:54:07 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=62717

--- Comment #2 from pouponbe@fr.ibm.com ---
Code that reproduce :
File testFile = new File("test.zip");
    OPCPackage mainPkg = OPCPackage.openOrCreate(testFile);

    PackagePartName firstPartName =
PackagingURIHelper.createPartName("/dummy/text.txt");
    PackagePart firstPkg = mainPkg.createPart(firstPartName, "text/plain");
    OutputStreamWriter osW = new OutputStreamWriter(firstPkg.getOutputStream(),
"UTF8");
    osW.append("FOO");
    osW.flush();
    osW.close();
    firstPkg.flush();
    firstPkg.close();

    PackagePartName secondPartName =
PackagingURIHelper.createPartName("/dummy/text.properties");
    PackagePart secondPkg = mainPkg.createPart(secondPartName, "text/plain");
    osW = new OutputStreamWriter(secondPkg.getOutputStream(), "UTF8");
    osW.append("BAR FOO");
    osW.flush();
    osW.close();
    firstPkg.flush();
    firstPkg.close();

    mainPkg.close();

    mainPkg = OPCPackage.openOrCreate(testFile);

And yes it failed also with 4.0.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message