Bug 55519 - OOXML text extractors should open package as read-only
Summary: OOXML text extractors should open package as read-only
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: POI Overall (show other bugs)
Version: 3.10-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-03 14:51 UTC by Nam-Quang Tran
Modified: 2015-03-22 21:54 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nam-Quang Tran 2013-09-03 14:51:49 UTC
Hi,

In the method ExtractorFactory.createExtractor(File), an OPCPackage is created with OPCPackage.open(f.toString()).

This opens the package with PackageAccess.READ_WRITE. IMHO, a text extractor should open with PackageAccess.READ instead. Not doing so may cause POI to modify the file when the package's close method is called for some reason, a behavior a client would not expect from a text extractor.

Also, in my case, this issue caused my program to get stuck in an infinite loop, as the program was constantly reindexing files which it thought were modified.

Best regards
Comment 1 Dominik Stadler 2015-03-22 21:54:18 UTC
This was actually fixed in r1652877 already.