mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Compare commits
1011 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfb713df29 | ||
|
|
44598bd030 | ||
|
|
23369586da | ||
|
|
9d9865c9b8 | ||
|
|
e9e9612a1f | ||
|
|
1594baf696 | ||
|
|
839ce4a0f4 | ||
|
|
260b22fb09 | ||
|
|
ac4e3c199e | ||
|
|
a1f6f2786f | ||
|
|
b923655b43 | ||
|
|
6b72a2dff3 | ||
|
|
c7976440c3 | ||
|
|
811eb4a4a8 | ||
|
|
6ba4a1b050 | ||
|
|
4efa2b7162 | ||
|
|
139321c5e9 | ||
|
|
6a9224385e | ||
|
|
df5604a1d7 | ||
|
|
eafd6c04b8 | ||
|
|
e340f313bc | ||
|
|
bc02ef0703 | ||
|
|
692caf0f36 | ||
|
|
e96c9e17c0 | ||
|
|
55c1608a2d | ||
|
|
5338b17a8f | ||
|
|
c92c533d7a | ||
|
|
8d53613bcf | ||
|
|
62ae400993 | ||
|
|
ae3ed57baa | ||
|
|
8f149f51d0 | ||
|
|
ab196a7441 | ||
|
|
da3d64d9e3 | ||
|
|
04f4c1fa74 | ||
|
|
513a805c25 | ||
|
|
0ae15edb2c | ||
|
|
5eba199642 | ||
|
|
0de8ecd6a0 | ||
|
|
d1f3f9489f | ||
|
|
d1f0a88ea1 | ||
|
|
beab88fb0e | ||
|
|
66109187d1 | ||
|
|
c9b37678cc | ||
|
|
e54ba888e2 | ||
|
|
8df367310c | ||
|
|
58ac8d05f0 | ||
|
|
372388b7ed | ||
|
|
e3e04a641f | ||
|
|
d72e3a608c | ||
|
|
1910fff53e | ||
|
|
22531fe638 | ||
|
|
9c2f487c98 | ||
|
|
b09bf904d7 | ||
|
|
2acb5cf66a | ||
|
|
d60edd21a3 | ||
|
|
fd4d143d44 | ||
|
|
df2d5d62d9 | ||
|
|
8cdcda2873 | ||
|
|
18ef01295d | ||
|
|
ac4295deac | ||
|
|
d93a29ae67 | ||
|
|
1fc4f9e3b7 | ||
|
|
b401b92aea | ||
|
|
a5f5f4294e | ||
|
|
ba04c61188 | ||
|
|
f8a8189230 | ||
|
|
95b2a1cf1d | ||
|
|
017ff5f8f8 | ||
|
|
cc8b6d7591 | ||
|
|
6670c48c30 | ||
|
|
aead782eb2 | ||
|
|
c94e795f35 | ||
|
|
e9b33c0b08 | ||
|
|
befc941dcf | ||
|
|
ac989335d7 | ||
|
|
0ec4434f59 | ||
|
|
c28aec61d4 | ||
|
|
b195a3b9ed | ||
|
|
ddf71d0984 | ||
|
|
fb75600872 | ||
|
|
4dadb9d6cc | ||
|
|
e7515ba5e6 | ||
|
|
c1fac56998 | ||
|
|
3a56bbd73b | ||
|
|
6d42ff955a | ||
|
|
528591ba11 | ||
|
|
c703d00300 | ||
|
|
9e1afbbab1 | ||
|
|
3ac160b57d | ||
|
|
f2c52141c7 | ||
|
|
fd66689944 | ||
|
|
97a97bd75c | ||
|
|
338882ac88 | ||
|
|
2dd124eb42 | ||
|
|
fe3359bd79 | ||
|
|
6762b5a9fb | ||
|
|
037a001719 | ||
|
|
3a69605f4c | ||
|
|
08e9bb00d4 | ||
|
|
4fb34ebeae | ||
|
|
f476c64179 | ||
|
|
a9bc28a4bb | ||
|
|
0eb7135f2b | ||
|
|
4b3c688d51 | ||
|
|
e4e4582689 | ||
|
|
027927bfad | ||
|
|
2098df7467 | ||
|
|
40ca9bd085 | ||
|
|
88836e1614 | ||
|
|
e7620b7ce7 | ||
|
|
6d6089eee5 | ||
|
|
57ffd3aa12 | ||
|
|
2428265d35 | ||
|
|
3d9c243943 | ||
|
|
236784371b | ||
|
|
47d0e956b8 | ||
|
|
74bdee9c0d | ||
|
|
e5336586a9 | ||
|
|
2805093da6 | ||
|
|
2a2e4f095e | ||
|
|
5d8d3e77bf | ||
|
|
006e49765c | ||
|
|
c953a8ff22 | ||
|
|
f44ece137f | ||
|
|
97cef0a3e3 | ||
|
|
73d1fc53f5 | ||
|
|
614d7c7002 | ||
|
|
c51dadf703 | ||
|
|
c5c2540abb | ||
|
|
97ea97b5a2 | ||
|
|
6b6735a3c4 | ||
|
|
1dbfba9225 | ||
|
|
c4e0cde59c | ||
|
|
32d7a45b50 | ||
|
|
528b72d347 | ||
|
|
ccacd1540c | ||
|
|
22ff9e34b6 | ||
|
|
775da74dee | ||
|
|
b4326363d6 | ||
|
|
ed156e63c6 | ||
|
|
5a7cd39393 | ||
|
|
8f1cfa2eb3 | ||
|
|
2cb8c4020e | ||
|
|
4b38ab5401 | ||
|
|
e7c0389865 | ||
|
|
d83039cca7 | ||
|
|
62e12fdb1b | ||
|
|
53ceff13b2 | ||
|
|
fa95a3e522 | ||
|
|
031793ddaf | ||
|
|
e73c419a37 | ||
|
|
540f0e5617 | ||
|
|
9fb2c4b03e | ||
|
|
cb520e8046 | ||
|
|
ae0a17765e | ||
|
|
71b4b62a6d | ||
|
|
a2ed8fda3a | ||
|
|
2f5ec43601 | ||
|
|
b45b7095c0 | ||
|
|
9b7938bf81 | ||
|
|
789fcc29bb | ||
|
|
1c4f68f262 | ||
|
|
7ec1fc01d4 | ||
|
|
ad925ac0d1 | ||
|
|
7a36dfe031 | ||
|
|
a5d43073a6 | ||
|
|
c840e660b7 | ||
|
|
f258b2b26d | ||
|
|
90e5d5d998 | ||
|
|
7631eae9b2 | ||
|
|
3116668737 | ||
|
|
b770a35aba | ||
|
|
59e595b844 | ||
|
|
c6a621edc6 | ||
|
|
f774a638cb | ||
|
|
73b904f16d | ||
|
|
cd22293975 | ||
|
|
d486e50822 | ||
|
|
89fa331beb | ||
|
|
1604c410d1 | ||
|
|
61203972a5 | ||
|
|
709bfd4305 | ||
|
|
3b69442907 | ||
|
|
1d4f5d34bd | ||
|
|
bc2b1b0422 | ||
|
|
7b5fe9c42b | ||
|
|
dd0d6deb81 | ||
|
|
16ecbc7d48 | ||
|
|
323b5c8c6b | ||
|
|
41f4570c8f | ||
|
|
58ee3f732b | ||
|
|
7ec830f892 | ||
|
|
95b46731b9 | ||
|
|
b16a094bba | ||
|
|
a371cba0be | ||
|
|
25a2dd9227 | ||
|
|
207d67c12b | ||
|
|
e09a167bbb | ||
|
|
f632c29683 | ||
|
|
0dc32a8596 | ||
|
|
67c8284f35 | ||
|
|
1dcb799127 | ||
|
|
1aa1fd6273 | ||
|
|
70f8b15333 | ||
|
|
782d187b10 | ||
|
|
63c0bf9368 | ||
|
|
ea74954fcf | ||
|
|
b5221fac25 | ||
|
|
42193c57e4 | ||
|
|
7003357b79 | ||
|
|
dc2cfe0bfc | ||
|
|
f10f164c61 | ||
|
|
79d1630374 | ||
|
|
05f37a5204 | ||
|
|
0a17fa9e22 | ||
|
|
444a8a7214 | ||
|
|
22b78e1887 | ||
|
|
03fc1ddea1 | ||
|
|
7a124135de | ||
|
|
b50946307e | ||
|
|
f26ea2b777 | ||
|
|
14cd9a35c6 | ||
|
|
c048ba53fe | ||
|
|
2e375a76ea | ||
|
|
f2267c0668 | ||
|
|
e4a2cd1233 | ||
|
|
ca7e3330ed | ||
|
|
6bbd6fc177 | ||
|
|
18e0a37df3 | ||
|
|
49fd564023 | ||
|
|
2b7f7074a0 | ||
|
|
28cd548f6b | ||
|
|
d0e6830e44 | ||
|
|
559485a0fe | ||
|
|
2fbfe2ea7e | ||
|
|
aeb53ffe62 | ||
|
|
b0a4e1042a | ||
|
|
00c2a85c30 | ||
|
|
6647bc8c8b | ||
|
|
4493f3a5d6 | ||
|
|
dda424920a | ||
|
|
c5f3ab9d50 | ||
|
|
7a80eb6920 | ||
|
|
172e73a10b | ||
|
|
9f9ff14e56 | ||
|
|
c38f5f9577 | ||
|
|
732001c4ae | ||
|
|
061d6a3d0f | ||
|
|
54f1f5deac | ||
|
|
ac53afe307 | ||
|
|
bdb467e84e | ||
|
|
65747422b3 | ||
|
|
c0e6a9bed0 | ||
|
|
e98a5991e7 | ||
|
|
314bda66a4 | ||
|
|
3b011a0164 | ||
|
|
085c9ddb19 | ||
|
|
92565ea07c | ||
|
|
009b6501f2 | ||
|
|
86e80a9164 | ||
|
|
9d37011683 | ||
|
|
d81592022d | ||
|
|
bf4ee6a3b9 | ||
|
|
e97f1036f0 | ||
|
|
8df560eed2 | ||
|
|
75e9383a5c | ||
|
|
ae232b73d7 | ||
|
|
224201e1a2 | ||
|
|
e070250352 | ||
|
|
4a9c9271fe | ||
|
|
3240852e49 | ||
|
|
b50ce609ca | ||
|
|
fa573c72da | ||
|
|
a3cca6c017 | ||
|
|
8d71c1f2ff | ||
|
|
5c9bb13cd7 | ||
|
|
99fdda0dc0 | ||
|
|
9ebec77aca | ||
|
|
bcc7912c8d | ||
|
|
e18b5576f0 | ||
|
|
f73913cd84 | ||
|
|
659dcb5dea | ||
|
|
f1e6b9d11c | ||
|
|
ebad7593ff | ||
|
|
5642c122f3 | ||
|
|
a96c0d9d78 | ||
|
|
0b9bc5d0b4 | ||
|
|
e5b2fbb89b | ||
|
|
8fc2f7db41 | ||
|
|
c76be2df41 | ||
|
|
7c86c60f7c | ||
|
|
44da0ea183 | ||
|
|
f73a9e0875 | ||
|
|
6bc4a6ebd6 | ||
|
|
45a3e16e7e | ||
|
|
1a86f27e7b | ||
|
|
ca104f4be7 | ||
|
|
2d4ee2ebef | ||
|
|
cace66f52f | ||
|
|
cceccc4bae | ||
|
|
f3bf31ac5d | ||
|
|
73b2874824 | ||
|
|
d4fc5cd6c0 | ||
|
|
533fee47c8 | ||
|
|
94ff481ca9 | ||
|
|
22d2efaf5b | ||
|
|
1eee67fb8b | ||
|
|
fa9428511a | ||
|
|
cb0943970b | ||
|
|
4166350488 | ||
|
|
33d81ae7ef | ||
|
|
a1fa00e1d1 | ||
|
|
af4eae815d | ||
|
|
6d8f1901dc | ||
|
|
550be7c201 | ||
|
|
b5f67fca04 | ||
|
|
07fa0b88e0 | ||
|
|
e1d943e294 | ||
|
|
8fa36ff3df | ||
|
|
bbd404f343 | ||
|
|
0c3cc9a5e1 | ||
|
|
024f1d3348 | ||
|
|
ef16723148 | ||
|
|
f76089be67 | ||
|
|
8e5d6fe026 | ||
|
|
39e5ac2906 | ||
|
|
18fc855e66 | ||
|
|
f2df929adb | ||
|
|
5b8ff77997 | ||
|
|
2f66c63387 | ||
|
|
4fb39a6b09 | ||
|
|
eb91cfad93 | ||
|
|
6928a6ca2e | ||
|
|
102db731df | ||
|
|
d72b25d83b | ||
|
|
8c13001762 | ||
|
|
c88b9e0e76 | ||
|
|
7333f6a7d0 | ||
|
|
521aab62da | ||
|
|
10675900c6 | ||
|
|
e2a9a66428 | ||
|
|
631d8aecc4 | ||
|
|
67320b6453 | ||
|
|
b6f3fa0c42 | ||
|
|
73c4de16e4 | ||
|
|
c784266438 | ||
|
|
779358f309 | ||
|
|
f51cff5e76 | ||
|
|
2ceb5f9020 | ||
|
|
4080ab8f3f | ||
|
|
6605569862 | ||
|
|
9c08d29fcb | ||
|
|
adc6d13f3a | ||
|
|
d8b3934646 | ||
|
|
47f2d72d35 | ||
|
|
e5ac02f7d0 | ||
|
|
f6c1cbd229 | ||
|
|
d2cc0b770c | ||
|
|
92e7a8a417 | ||
|
|
d0ad6030d2 | ||
|
|
b5b489f7fd | ||
|
|
c5df00b0a7 | ||
|
|
c5ca5ae065 | ||
|
|
a6f65db642 | ||
|
|
c01228c331 | ||
|
|
2ca7114a8f | ||
|
|
6b968e64a5 | ||
|
|
8767e243e3 | ||
|
|
9e7873267a | ||
|
|
cf254c06f6 | ||
|
|
c8fc8a36a9 | ||
|
|
de1c2b67d7 | ||
|
|
c5af268cc9 | ||
|
|
9a4a4270ec | ||
|
|
17cb74b3ff | ||
|
|
378a0bed06 | ||
|
|
16b53a8bc7 | ||
|
|
d189f69333 | ||
|
|
35a6ae72be | ||
|
|
67b0dc3966 | ||
|
|
c1dc0c6130 | ||
|
|
3c7d8dc8bc | ||
|
|
6f1a81ac8c | ||
|
|
2880483f13 | ||
|
|
b461e98edb | ||
|
|
f298390ec3 | ||
|
|
426371301f | ||
|
|
5c6b59aea4 | ||
|
|
b76bbc866e | ||
|
|
62b351cbeb | ||
|
|
e17ddb0374 | ||
|
|
40beab6b6c | ||
|
|
51316e01d8 | ||
|
|
1b0f62a235 | ||
|
|
9df7326140 | ||
|
|
7363d0483a | ||
|
|
de0d120d69 | ||
|
|
cbf6577172 | ||
|
|
2f55495ba9 | ||
|
|
dce1a83169 | ||
|
|
ebd9a8bc9a | ||
|
|
3f9153c761 | ||
|
|
3ee613c336 | ||
|
|
85212023d6 | ||
|
|
39935860ed | ||
|
|
bbccb5217f | ||
|
|
1f6c32bd55 | ||
|
|
1b0632f3f1 | ||
|
|
783ebda7f3 | ||
|
|
7981ea397f | ||
|
|
6a68902aee | ||
|
|
8bac1b33f6 | ||
|
|
9f43059a37 | ||
|
|
9fafa45bac | ||
|
|
1d510c7fc3 | ||
|
|
a7231a3764 | ||
|
|
cdcc14d6e3 | ||
|
|
a56b68476f | ||
|
|
e867e371be | ||
|
|
eb89c043dc | ||
|
|
7aa4ae3bc1 | ||
|
|
c37b4ee0d5 | ||
|
|
9e30ffc0de | ||
|
|
22192ce2cc | ||
|
|
2052a9be7d | ||
|
|
68d6e0cf9f | ||
|
|
287d90ee8f | ||
|
|
f73f377af4 | ||
|
|
e458192cf2 | ||
|
|
fe0a4f1166 | ||
|
|
691c8baa5a | ||
|
|
712c484a65 | ||
|
|
421837d2c5 | ||
|
|
694538aed0 | ||
|
|
82aac8561f | ||
|
|
f9e692aa5d | ||
|
|
0036655df4 | ||
|
|
db61f5b4be | ||
|
|
3d66281e6d | ||
|
|
dda779c4a0 | ||
|
|
85aa74414c | ||
|
|
7c9a1ce89b | ||
|
|
121c5f2aaf | ||
|
|
be33cd61d1 | ||
|
|
5c82a0890c | ||
|
|
eaff2ac8ce | ||
|
|
993cc5a5b8 | ||
|
|
92d4a8d86d | ||
|
|
b3d0fe52d3 | ||
|
|
f2179098fe | ||
|
|
f91ff62a55 | ||
|
|
8bf71069cd | ||
|
|
6cbc6694ab | ||
|
|
7e3a404e4d | ||
|
|
78ed7db257 | ||
|
|
ae494ff2ef | ||
|
|
c6eb5b7b85 | ||
|
|
6cddf8be2d | ||
|
|
f5f985f469 | ||
|
|
618c129a98 | ||
|
|
fbd97d7672 | ||
|
|
e3bb8c3032 | ||
|
|
1f3d2a5c50 | ||
|
|
cdb8fad845 | ||
|
|
dbfe354b4a | ||
|
|
9a6bd3902d | ||
|
|
f90274e518 | ||
|
|
82784172b4 | ||
|
|
6096d55d23 | ||
|
|
d8a2bbb900 | ||
|
|
a076204fac | ||
|
|
9b800c82d7 | ||
|
|
42deaab12c | ||
|
|
c16e98e5b2 | ||
|
|
49aef015a8 | ||
|
|
70a69a4917 | ||
|
|
71dcabc947 | ||
|
|
82388de909 | ||
|
|
26883c2d8c | ||
|
|
2c8ab79a78 | ||
|
|
aa964c385d | ||
|
|
410653681e | ||
|
|
502a0f756e | ||
|
|
7babbd11a6 | ||
|
|
af040998f4 | ||
|
|
064225a488 | ||
|
|
9bef52fc6e | ||
|
|
40e7c815cf | ||
|
|
6d8bd2dcfa | ||
|
|
ac9d37875d | ||
|
|
ed47184865 | ||
|
|
9e64e029e0 | ||
|
|
5b12033b99 | ||
|
|
dbaf834459 | ||
|
|
7d87f1b5cd | ||
|
|
bd6fddbcc4 | ||
|
|
41d42717d4 | ||
|
|
3be17c823d | ||
|
|
961c83fb4e | ||
|
|
50dcbd390b | ||
|
|
f61dddea12 | ||
|
|
ca8014ebef | ||
|
|
694765368e | ||
|
|
8ad10c0ed7 | ||
|
|
3a3effca65 | ||
|
|
d6d403371a | ||
|
|
bff0b98095 | ||
|
|
ed744e15b4 | ||
|
|
219f43b4ee | ||
|
|
e33595b719 | ||
|
|
bc11cc335e | ||
|
|
d8ae576afa | ||
|
|
79e5e6ae16 | ||
|
|
0f560377be | ||
|
|
43aded3d9c | ||
|
|
e51877f5a6 | ||
|
|
72aa1f42a7 | ||
|
|
cc61ad565f | ||
|
|
1dbcea46d5 | ||
|
|
045a37f9c1 | ||
|
|
80fd35198d | ||
|
|
dd647b5d2d | ||
|
|
9c24944299 | ||
|
|
61f9b79647 | ||
|
|
ce19c3e761 | ||
|
|
c85e91e25c | ||
|
|
4962a04bbf | ||
|
|
9eda246398 | ||
|
|
0ab1ccc20a | ||
|
|
0f91df9577 | ||
|
|
86c0db4be1 | ||
|
|
43a15ffaf3 | ||
|
|
6befe2ad52 | ||
|
|
76617e9793 | ||
|
|
57afb34a18 | ||
|
|
edcbd87360 | ||
|
|
f873888301 | ||
|
|
a4097e05aa | ||
|
|
534d24dc74 | ||
|
|
38e7fe63a8 | ||
|
|
147c034cfd | ||
|
|
ae9355dcf4 | ||
|
|
c1f52674fd | ||
|
|
4f21f5280a | ||
|
|
3aad12021a | ||
|
|
d52f80eb79 | ||
|
|
2c74a961a4 | ||
|
|
4ca89e156f | ||
|
|
b0515e7493 | ||
|
|
116c32137d | ||
|
|
8d73b7ac2b | ||
|
|
91569bd826 | ||
|
|
018961ea77 | ||
|
|
75729edcea | ||
|
|
9951e8dfc1 | ||
|
|
3f4e7189b3 | ||
|
|
39f4085d6c | ||
|
|
2ebb2938b1 | ||
|
|
0c3ebbb1bc | ||
|
|
83e38afcdb | ||
|
|
1d5497f2c3 | ||
|
|
a40ab5a551 | ||
|
|
d7ca791ace | ||
|
|
b92a912e7d | ||
|
|
704e9a5439 | ||
|
|
be83ccf2ef | ||
|
|
ba6b755107 | ||
|
|
3755101b72 | ||
|
|
3ee979c767 | ||
|
|
6754be55a2 | ||
|
|
0e18766e1a | ||
|
|
50431fbbaa | ||
|
|
1065c69004 | ||
|
|
20cb040701 | ||
|
|
fde4545b3b | ||
|
|
c57f7a3b0e | ||
|
|
1700967d17 | ||
|
|
4f5d7781c1 | ||
|
|
33f944f922 | ||
|
|
3e0306d253 | ||
|
|
b8f975fb8f | ||
|
|
d4c6cb4b53 | ||
|
|
6fdbaa55f3 | ||
|
|
6d56d81f35 | ||
|
|
5874f55dcc | ||
|
|
edb9aeaca5 | ||
|
|
0d63f9a814 | ||
|
|
799aef54fe | ||
|
|
b788812546 | ||
|
|
f2b0e2f19a | ||
|
|
f5cb9588a0 | ||
|
|
ba79c4c3c1 | ||
|
|
a2af56511f | ||
|
|
924d8e7894 | ||
|
|
e400a0cc0d | ||
|
|
c17d78a182 | ||
|
|
7c881a408f | ||
|
|
c1f018f79c | ||
|
|
83384ccf90 | ||
|
|
8c77000e8d | ||
|
|
0f42425f8c | ||
|
|
0aa9e2bbb7 | ||
|
|
1df9b9c5cb | ||
|
|
8fe23195c6 | ||
|
|
7bc2dced2f | ||
|
|
1d620e8714 | ||
|
|
e132050d2e | ||
|
|
157512d437 | ||
|
|
b9eabbb477 | ||
|
|
02d2e6e82e | ||
|
|
613bf24ee7 | ||
|
|
5ba45570d6 | ||
|
|
df4bf119a5 | ||
|
|
0b758a45ba | ||
|
|
a43cc4a41a | ||
|
|
7ea956189d | ||
|
|
a185d08880 | ||
|
|
e1f7d4df4f | ||
|
|
9185ec02c5 | ||
|
|
69d935d4db | ||
|
|
c9c8653e6e | ||
|
|
a528d43590 | ||
|
|
7c17cc5e8f | ||
|
|
e896804683 | ||
|
|
db97cf001f | ||
|
|
468b423168 | ||
|
|
24452a2ecb | ||
|
|
822974aadc | ||
|
|
c5986447d1 | ||
|
|
fad6cae019 | ||
|
|
88a0d4ecf3 | ||
|
|
ab68210d2a | ||
|
|
f8bbec3104 | ||
|
|
f219a1a09f | ||
|
|
9b29308d6e | ||
|
|
6b9a099a69 | ||
|
|
da1939fd6a | ||
|
|
ad8b9f0b6d | ||
|
|
cab699001e | ||
|
|
720596a9ec | ||
|
|
c33f34b27c | ||
|
|
d034f954bd | ||
|
|
70aba4268b | ||
|
|
f1a5571a61 | ||
|
|
52039e220d | ||
|
|
a3d9bb7e35 | ||
|
|
2536f51646 | ||
|
|
8235db8758 | ||
|
|
0f5585d8e1 | ||
|
|
a139a17909 | ||
|
|
2ef8461f51 | ||
|
|
89ef0de42e | ||
|
|
e1379d3725 | ||
|
|
fb02a49df0 | ||
|
|
c51270d308 | ||
|
|
b6c67ae736 | ||
|
|
e788f0832b | ||
|
|
4dd22fa282 | ||
|
|
b0fa9e5e3e | ||
|
|
5a977d1a7b | ||
|
|
5b404ebc6b | ||
|
|
5fd1f28b4b | ||
|
|
d2866dae24 | ||
|
|
6464543fb2 | ||
|
|
7933b53287 | ||
|
|
f4ec85adb0 | ||
|
|
cb1f341bb9 | ||
|
|
a2289f4596 | ||
|
|
6a68645f62 | ||
|
|
41ea754510 | ||
|
|
abf153d6a4 | ||
|
|
41453f3916 | ||
|
|
f33b2cbd51 | ||
|
|
cbda6bccf4 | ||
|
|
295e1d0bc9 | ||
|
|
2d869111bc | ||
|
|
1ba795451e | ||
|
|
b0c67177ff | ||
|
|
c2945d86f9 | ||
|
|
571845c5b0 | ||
|
|
33260d51ee | ||
|
|
6c56c2d00f | ||
|
|
c82ebeab7d | ||
|
|
84824170d8 | ||
|
|
e4c617baba | ||
|
|
d681bcfcfb | ||
|
|
fdb8b41fe3 | ||
|
|
b737d6c03e | ||
|
|
ac02543cfe | ||
|
|
0559accac4 | ||
|
|
c05eebf415 | ||
|
|
889ba37ae9 | ||
|
|
6739970530 | ||
|
|
0dea4a301c | ||
|
|
0dac5680c3 | ||
|
|
7b15aefae8 | ||
|
|
cc4fbe1c4d | ||
|
|
264a215573 | ||
|
|
09fbfd5be4 | ||
|
|
9456261cba | ||
|
|
ebb9cde924 | ||
|
|
e75d2c6d9f | ||
|
|
a3d9c025e9 | ||
|
|
2582e5e0c1 | ||
|
|
719e7154a1 | ||
|
|
a971751238 | ||
|
|
e2044c958b | ||
|
|
5085e3d1b2 | ||
|
|
1a07ee8d6a | ||
|
|
04a956ab8f | ||
|
|
8be69305ca | ||
|
|
a042165133 | ||
|
|
fc17f113d8 | ||
|
|
7601beb592 | ||
|
|
148ac23c0d | ||
|
|
a0008d6764 | ||
|
|
302b43641f | ||
|
|
bfd4645a72 | ||
|
|
c1d6d0d4a1 | ||
|
|
894ef6e1bd | ||
|
|
397cee3a12 | ||
|
|
164c239a52 | ||
|
|
d090c6b77a | ||
|
|
750657064a | ||
|
|
e1c6168682 | ||
|
|
3d1375deee | ||
|
|
a78d594b73 | ||
|
|
559de96cc0 | ||
|
|
6e07ce50dd | ||
|
|
04c9d0a3c1 | ||
|
|
05c79326be | ||
|
|
3f246cc189 | ||
|
|
a12c95990b | ||
|
|
648a2e58b0 | ||
|
|
96fa957ef5 | ||
|
|
66f89c50d6 | ||
|
|
7e86ff1bb0 | ||
|
|
8a37350e94 | ||
|
|
03b0742ad3 | ||
|
|
600bf8c4b3 | ||
|
|
f8a990051b | ||
|
|
d879a94a15 | ||
|
|
527f26aac9 | ||
|
|
f8a949217b | ||
|
|
65443a93c6 | ||
|
|
bb541e3e7c | ||
|
|
a0abf65115 | ||
|
|
e8c0084606 | ||
|
|
434b1ab8e6 | ||
|
|
d530977347 | ||
|
|
461691ef0e | ||
|
|
2a47c185c6 | ||
|
|
ebc4c37e78 | ||
|
|
fac56eea48 | ||
|
|
ca64f86ff8 | ||
|
|
41ccb6fe30 | ||
|
|
a1a982a2fb | ||
|
|
f56eea8e45 | ||
|
|
160fc0122c | ||
|
|
3f243f65ab | ||
|
|
329a659739 | ||
|
|
f490e43442 | ||
|
|
72282b8780 | ||
|
|
5ecc959180 | ||
|
|
6ed4818996 | ||
|
|
19b9510bed | ||
|
|
156371540f | ||
|
|
7027eb5e8a | ||
|
|
5f7db27559 | ||
|
|
4565d31222 | ||
|
|
68478c8b8c | ||
|
|
af5d4b9f22 | ||
|
|
48305903b3 | ||
|
|
b91827e029 | ||
|
|
c0c70cac7a | ||
|
|
efce9ba930 | ||
|
|
c960ee6070 | ||
|
|
fa166a65d7 | ||
|
|
3800aa5418 | ||
|
|
91149769e4 | ||
|
|
e6a913c3bd | ||
|
|
238d002f34 | ||
|
|
601c5e2671 | ||
|
|
51242877e5 | ||
|
|
5813a6d2d3 | ||
|
|
48a69cd5df | ||
|
|
6936398b0a | ||
|
|
d4bcc2b3bb | ||
|
|
8c101982e0 | ||
|
|
d87ffbc1b0 | ||
|
|
ee525b6477 | ||
|
|
f335554254 | ||
|
|
6948f9031d | ||
|
|
ff7f1ea721 | ||
|
|
a0091652a5 | ||
|
|
1899bee1b9 | ||
|
|
5955dd75de | ||
|
|
eebb3717e0 | ||
|
|
d525d1a5b1 | ||
|
|
1fb1d57ca8 | ||
|
|
4a3b92b305 | ||
|
|
9453fa908a | ||
|
|
c4e8388742 | ||
|
|
51637fcc43 | ||
|
|
059595f021 | ||
|
|
1fe45e84b0 | ||
|
|
eee1ab84dc | ||
|
|
5984227b20 | ||
|
|
eccb6983b7 | ||
|
|
0e806d485c | ||
|
|
d8d1af03b5 | ||
|
|
c715f9ee1d | ||
|
|
bdff72668e | ||
|
|
f4af02bb24 | ||
|
|
08436ddf7f | ||
|
|
56692aa84c | ||
|
|
6e01fe6e2a | ||
|
|
45b2ecb20a | ||
|
|
d0a5b622ca | ||
|
|
baae7b0301 | ||
|
|
9d3531842b | ||
|
|
30ff717be4 | ||
|
|
a3488f6c39 | ||
|
|
db63599833 | ||
|
|
1c156c4005 | ||
|
|
9d14f3f9ee | ||
|
|
9e425e1c5b | ||
|
|
263171f80e | ||
|
|
6b40b7f966 | ||
|
|
2496ce5229 | ||
|
|
025c904695 | ||
|
|
05af0e0bf3 | ||
|
|
17c6a1ec50 | ||
|
|
e5e22bb1f2 | ||
|
|
e65e666ece | ||
|
|
39a1ced25e | ||
|
|
cb10857970 | ||
|
|
28fc73b046 | ||
|
|
386ddb8e6b | ||
|
|
1bb5f644f1 | ||
|
|
b7bf336453 | ||
|
|
b4a2bc084e | ||
|
|
3817f138f8 | ||
|
|
fded4957db | ||
|
|
d59d6b7d7d | ||
|
|
23ed93817f | ||
|
|
63899a8810 | ||
|
|
c871bb7b9f | ||
|
|
dc025d9365 | ||
|
|
99ec2c6c0f | ||
|
|
6a8994ee0e | ||
|
|
3b7a01b804 | ||
|
|
b5c1a6644c | ||
|
|
9994816676 | ||
|
|
2469b89ee6 | ||
|
|
e455798019 | ||
|
|
e0d446c533 | ||
|
|
3b5a9b07c4 | ||
|
|
1bfcae1ac3 | ||
|
|
1fd07c94af | ||
|
|
209e8fc659 | ||
|
|
e696053e23 | ||
|
|
147c96da67 | ||
|
|
fef87cfa0a | ||
|
|
98c52bcbbb | ||
|
|
274a7e24f3 | ||
|
|
7b7f10e657 | ||
|
|
b010f9c99c | ||
|
|
c868af2e57 | ||
|
|
1fa568916f | ||
|
|
f93306721f | ||
|
|
724fc526bf | ||
|
|
c3fd1d5731 | ||
|
|
cf5cd6fb6b | ||
|
|
a27029d1af | ||
|
|
d54c8f16e6 | ||
|
|
94ace1c4b0 | ||
|
|
4d175324f2 | ||
|
|
fb1aaf1e4e | ||
|
|
8507fdf371 | ||
|
|
28811d26df | ||
|
|
8e3b60f63d | ||
|
|
c63cb1846c | ||
|
|
e17f92ee3a | ||
|
|
a9ca01e3fd | ||
|
|
fb3f3ef26f | ||
|
|
2f25c1ab90 | ||
|
|
7e5e9fcc62 | ||
|
|
c7324182ad | ||
|
|
53cfc2cc96 | ||
|
|
399e99630c | ||
|
|
ffc4795258 | ||
|
|
4b84986671 | ||
|
|
f662657db1 | ||
|
|
2c838143ba | ||
|
|
ecc42ac4f2 | ||
|
|
6775bd259d | ||
|
|
d021e6bc5e | ||
|
|
fd9300d3b7 | ||
|
|
c8c8130ae3 | ||
|
|
497482d4dc | ||
|
|
25e2d5ca69 | ||
|
|
15dd62d659 | ||
|
|
c7329fbd38 | ||
|
|
f1589b8d66 | ||
|
|
9fda604fb8 | ||
|
|
e0b7dcda83 | ||
|
|
6e3d031e80 | ||
|
|
3f317f5b32 | ||
|
|
5b246ca080 | ||
|
|
f40c8ccafb | ||
|
|
3ab1c1a131 | ||
|
|
9e1e675fc3 | ||
|
|
ba84383764 | ||
|
|
8690df1d28 | ||
|
|
9c48dee4ea | ||
|
|
bcb451a416 | ||
|
|
b5da35ee4e | ||
|
|
d81223cd10 | ||
|
|
5d2f053769 | ||
|
|
9965dc74db | ||
|
|
386b2fcc78 | ||
|
|
e9710ead93 | ||
|
|
2d10477565 | ||
|
|
3d35361666 | ||
|
|
04a4dd179b | ||
|
|
676d0fdf3f | ||
|
|
219954c07c | ||
|
|
3b03ed58e4 | ||
|
|
8819952b2f | ||
|
|
e95a4d84d0 | ||
|
|
74151ffa5b | ||
|
|
726fa5c85e | ||
|
|
e83987b35d | ||
|
|
76b1a6fee4 | ||
|
|
c9506f0f39 | ||
|
|
a57344e585 | ||
|
|
1d24d0c476 | ||
|
|
69be873ff3 | ||
|
|
5533d35cef | ||
|
|
9acbe83d5b | ||
|
|
8142b56fb8 | ||
|
|
0d1644282f | ||
|
|
4cff905375 | ||
|
|
56eb1ccff6 | ||
|
|
5cc8b9958c | ||
|
|
ef743728ab | ||
|
|
6e680589de | ||
|
|
89ccbec1dd | ||
|
|
070393a06f | ||
|
|
e7358f8ff8 | ||
|
|
e94b284c59 | ||
|
|
ff5fc9d582 | ||
|
|
bcfd81f489 | ||
|
|
d4373c2d09 | ||
|
|
f64524916d | ||
|
|
fee050b391 | ||
|
|
1855186f85 | ||
|
|
9dec19ba00 | ||
|
|
0d57635607 | ||
|
|
c8d0332c60 | ||
|
|
0fe45fe899 | ||
|
|
7c5a3ee7fc | ||
|
|
efba2c39ce | ||
|
|
176a685e2d | ||
|
|
8759103c94 | ||
|
|
cf440d3c77 | ||
|
|
9a8ea4a165 | ||
|
|
e80ae0bb07 | ||
|
|
818091f54d | ||
|
|
0dd2b18b56 | ||
|
|
5035a531c5 | ||
|
|
08aa6d1730 | ||
|
|
5c9fb98bcf | ||
|
|
2f5a188497 | ||
|
|
236710df4e | ||
|
|
f869dc6f74 | ||
|
|
edef04dce7 | ||
|
|
dbddc32c1b | ||
|
|
b48de0fe42 | ||
|
|
fccf4a97fb | ||
|
|
ec099d769f | ||
|
|
6a3e6c2b2e | ||
|
|
bc870ab764 | ||
|
|
407bb3744c | ||
|
|
a227fa9443 | ||
|
|
638a9be903 | ||
|
|
2276c3571d | ||
|
|
e670061518 | ||
|
|
2bd84bf25c | ||
|
|
e43c1bc911 | ||
|
|
5cd4fa5488 | ||
|
|
eb11f3324f | ||
|
|
50b4da40b8 | ||
|
|
6fae5bbc18 | ||
|
|
c331c5d26a | ||
|
|
a42842841e | ||
|
|
42651f6eda | ||
|
|
e8e6f671ef | ||
|
|
a5b4a3504a | ||
|
|
360c05d9e3 | ||
|
|
105966cc29 | ||
|
|
5d36e0c450 | ||
|
|
8814a4bfb9 | ||
|
|
bbc98b5cd3 | ||
|
|
505ac31533 | ||
|
|
e720c27b71 | ||
|
|
8e20b5e9cd | ||
|
|
6c91c5f807 | ||
|
|
fdad7e1408 | ||
|
|
57e1f4b79e |
31
.asf.yaml
31
.asf.yaml
@ -1,7 +1,7 @@
|
|||||||
# https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features
|
# https://github.com/apache/infrastructure-asfyaml/blob/main/README.md
|
||||||
|
|
||||||
github:
|
github:
|
||||||
description: "Mirror of Apache POI subversion. The Java API for Microsoft Documents."
|
description: "Mirror of Apache POI gitbox. The Java API for Microsoft Documents."
|
||||||
homepage: https://poi.apache.org/
|
homepage: https://poi.apache.org/
|
||||||
labels:
|
labels:
|
||||||
- poi
|
- poi
|
||||||
@ -14,10 +14,35 @@ github:
|
|||||||
- powerpoint
|
- powerpoint
|
||||||
- visio
|
- visio
|
||||||
|
|
||||||
|
dependabot_alerts: true
|
||||||
|
dependabot_updates: false
|
||||||
|
|
||||||
features:
|
features:
|
||||||
# Enable wiki for documentation
|
# Enable wiki for documentation
|
||||||
wiki: false
|
wiki: false
|
||||||
# Enable issue management
|
# Enable issue management
|
||||||
issues: false
|
issues: true
|
||||||
# Enable projects for project management boards
|
# Enable projects for project management boards
|
||||||
projects: false
|
projects: false
|
||||||
|
# Enable github discussions
|
||||||
|
discussions: true
|
||||||
|
|
||||||
|
enabled_merge_buttons:
|
||||||
|
squash: true
|
||||||
|
merge: false
|
||||||
|
rebase: true
|
||||||
|
|
||||||
|
protected_branches:
|
||||||
|
trunk: {}
|
||||||
|
5.5.x: {}
|
||||||
|
asf-site: {}
|
||||||
|
|
||||||
|
notifications:
|
||||||
|
commits: commits@poi.apache.org
|
||||||
|
issues: dev@poi.apache.org
|
||||||
|
pullrequests: dev@poi.apache.org
|
||||||
|
discussions: dev@poi.apache.org
|
||||||
|
jobs: dev@poi.apache.org
|
||||||
|
|
||||||
|
publish:
|
||||||
|
whoami: asf-site
|
||||||
|
|||||||
8
.github/workflows/test-gradle.yml
vendored
8
.github/workflows/test-gradle.yml
vendored
@ -5,9 +5,9 @@ name: Java CI with Gradle
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ trunk ]
|
branches: [ trunk, 5.5.x ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ trunk ]
|
branches: [ trunk, 5.5.x ]
|
||||||
|
|
||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
@ -17,10 +17,10 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Set up JDK
|
- name: Set up JDK
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v5
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
|
|||||||
84
KEYS
84
KEYS
@ -2545,14 +2545,12 @@ bpjAhwE2YmGQ7oB+3V798HtAmceRNf8AY0GWrZswJlg7xUn+WJNwQ9uIHI1fxYHx
|
|||||||
2Nr+AmDDs6ZOEI5zhwxioePw/Cg=
|
2Nr+AmDDs6ZOEI5zhwxioePw/Cg=
|
||||||
=9lKb
|
=9lKb
|
||||||
-----END PGP PUBLIC KEY BLOCK-----
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
pub rsa2048 2018-05-02 [SC] [expires: 2024-05-25]
|
pub rsa2048 2018-05-02 [SC] [expires: 2026-05-11]
|
||||||
6BA4 DA8B 1C88 A494 28A2 9C3D 0C69 C1EF 4118 1E13
|
6BA4DA8B1C88A49428A29C3D0C69C1EF41181E13
|
||||||
uid [ultimate] PJ Fanning <fanningpj@yahoo.com>
|
uid [ unknown] PJ Fanning (http://www.apache.org/) <fanningpj@apache.org>
|
||||||
sig 3 0C69C1EF41181E13 2022-04-06 PJ Fanning <fanningpj@yahoo.com>
|
uid [ unknown] PJ Fanning (GitHub noreply address) <pjfanning@users.noreply.github.com>
|
||||||
uid [ultimate] PJ Fanning (http://www.apache.org/) <fanningpj@apache.org>
|
uid [ unknown] PJ Fanning <fanningpj@yahoo.com>
|
||||||
sig 3 0C69C1EF41181E13 2022-04-06 PJ Fanning <fanningpj@yahoo.com>
|
sub rsa2048 2018-05-02 [E] [expires: 2026-05-11]
|
||||||
sub rsa2048 2018-05-02 [E] [expires: 2024-05-25]
|
|
||||||
sig 0C69C1EF41181E13 2022-04-06 PJ Fanning <fanningpj@yahoo.com>
|
|
||||||
|
|
||||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||||
|
|
||||||
@ -2561,37 +2559,45 @@ ARFmtFPnwYwLTdz3ECqWWsC3RkI62079DweNasXV8nBz9sUt6mQqSMx3W/s6389/
|
|||||||
k9iywPLvhHH7rpp05js8zwJoA8Fr1YwPtBjyhrxl58LQ5ihd/1f2ud2tnwQw1dI2
|
k9iywPLvhHH7rpp05js8zwJoA8Fr1YwPtBjyhrxl58LQ5ihd/1f2ud2tnwQw1dI2
|
||||||
8fuTS3QaKP4Zdx2diD5rYhkAecWaFRwxn1L7Tye5dfD1uPElPCHGKqfaeQXtl01u
|
8fuTS3QaKP4Zdx2diD5rYhkAecWaFRwxn1L7Tye5dfD1uPElPCHGKqfaeQXtl01u
|
||||||
TOwYB1p9tKPHvfni1qgD3QLWUJ2oyBGSA9IgEF5rm8LtR6vADKQwORjg99a7HE2h
|
TOwYB1p9tKPHvfni1qgD3QLWUJ2oyBGSA9IgEF5rm8LtR6vADKQwORjg99a7HE2h
|
||||||
lDBZi/tmu23fgWSioiy084fB5GqmApK/681DABEBAAG0OlBKIEZhbm5pbmcgKGh0
|
lDBZi/tmu23fgWSioiy084fB5GqmApK/681DABEBAAG0SFBKIEZhbm5pbmcgKEdp
|
||||||
dHA6Ly93d3cuYXBhY2hlLm9yZy8pIDxmYW5uaW5ncGpAYXBhY2hlLm9yZz6JAVQE
|
dEh1YiBub3JlcGx5IGFkZHJlc3MpIDxwamZhbm5pbmdAdXNlcnMubm9yZXBseS5n
|
||||||
EwEIAD4CGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AWIQRrpNqLHIiklCiinD0M
|
aXRodWIuY29tPokBVwQTAQgAQQIbAwULCQgHAgIiAgYVCgkICwIEFgIDAQIeBwIX
|
||||||
acHvQRgeEwUCYk2YRAUJC2h2bgAKCRAMacHvQRgeE7nTB/4tZq9/gQcpCKgPVKI8
|
gBYhBGuk2osciKSUKKKcPQxpwe9BGB4TBQJmJYbdBQkPGNgHAAoJEAxpwe9BGB4T
|
||||||
MKtY/NWOc9nRr5LrNjY/qFU2Z2gMoUQT1fIBm6gjd9iI92QgLMeekuR2fXBBOx3y
|
5Z4H/3sDqi2QozHbsUy2dm+xS105bpmiNn3aDYzEyjOBggypDWpG5fmlD6ya3Yfd
|
||||||
JbiklXfQVGytEOochkemylwtaCZTHB61KWkemDfS+YeG3qBKwFa5B+zJvp7LqYdQ
|
H172auahZ1SK6t7Q7u97QdtrvMKTVBBq+DahkHnvw4nsPwBI00aTy616of1+CirZ
|
||||||
GrNFFgtHwkhNiviDN7JFxsMGM2IpopgvNYB72B35q3YnrDsgDNlD3eraKU25sMx7
|
lDPo912aLrWlouizuy6qeJE0EfB0PGXtuZP3E0yZHqgmIOBrQw5fJQtrka5WWK3C
|
||||||
2vNHABrdHzd1ZnKDA1hSV6any5Ifw4NJsPaM0RrmwuwoWkL7WHPftbqkM0zy6RIe
|
AqO2Z1hZLh9ftheJtKSYX1gZnPEAWs3ZBG2tCk4+qAjB8y5kRvrJFpC36FkisYlg
|
||||||
O+2tlKsJ6cKfOCYL9fbS7/UmkVVcrSLpJCCwmdsra3/57uha7TofDvl+R32CWzrv
|
YTtAOSMHED/3YFsDsXFvLmrSkNBImjdAnRW59TD5XUgEMDZ9Dylz3/b4/gtNi2SX
|
||||||
yWfXtCBQSiBGYW5uaW5nIDxmYW5uaW5ncGpAeWFob28uY29tPokBVAQTAQgAPgIb
|
9WSYWC60/3Jgxh4u3cTUnUtW2yC0IFBKIEZhbm5pbmcgPGZhbm5pbmdwakB5YWhv
|
||||||
AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBGuk2osciKSUKKKcPQxpwe9BGB4T
|
by5jb20+iQFUBBMBCAA+AhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAFiEEa6Ta
|
||||||
BQJiTZhKBQkLaHZuAAoJEAxpwe9BGB4T58UH/RBEOnA9TDTKTi7T4y+R1/q2SUp+
|
ixyIpJQoopw9DGnB70EYHhMFAmYlhuUFCQ8Y2AcACgkQDGnB70EYHhOecwgApleV
|
||||||
tMzv91jhmlaDvNnA2lGVFNGj1tdy1O7xoCEEw9diKCVqVwHecuBQCaLI70r1W4Qw
|
9IOazPAk8pF0WfkslRWNrGHzaGoqO+WVhMS4doxR8bjqkrHwuI4c8Z2vCCMnKqb1
|
||||||
qixjKJwDDnPoMKfhjuvHEHRZV0Pg+uZ50DxkFNn+bPPlXABGelliAPTvetK3ELPJ
|
LF7djz9GXFGklvoyV7rQYrDx15bYWjtassvM4KExcnoPGxx9Kb7f0j0WSZwtwMUl
|
||||||
EIRzVJkFsS0McHwXJgmIPAz8ZVlwd1/Xu21MIKOkPzgXML7uq4PN++L+mM4RmpGU
|
XWvsrS0+BkbRz+PIpGtDJhlI++aRoZdWCz5j5st5HzmacC0GVuYGvRPj8uMW2LN5
|
||||||
phOetyxLO1xf6ZixCoUnA7Ayi0hAKUAhu9acuc8SoDacfKm1EQ26SHUhOTNm0YCH
|
5HvGzlzqWIQ7l68KQPz7g5KIFKUrCPyzZS0m8Nj+gRWhF3+u3/1SY2hoCzobSMJj
|
||||||
PPfucHJbUgqSUOYjkEftOtT0ZqVGWS7tR3iEIJu90MJ6SJRovag7khCsYY65AQ0E
|
PNhEovdpi8h5qbUOpHn2OM7l8/nioRaJwAmcMTnmlh1lqeyxIFYnFIBT24o3aEtN
|
||||||
Wulz1gEIAORuS4e+Ek+d+0gBMlnigNJ2HoQalKFaERf5K/iQZY4E6Z2ahJ4UFIj7
|
N2d1xg/moXvzNTq7yrQ6UEogRmFubmluZyAoaHR0cDovL3d3dy5hcGFjaGUub3Jn
|
||||||
ri3isWgOleP+REJJPfeSrWQ5XgdklDlHHyv4O5iMkEFWQHttiaTuvdomDncQrNRP
|
LykgPGZhbm5pbmdwakBhcGFjaGUub3JnPokBVAQTAQgAPgIbAwULCQgHAgYVCgkI
|
||||||
TaIOe9iQgfQzDw6mqsb7ZWd5ICA8Krd97BwNHjq/CZ9+WrU6GDc6ImissLVVGGdk
|
CwIEFgIDAQIeAQIXgBYhBGuk2osciKSUKKKcPQxpwe9BGB4TBQJmJYblBQkPGNgH
|
||||||
EGO7qZTqNUCeH4Znm/00mNMI4OH8xkwA2vzV5o3J5116zIuv29XQDtcSM+9NQ/Hd
|
AAoJEAxpwe9BGB4TgwMIAJj3aQYKSxt9iyIP5nFhIWAFSPZcZ0gRB6jYMuANVoJE
|
||||||
sjKIA0OpDyWE7Ek/SO+/CvkylwaOcmkuf33ADNjpF4BsBxn7L9XI1WJDtRaMkpbq
|
yelbhIziN2dXLOjHWpia2x9p7krxY6ZLtogkL4MjfVpCaaXwsaYOq6LeuPN27/Pt
|
||||||
MsymIxi35VUOGD+ms+72CcUStfYj4NEAEQEAAYkBPAQYAQgAJgIbDBYhBGuk2osc
|
9rRcDz7j5lA9u9MShc6O8lwNbVReCWR08H0oiEdS09xwZY3aiZniptRBeK+mcsNc
|
||||||
iKSUKKKcPQxpwe9BGB4TBQJiTZhrBQkLaHaVAAoJEAxpwe9BGB4TfjUH/24Q/H5u
|
Zw7kNmPHC79WaI6Rb/qnPLHJDD0l8vrVSShgmEeVJJoC/YjuVzKoiy2BmjSOpOLF
|
||||||
vXlb/Dpx4eFcyLhRVgREoMwwAlzM5GKInHO1W7SHeD7iVR8H1XQVHTgUBNBQ1bUd
|
d88NlquWbvLO6j2tzboUs+93Kc4MwG57hwRIqS7wfsENkecSRj23KQN0UOpxgwz7
|
||||||
f2R2fyNAbSgCP9VooN6Q/+uTjRsm5gRD7KY5NHxjTC/SZMwKNy/haXQk/qSjDLUy
|
b0+ii9F9jsddEqqpXspcM8zaacf+FpIwO6rk7v1U8LG5AQ0EWulz1gEIAORuS4e+
|
||||||
cD/2fQovuSLgoqZrTvyvz9e4JhFPk0i1it7I6KWnyyLGOItKc3Cv4p/vkD1ldYKN
|
Ek+d+0gBMlnigNJ2HoQalKFaERf5K/iQZY4E6Z2ahJ4UFIj7ri3isWgOleP+REJJ
|
||||||
XBhAxmErC9KHQK8pNi8y5z+F1JuZV74i3FRWa+3L2730qIDfR9K3jGIqOow59iqZ
|
PfeSrWQ5XgdklDlHHyv4O5iMkEFWQHttiaTuvdomDncQrNRPTaIOe9iQgfQzDw6m
|
||||||
c8cQLjcGU9lL4dzHh5Hcph8OC5U2aZaJOuMpCndD6XXPvq5/3QQU5rMqP//6tuVi
|
qsb7ZWd5ICA8Krd97BwNHjq/CZ9+WrU6GDc6ImissLVVGGdkEGO7qZTqNUCeH4Zn
|
||||||
aAMwT8RaYPiJJPI=
|
m/00mNMI4OH8xkwA2vzV5o3J5116zIuv29XQDtcSM+9NQ/HdsjKIA0OpDyWE7Ek/
|
||||||
=2Ips
|
SO+/CvkylwaOcmkuf33ADNjpF4BsBxn7L9XI1WJDtRaMkpbqMsymIxi35VUOGD+m
|
||||||
|
s+72CcUStfYj4NEAEQEAAYkBPAQYAQgAJgIbDBYhBGuk2osciKSUKKKcPQxpwe9B
|
||||||
|
GB4TBQJmJYcPBQkPGNg5AAoJEAxpwe9BGB4TTswH/3RmARIBV2LV72Sqk3rBcKLG
|
||||||
|
mY808npRuL6tQDVnrFPl9J8Q1/zItINYUc+2p8rHPW/N/5vyun4oVF9mT+Swqmuy
|
||||||
|
FkciQ8vCTdPlocGsGmb8eIKSvkzyRb3B8RkiXq2btDQBCVqVWbB6fh3FSI8L5442
|
||||||
|
r/IAQOKyd5wDGP2vDt1wGQ+0aV60gO2lWXOMi6U7dvt/+9vFaMciNdeZt7llNFIF
|
||||||
|
OzQuaMAqRP8viuuA29GAsy59x92LWEhm6RRSyU6rMGqfhbHQEs6FZ0x6zuBq8Ru7
|
||||||
|
T9wf/cc6uGGG6BqnjxFbWL/g9XJeU8gDxQ+ElJbYDXHT255g8kb92mHbJziPbxM=
|
||||||
|
=WUaV
|
||||||
-----END PGP PUBLIC KEY BLOCK-----
|
-----END PGP PUBLIC KEY BLOCK-----
|
||||||
pub 2048R/1556F3A4 2016-10-04
|
pub 2048R/1556F3A4 2016-10-04
|
||||||
uid Greg Woolsey <gwoolsey@apache.org>
|
uid Greg Woolsey <gwoolsey@apache.org>
|
||||||
|
|||||||
@ -1,6 +1,4 @@
|
|||||||
|
# Apache POI™
|
||||||
Apache POI
|
|
||||||
======================
|
|
||||||
|
|
||||||
A Java library for reading and writing Microsoft Office binary and OOXML file formats.
|
A Java library for reading and writing Microsoft Office binary and OOXML file formats.
|
||||||
|
|
||||||
@ -35,36 +33,45 @@ And lower-level, supporting components:
|
|||||||
| Components named H??F are for reading or writing OLE2 binary formats.
|
| Components named H??F are for reading or writing OLE2 binary formats.
|
||||||
| Components named X??F are for reading or writing OpenOffice XML (OOXML) formats.
|
| Components named X??F are for reading or writing OpenOffice XML (OOXML) formats.
|
||||||
|
|
||||||
Getting started
|
# Getting started
|
||||||
------------------
|
|
||||||
|
|
||||||
Website: https://poi.apache.org/
|
Website: https://poi.apache.org/
|
||||||
|
|
||||||
`Mailing lists`_:
|
[Mailing lists](https://poi.apache.org/mailinglists.html):
|
||||||
|
|
||||||
* `Developers`_
|
* [Developers](https://lists.apache.org/list.html?dev@poi.apache.org)
|
||||||
* `Users`_
|
* [Users](https://lists.apache.org/list.html?user@poi.apache.org) Including Announcements
|
||||||
* `General`_ (release announcements)
|
* [General](https://lists.apache.org/list.html?general@poi.apache.org)
|
||||||
|
|
||||||
Bug tracker:
|
## Bug trackers
|
||||||
|
|
||||||
* `Bugzilla`_
|
* [Bugzilla](https://bz.apache.org/bugzilla/buglist.cgi?product=POI)
|
||||||
* `GitHub pull requests`_
|
* [GitHub](https://github.com/apache/poi/issues)
|
||||||
|
|
||||||
Source code:
|
## Source code
|
||||||
|
|
||||||
* Official `Apache Subversion repo`_ at apache.org
|
* https://github.com/apache/poi
|
||||||
* `ViewVC repo browser`_ at apache.org
|
|
||||||
* `GitHub git mirror`_ at github.com
|
|
||||||
|
|
||||||
Requires Java 1.8 or later.
|
Requires Java 11 or later. `trunk` branch is used for 6.0.0 development. POI 4 and 5 releases require Java 8 or later.
|
||||||
|
|
||||||
Contributing
|
|
||||||
------------------
|
|
||||||
|
|
||||||
* Download and install svn or git, Java JDK 1.8+, and Apache Ant 1.8+ or Gradle
|
## Jars
|
||||||
|
|
||||||
* Check out the code from svn or git
|
A good resource for finding the published jars and forming build tool dependency definitions is https://mvnrepository.com/artifact/org.apache.poi.
|
||||||
|
|
||||||
|
* poi - main jar, including shared interfaces
|
||||||
|
* poi-scratchpad - extra classes to support legacy MS file formats (`H**F`)
|
||||||
|
* poi-ooxml - support for newer OOXML file formats (`X**F`)
|
||||||
|
* poi-ooxml-lite - generated classes based on MS XSDs used by poi-ooxml (only includes the most commonly used classes)
|
||||||
|
* poi-ooxml-full - generated classes based on MS XSDs (can be used instead of poi-ooxml-lite if you need support for less commonly used features)
|
||||||
|
* poi-excelant - tools for working with Excel files in Apache Ant scripts
|
||||||
|
* poi-examples
|
||||||
|
|
||||||
|
# Contributing
|
||||||
|
|
||||||
|
* Download and install git, Java JDK 11+, and Apache Ant 1.8+ or Gradle
|
||||||
|
|
||||||
|
* Check out the code from git
|
||||||
|
|
||||||
* Import the project into Eclipse or your favorite IDE
|
* Import the project into Eclipse or your favorite IDE
|
||||||
|
|
||||||
@ -82,25 +89,12 @@ Contributing
|
|||||||
* Scratchpad (Binary formats): poi-scratchpad/src/main/java/org/apache/poi/
|
* Scratchpad (Binary formats): poi-scratchpad/src/main/java/org/apache/poi/
|
||||||
* Examples: poi-examples/src/main/java/org/apache/poi/
|
* Examples: poi-examples/src/main/java/org/apache/poi/
|
||||||
|
|
||||||
* More info: `How To Build page`_ at apache.org
|
* More info: [How To Build page](https://poi.apache.org/devel/)
|
||||||
|
|
||||||
Building jar files
|
# Building jar files
|
||||||
------------------
|
|
||||||
|
|
||||||
To build the jar files for poi, poi-ooxml, poi-ooxml-lite, poi-ooxml-full and poi-examples::
|
To build the jar files for poi, poi-ooxml, poi-ooxml-lite, poi-ooxml-full and poi-examples::
|
||||||
|
|
||||||
./gradlew jar
|
./gradlew jar
|
||||||
|
|
||||||
gradlew jar
|
gradlew jar
|
||||||
|
|
||||||
.. _Mailing lists: https://poi.apache.org/mailinglists.html
|
|
||||||
.. _Developers: https://lists.apache.org/list.html?dev@poi.apache.org
|
|
||||||
.. _Users: https://lists.apache.org/list.html?user@poi.apache.org
|
|
||||||
.. _General: https://lists.apache.org/list.html?general@poi.apache.org
|
|
||||||
.. _Bugzilla: https://bz.apache.org/bugzilla/buglist.cgi?product=POI
|
|
||||||
.. _GitHub pull requests: https://github.com/apache/poi/pulls
|
|
||||||
|
|
||||||
.. _Apache Subversion repo: https://svn.apache.org/repos/asf/poi/trunk
|
|
||||||
.. _ViewVC repo browser: https://svn.apache.org/viewvc/poi/trunk
|
|
||||||
.. _GitHub git mirror: https://github.com/apache/poi
|
|
||||||
.. _How To Build page: http://poi.apache.org/devel/
|
|
||||||
@ -2,3 +2,8 @@
|
|||||||
|
|
||||||
If you suspect you have found a security vulnerability in Apache POI code, please read https://www.apache.org/security/
|
If you suspect you have found a security vulnerability in Apache POI code, please read https://www.apache.org/security/
|
||||||
for how to report the issue. Please do not report the details publicly until the report is reviewed.
|
for how to report the issue. Please do not report the details publicly until the report is reviewed.
|
||||||
|
|
||||||
|
## Secure Processing
|
||||||
|
|
||||||
|
We strongly discourage users of Apache POI from using the lib to parse documents from untrusted sources. For more details,
|
||||||
|
please read https://poi.apache.org/security.html.
|
||||||
252
build.gradle
252
build.gradle
@ -24,26 +24,33 @@ import javax.xml.xpath.XPathFactory
|
|||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://plugins.gradle.org/m2/' }
|
maven { url = 'https://plugins.gradle.org/m2/' }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'base'
|
id 'base'
|
||||||
id 'com.dorongold.task-tree' version '2.1.1'
|
id 'com.dorongold.task-tree' version '4.0.1'
|
||||||
id 'org.nosphere.apache.rat' version '0.8.0'
|
id 'org.nosphere.apache.rat' version '0.8.1'
|
||||||
id 'distribution'
|
id 'distribution'
|
||||||
id "com.github.spotbugs" version '5.0.14'
|
|
||||||
id 'de.thetaphi.forbiddenapis' version '3.5.1'
|
// 6.2.0+ requires JDK 11
|
||||||
id 'org.sonarqube' version '4.0.0.2929'
|
// this is the version of the Gradle plugin, it usually includes a
|
||||||
id 'org.cyclonedx.bom' version '1.7.4'
|
// different version of spotbugs itself
|
||||||
id 'com.adarshr.test-logger' version '3.2.0'
|
// Latest spotbugs: https://github.com/spotbugs/spotbugs
|
||||||
|
// Latest gradle plugin: https://plugins.gradle.org/plugin/com.github.spotbugs
|
||||||
|
id 'com.github.spotbugs' version '6.4.8'
|
||||||
|
|
||||||
|
id 'de.thetaphi.forbiddenapis' version '3.10'
|
||||||
|
id 'org.sonarqube' version '7.2.2.6593'
|
||||||
|
id 'org.cyclonedx.bom' version '2.4.1'
|
||||||
|
id 'com.adarshr.test-logger' version '4.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
//maven { url 'https://repository.apache.org/content/repositories/staging' }
|
// maven { url 'https://repository.apache.org/content/repositories/staging' }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only add the plugin for Sonar if enabled
|
// Only add the plugin for Sonar if enabled
|
||||||
@ -52,7 +59,8 @@ if (project.hasProperty('enableSonar')) {
|
|||||||
apply plugin: 'org.sonarqube'
|
apply plugin: 'org.sonarqube'
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isCIBuild = false;
|
boolean isCIBuild = false
|
||||||
|
String dateSuffix = new Date().format('yyyyMMdd')
|
||||||
|
|
||||||
// For help converting an Ant build to a Gradle build, see
|
// For help converting an Ant build to a Gradle build, see
|
||||||
// https://docs.gradle.org/current/userguide/ant.html
|
// https://docs.gradle.org/current/userguide/ant.html
|
||||||
@ -66,8 +74,8 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
antLibs("org.junit.jupiter:junit-jupiter:5.10.0")
|
antLibs("org.junit.jupiter:junit-jupiter:5.13.4")
|
||||||
antLibs("org.apache.ant:ant-junitlauncher:1.10.14")
|
antLibs("org.apache.ant:ant-junitlauncher:1.10.15")
|
||||||
}
|
}
|
||||||
|
|
||||||
ant.taskdef(name: "junit",
|
ant.taskdef(name: "junit",
|
||||||
@ -76,20 +84,9 @@ ant.taskdef(name: "junit",
|
|||||||
|
|
||||||
|
|
||||||
wrapper {
|
wrapper {
|
||||||
gradleVersion = '8.3'
|
gradleVersion = '8.14.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
task adjustWrapperPropertiesFile {
|
|
||||||
doLast {
|
|
||||||
ant.replaceregexp(match:'^#.*', replace:'', flags:'g', byline:true) {
|
|
||||||
fileset(dir: project.projectDir, includes: 'gradle/wrapper/gradle-wrapper.properties')
|
|
||||||
}
|
|
||||||
new File(project.projectDir, 'gradle/wrapper/gradle-wrapper.properties').with { it.text = it.readLines().findAll { it }.sort().join('\n') }
|
|
||||||
ant.fixcrlf(file: 'gradle/wrapper/gradle-wrapper.properties', eol: 'lf')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
wrapper.finalizedBy adjustWrapperPropertiesFile
|
|
||||||
|
|
||||||
group = 'org.apache.poi'
|
group = 'org.apache.poi'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -99,7 +96,7 @@ allprojects {
|
|||||||
// apply plugin: 'eclipse'
|
// apply plugin: 'eclipse'
|
||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
|
|
||||||
version = '5.2.4'
|
version = '6.0.0-SNAPSHOT'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -117,56 +114,57 @@ subprojects {
|
|||||||
apply plugin: 'com.adarshr.test-logger'
|
apply plugin: 'com.adarshr.test-logger'
|
||||||
|
|
||||||
ext {
|
ext {
|
||||||
bouncyCastleVersion = '1.76'
|
bouncyCastleVersion = '1.83'
|
||||||
commonsCodecVersion = '1.16.0'
|
commonsCodecVersion = '1.21.0'
|
||||||
commonsCompressVersion = '1.24.0'
|
commonsCompressVersion = '1.28.0'
|
||||||
commonsIoVersion = '2.13.0'
|
commonsIoVersion = '2.21.0'
|
||||||
commonsMathVersion = '3.6.1'
|
commonsMathVersion = '3.6.1'
|
||||||
junitVersion = '5.10.0'
|
junitVersion = '5.13.4'
|
||||||
log4jVersion = '2.20.0'
|
log4jVersion = '2.25.3'
|
||||||
mockitoVersion = '4.11.0'
|
mockitoVersion = '5.21.0'
|
||||||
hamcrestVersion = '2.2'
|
hamcrestVersion = '3.0'
|
||||||
xmlbeansVersion = '5.1.1'
|
xmlbeansVersion = '5.3.0'
|
||||||
batikVersion = '1.17'
|
batikVersion = '1.19'
|
||||||
graphics2dVersion = '0.43'
|
graphics2dVersion = '3.0.5'
|
||||||
pdfboxVersion = '2.0.29'
|
pdfboxVersion = '3.0.6'
|
||||||
saxonVersion = '11.5'
|
saxonVersion = '12.9'
|
||||||
|
xmlSecVersion = '3.0.6'
|
||||||
apiGuardianVersion = '1.1.2'
|
apiGuardianVersion = '1.1.2'
|
||||||
|
|
||||||
jdkVersion = (project.properties['jdkVersion'] ?: '8') as int
|
jdkVersion = (project.properties['jdkVersion'] ?: '11') as int
|
||||||
// see https://github.com/gradle/gradle/blob/master/subprojects/jvm-services/src/main/java/org/gradle/internal/jvm/inspection/JvmVendor.java
|
// see https://github.com/gradle/gradle/blob/master/subprojects/jvm-services/src/main/java/org/gradle/internal/jvm/inspection/JvmVendor.java
|
||||||
jdkVendor = (project.properties['jdkVendor'] ?: '') as String
|
jdkVendor = (project.properties['jdkVendor'] ?: '') as String
|
||||||
|
|
||||||
JAVA9_SRC = 'src/main/java9'
|
JAVA9_SRC = 'src/main/java9'
|
||||||
JAVA9_OUT = "${buildDir}/classes/java9/main/"
|
JAVA9_OUT = layout.buildDirectory.dir('classes/java9/main/').get().asFile.absolutePath
|
||||||
TEST9_SRC = 'src/test/java9'
|
TEST9_SRC = 'src/test/java9'
|
||||||
TEST9_OUT = "${buildDir}/classes/java9/test/"
|
TEST9_OUT = layout.buildDirectory.dir('classes/java9/test/').get().asFile.absolutePath
|
||||||
VERSIONS9 = 'META-INF/versions/9'
|
VERSIONS9 = '/META-INF/versions/9'
|
||||||
|
|
||||||
NO_SCRATCHPAD = (findProperty("scratchpad.ignore") == "true")
|
NO_SCRATCHPAD = (findProperty("scratchpad.ignore") == "true")
|
||||||
SAXON_TEST = (findProperty("saxon.test") == "true")
|
SAXON_TEST = (findProperty("saxon.test") == "true")
|
||||||
}
|
}
|
||||||
|
|
||||||
configurations {
|
configurations {
|
||||||
all {
|
configureEach {
|
||||||
resolutionStrategy {
|
resolutionStrategy {
|
||||||
force "commons-io:commons-io:${commonsIoVersion}"
|
force "commons-io:commons-io:${commonsIoVersion}"
|
||||||
force 'org.slf4j:slf4j-api:2.0.9'
|
force 'org.slf4j:slf4j-api:2.0.17'
|
||||||
force 'com.fasterxml.woodstox:woodstox-core:6.5.1'
|
force 'com.fasterxml.woodstox:woodstox-core:7.1.1'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile).configureEach {
|
||||||
options.encoding = 'UTF-8'
|
options.encoding = 'UTF-8'
|
||||||
options.compilerArgs += '-Xlint:unchecked'
|
options.compilerArgs += '-Xlint:unchecked'
|
||||||
options.deprecation = true
|
options.deprecation = true
|
||||||
options.incremental = true
|
options.incremental = true
|
||||||
}
|
}
|
||||||
tasks.withType(Test) {
|
tasks.withType(Test).configureEach {
|
||||||
systemProperty "file.encoding", "UTF-8"
|
systemProperty "file.encoding", "UTF-8"
|
||||||
}
|
}
|
||||||
tasks.withType(Javadoc) {
|
tasks.withType(Javadoc).configureEach {
|
||||||
options.encoding = 'UTF-8'
|
options.encoding = 'UTF-8'
|
||||||
}
|
}
|
||||||
tasks.withType(AbstractArchiveTask).configureEach {
|
tasks.withType(AbstractArchiveTask).configureEach {
|
||||||
@ -176,14 +174,18 @@ subprojects {
|
|||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
//maven { url 'https://repository.apache.org/content/repositories/staging' }
|
// maven { url 'https://repository.apache.org/content/repositories/staging' }
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation "org.junit.jupiter:junit-jupiter:${junitVersion}"
|
api platform("org.apache.logging.log4j:log4j-bom:${log4jVersion}")
|
||||||
|
api 'org.apache.logging.log4j:log4j-api'
|
||||||
|
testImplementation platform("org.junit:junit-bom:${junitVersion}")
|
||||||
|
testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||||
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||||
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
|
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
|
||||||
testImplementation "org.hamcrest:hamcrest:${hamcrestVersion}"
|
testImplementation "org.hamcrest:hamcrest:${hamcrestVersion}"
|
||||||
testImplementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
|
testImplementation 'org.apache.logging.log4j:log4j-core'
|
||||||
|
|
||||||
if (SAXON_TEST) {
|
if (SAXON_TEST) {
|
||||||
testRuntimeOnly("net.sf.saxon:Saxon-HE:${saxonVersion}") {
|
testRuntimeOnly("net.sf.saxon:Saxon-HE:${saxonVersion}") {
|
||||||
@ -210,33 +212,93 @@ subprojects {
|
|||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
options {
|
options {
|
||||||
if (jdkVersion > 8) addBooleanOption('html5', true)
|
addBooleanOption('html5', true)
|
||||||
addBooleanOption('Xdoclint:all,-missing', true)
|
addBooleanOption('Xdoclint:all,-missing', true)
|
||||||
links 'https://poi.apache.org/apidocs/dev/'
|
links 'https://poi.apache.org/apidocs/dev/'
|
||||||
links 'https://docs.oracle.com/javase/8/docs/api/'
|
if (jdkVersion >= 23) links 'https://docs.oracle.com/en/java/javase/23/docs/api/' else links 'https://docs.oracle.com/en/java/javase/11/docs/api/'
|
||||||
links 'https://xmlbeans.apache.org/docs/5.0.0/'
|
links 'https://xmlbeans.apache.org/docs/5.0.0/'
|
||||||
links 'https://commons.apache.org/proper/commons-compress/apidocs/'
|
links 'https://www.javadocs.dev/org.apache.commons/commons-compress/1.28.0/'
|
||||||
use = true
|
use = true
|
||||||
splitIndex = true
|
splitIndex = true
|
||||||
source = "1.8"
|
source = "11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper-target to get a directory with all third-party libraries
|
// helper-target to get a directory with all third-party libraries
|
||||||
// this is used for mass-regression-testing
|
// this is used for mass-regression-testing
|
||||||
task getDeps(type: Copy) {
|
tasks.register('getDeps', Copy) {
|
||||||
from sourceSets.main.runtimeClasspath
|
from sourceSets.main.runtimeClasspath
|
||||||
into 'build/runtime/'
|
into 'build/runtime/'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Jar) {
|
tasks.withType(Jar).configureEach {
|
||||||
duplicatesStrategy = 'fail'
|
duplicatesStrategy = DuplicatesStrategy.FAIL
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
doLast {
|
doLast {
|
||||||
ant.checksum(file: it.archivePath, algorithm: 'SHA-256', fileext: '.sha256', format: 'MD5SUM')
|
// make sure we do not have distribution jar-files with different versions
|
||||||
ant.checksum(file: it.archivePath, algorithm: 'SHA-512', fileext: '.sha512', format: 'MD5SUM')
|
// in the build-dir as those lead to strange errors about "duplicate modules"
|
||||||
|
// when building java9 JPMS class files ("java9")
|
||||||
|
ant.delete(failOnError: true, verbose: true) {
|
||||||
|
fileset(dir: "../build/dist/maven/${base.archivesName.get()}", erroronmissingdir: false) {
|
||||||
|
include(name: '*.jar')
|
||||||
|
exclude(name: "*${version}.jar")
|
||||||
|
exclude(name: "*${version}-sources.jar")
|
||||||
|
|
||||||
|
include(name: '*.jar.asc')
|
||||||
|
exclude(name: "*${version}.jar.asc")
|
||||||
|
exclude(name: "*${version}-sources.jar.asc")
|
||||||
|
|
||||||
|
include(name: '*.jar.sha256')
|
||||||
|
exclude(name: "*${version}.jar.sha256")
|
||||||
|
exclude(name: "*${version}-sources.jar.sha256")
|
||||||
|
|
||||||
|
include(name: '*.jar.sha512')
|
||||||
|
exclude(name: "*${version}.jar.sha512")
|
||||||
|
exclude(name: "*${version}-sources.jar.sha512")
|
||||||
|
|
||||||
|
include(name: '*.pom')
|
||||||
|
exclude(name: "*${version}.pom")
|
||||||
|
|
||||||
|
include(name: '*.pom.asc')
|
||||||
|
exclude(name: "*${version}.pom.asc")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// use failOnError=false for -javadoc and -tests as not all modules create this directory
|
||||||
|
ant.delete(failOnError: false, verbose: true) {
|
||||||
|
fileset(dir: "../build/dist/maven/${base.archivesName.get()}-javadoc", erroronmissingdir: false) {
|
||||||
|
include(name: '*-javadoc.jar')
|
||||||
|
exclude(name: "*${version}-javadoc.jar")
|
||||||
|
|
||||||
|
include(name: '*-javadoc.jar.asc')
|
||||||
|
exclude(name: "*${version}-javadoc.jar.asc")
|
||||||
|
|
||||||
|
include(name: '*-javadoc.jar.sha256')
|
||||||
|
exclude(name: "*${version}-javadoc.jar.sha256")
|
||||||
|
|
||||||
|
include(name: '*-javadoc.jar.sha512')
|
||||||
|
exclude(name: "*${version}-javadoc.jar.sha512")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ant.delete(failOnError: false, verbose: true) {
|
||||||
|
fileset(dir: "../build/dist/maven/${base.archivesName.get()}-tests", erroronmissingdir: false) {
|
||||||
|
include(name: '*-tests.jar')
|
||||||
|
exclude(name: "*${version}-tests.jar")
|
||||||
|
|
||||||
|
include(name: '*-tests.jar.asc')
|
||||||
|
exclude(name: "*${version}-tests.jar.asc")
|
||||||
|
|
||||||
|
include(name: '*-tests.jar.sha256')
|
||||||
|
exclude(name: "*${version}-tests.jar.sha256")
|
||||||
|
|
||||||
|
include(name: '*-tests.jar.sha512')
|
||||||
|
exclude(name: "*${version}-tests.jar.sha512")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ant.checksum(file: it.archiveFile.get().asFile, algorithm: 'SHA-256', fileext: '.sha256', format: 'MD5SUM')
|
||||||
|
ant.checksum(file: it.archiveFile.get().asFile, algorithm: 'SHA-512', fileext: '.sha512', format: 'MD5SUM')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -264,15 +326,19 @@ subprojects {
|
|||||||
javadocJar {
|
javadocJar {
|
||||||
// if javadocs and binaries are in the same directory, JPMS complaints about duplicated modules
|
// if javadocs and binaries are in the same directory, JPMS complaints about duplicated modules
|
||||||
// in the module-path
|
// in the module-path
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-javadoc")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-javadoc")
|
||||||
}
|
}
|
||||||
|
|
||||||
sourcesJar {
|
sourcesJar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
exclude 'META-INF/services/**'
|
exclude 'META-INF/services/**'
|
||||||
}
|
}
|
||||||
|
|
||||||
test {
|
test {
|
||||||
|
// use US locale for tests
|
||||||
|
systemProperty "user.language", "en"
|
||||||
|
systemProperty "user.country", "US"
|
||||||
|
|
||||||
// make XML test-results available for Jenkins CI
|
// make XML test-results available for Jenkins CI
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
reports {
|
reports {
|
||||||
@ -309,10 +375,10 @@ subprojects {
|
|||||||
]
|
]
|
||||||
|
|
||||||
// detect if running on Jenkins/CI
|
// detect if running on Jenkins/CI
|
||||||
isCIBuild |= Boolean.valueOf(System.getenv("CI_BUILD"));
|
isCIBuild |= Boolean.valueOf(System.getenv("CI_BUILD"))
|
||||||
|
|
||||||
if (isCIBuild) {
|
if (isCIBuild) {
|
||||||
System.out.println("Run with reduced parallelism for CI build");
|
System.out.println("Run with reduced parallelism for CI build")
|
||||||
|
|
||||||
jvmArgs += [
|
jvmArgs += [
|
||||||
// Strictly serial
|
// Strictly serial
|
||||||
@ -355,7 +421,6 @@ subprojects {
|
|||||||
systemProperties['java.locale.providers'] = 'JRE,CLDR'
|
systemProperties['java.locale.providers'] = 'JRE,CLDR'
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
if (jdkVersion > 8) {
|
|
||||||
// some options were removed in JDK 18
|
// some options were removed in JDK 18
|
||||||
if (jdkVersion < 18) {
|
if (jdkVersion < 18) {
|
||||||
jvmArgs += [
|
jvmArgs += [
|
||||||
@ -366,7 +431,7 @@ subprojects {
|
|||||||
jvmArgs += [
|
jvmArgs += [
|
||||||
// see https://github.com/java9-modularity/gradle-modules-plugin/issues/97
|
// see https://github.com/java9-modularity/gradle-modules-plugin/issues/97
|
||||||
// opposed to the recommendation there, it doesn't work to add ... to the dependencies
|
// opposed to the recommendation there, it doesn't work to add ... to the dependencies
|
||||||
// testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.10.0'
|
// testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.13.2'
|
||||||
// gradles gradle-worker.jar is still not a JPMS module and thus runs as unnamed module
|
// gradles gradle-worker.jar is still not a JPMS module and thus runs as unnamed module
|
||||||
'--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=org.apache.poi.poi',
|
'--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=org.apache.poi.poi',
|
||||||
'--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED',
|
'--add-exports','org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED',
|
||||||
@ -376,7 +441,6 @@ subprojects {
|
|||||||
'-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
|
'-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
jacoco {
|
jacoco {
|
||||||
excludes = [
|
excludes = [
|
||||||
@ -388,7 +452,7 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jacoco {
|
jacoco {
|
||||||
toolVersion = '0.8.10'
|
toolVersion = '0.8.13'
|
||||||
}
|
}
|
||||||
|
|
||||||
jacocoTestReport {
|
jacocoTestReport {
|
||||||
@ -407,7 +471,7 @@ subprojects {
|
|||||||
//
|
//
|
||||||
// Some additional properties are currently set in the Jenkins-DSL, see jenkins/create_jobs.groovy
|
// Some additional properties are currently set in the Jenkins-DSL, see jenkins/create_jobs.groovy
|
||||||
//
|
//
|
||||||
sonarqube {
|
sonar {
|
||||||
properties {
|
properties {
|
||||||
// as we currently use build/<module>/ as project-basedir, we need to tell Sonar to use
|
// as we currently use build/<module>/ as project-basedir, we need to tell Sonar to use
|
||||||
// the root-folder as "basedir" for the projects
|
// the root-folder as "basedir" for the projects
|
||||||
@ -434,21 +498,20 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
forbiddenApisTest {
|
forbiddenApisTest {
|
||||||
// forbiddenapis bundled signatures max supported version is 17
|
// forbiddenapis:3.8 bundled signatures max supported version is 23
|
||||||
// also see https://github.com/policeman-tools/forbidden-apis/issues/191
|
targetCompatibility = (JavaVersion.VERSION_23.isCompatibleWith(JavaVersion.current()) ? JavaVersion.current() : JavaVersion.VERSION_23)
|
||||||
targetCompatibility = (JavaVersion.VERSION_17.isCompatibleWith(JavaVersion.current()) ? JavaVersion.current() : JavaVersion.VERSION_17)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
forbiddenApisMain {
|
forbiddenApisMain {
|
||||||
signaturesFiles += files('../src/resources/devtools/forbidden-signatures-prod.txt')
|
signaturesFiles += files('../src/resources/devtools/forbidden-signatures-prod.txt')
|
||||||
targetCompatibility = (JavaVersion.VERSION_17.isCompatibleWith(JavaVersion.current()) ? JavaVersion.current() : JavaVersion.VERSION_17)
|
targetCompatibility = (JavaVersion.VERSION_23.isCompatibleWith(JavaVersion.current()) ? JavaVersion.current() : JavaVersion.VERSION_23)
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
POI(MavenPublication) {
|
POI(MavenPublication) {
|
||||||
groupId 'org.apache.poi'
|
groupId = 'org.apache.poi'
|
||||||
artifactId project.archivesBaseName
|
artifactId = base.archivesName.get()
|
||||||
|
|
||||||
from components.java
|
from components.java
|
||||||
|
|
||||||
@ -529,9 +592,9 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
generatePomFileForPOIPublication.destination = "../build/dist/maven/${project.archivesBaseName}/${project.archivesBaseName}-${project.version}.pom"
|
generatePomFileForPOIPublication.destination = "../build/dist/maven/${base.archivesName.get()}/${base.archivesName.get()}-${project.version}.pom"
|
||||||
|
|
||||||
tasks.withType(GenerateModuleMetadata) {
|
tasks.withType(GenerateModuleMetadata).configureEach {
|
||||||
enabled = false
|
enabled = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -559,14 +622,14 @@ subprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// initial try to provide a combined JavaDoc, grouping is still missing here, though!
|
// initial try to provide a combined JavaDoc, grouping is still missing here, though!
|
||||||
task allJavaDoc(type: Javadoc) {
|
tasks.register('allJavaDoc', Javadoc) {
|
||||||
var prj = [ project(':poi'), project(':poi-excelant'), project(':poi-ooxml'), project(':poi-scratchpad') ]
|
var prj = [project(':poi'), project(':poi-excelant'), project(':poi-ooxml'), project(':poi-scratchpad')]
|
||||||
source prj.collect { it.sourceSets.main.allJava }
|
source prj.collect { it.sourceSets.main.allJava }
|
||||||
|
|
||||||
// for possible settings see https://docs.gradle.org/current/dsl/org.gradle.api.tasks.javadoc.Javadoc.html
|
// for possible settings see https://docs.gradle.org/current/dsl/org.gradle.api.tasks.javadoc.Javadoc.html
|
||||||
classpath = files(subprojects.collect { it.sourceSets.main.compileClasspath })
|
classpath = files(subprojects.collect { it.sourceSets.main.compileClasspath })
|
||||||
destinationDir = file("${buildDir}/docs/javadoc")
|
destinationDir = layout.buildDirectory.dir('docs/javadoc').get().asFile
|
||||||
maxMemory="2048M"
|
maxMemory = "2048M"
|
||||||
|
|
||||||
// for possible options see https://docs.gradle.org/current/javadoc/org/gradle/external/javadoc/StandardJavadocDocletOptions.html
|
// for possible options see https://docs.gradle.org/current/javadoc/org/gradle/external/javadoc/StandardJavadocDocletOptions.html
|
||||||
options.use = true
|
options.use = true
|
||||||
@ -642,7 +705,9 @@ rat {
|
|||||||
"osgi/README.md",
|
"osgi/README.md",
|
||||||
"src/resources/ooxml-lite-report.*",
|
"src/resources/ooxml-lite-report.*",
|
||||||
// ignore svn conflict artifacts
|
// ignore svn conflict artifacts
|
||||||
"**/module-info.*"
|
"**/module-info.*",
|
||||||
|
"poi-examples/src/main/groovy/settings.gradle",
|
||||||
|
"poi-examples/src/main/groovy/.gradle/**"
|
||||||
]
|
]
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -685,13 +750,13 @@ task jenkinsLite(dependsOn: [
|
|||||||
|
|
||||||
//compileJava.dependsOn 'downloadJarsToLibs'
|
//compileJava.dependsOn 'downloadJarsToLibs'
|
||||||
|
|
||||||
task replaceVersion() {
|
tasks.register('replaceVersion') {
|
||||||
outputs.upToDateWhen { false }
|
outputs.upToDateWhen { false }
|
||||||
|
|
||||||
var version = subprojects[0].version
|
var version = subprojects[0].version
|
||||||
var tokens = [
|
var tokens = [
|
||||||
[ 'osgi', 'pom.xml', '(packaging>\\n\\s*<version>)[0-9.]+(?:-SNAPSHOT|-RC\\d+)?', "\\1${version}" ],
|
['osgi', 'pom.xml', '(packaging>\\n\\s*<version>)[0-9.]+(?:-SNAPSHOT|-RC\\d+)?', "\\1${version}"],
|
||||||
[ 'osgi', 'pom.xml', '(<poi.version>)[0-9.]+(?:-SNAPSHOT|-RC\\d+)?', "\\1${version}" ]
|
['osgi', 'pom.xml', '(<poi.version>)[0-9.]+(?:-SNAPSHOT|-RC\\d+)?', "\\1${version}"]
|
||||||
// [ '.', 'build.gradle', ' version = \'[0-9.]+(?:-SNAPSHOT)?\'', " version = '${version}'" ]
|
// [ '.', 'build.gradle', ' version = \'[0-9.]+(?:-SNAPSHOT)?\'', " version = '${version}'" ]
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -716,20 +781,13 @@ task zipJavadocs(type: Zip, dependsOn: allJavaDoc) {
|
|||||||
archiveExtension = 'jar'
|
archiveExtension = 'jar'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Tar) {
|
tasks.withType(Tar).configureEach {
|
||||||
compression = Compression.GZIP
|
compression = Compression.GZIP
|
||||||
archiveExtension = 'tgz'
|
archiveExtension = 'tgz'
|
||||||
}
|
}
|
||||||
|
|
||||||
distributions {
|
distributions {
|
||||||
var version = subprojects[0].version
|
|
||||||
var date = new Date().format('yyyyMMdd')
|
|
||||||
|
|
||||||
var poiDep = project(':poi').configurations.getAt('compileClasspath')
|
|
||||||
var ooxmlImp = project(':poi-ooxml').configurations.getAt('compileClasspath')
|
|
||||||
|
|
||||||
src {
|
src {
|
||||||
distributionBaseName = "poi-src-${version}-${date}"
|
|
||||||
contents {
|
contents {
|
||||||
from('.') {
|
from('.') {
|
||||||
exclude '*/build/**'
|
exclude '*/build/**'
|
||||||
@ -782,7 +840,7 @@ distributions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task soLinkCheck() {
|
tasks.register('soLinkCheck') {
|
||||||
doLast {
|
doLast {
|
||||||
def path = ant.path {
|
def path = ant.path {
|
||||||
fileset(dir: '.', includes: '**/*.java') {
|
fileset(dir: '.', includes: '**/*.java') {
|
||||||
@ -819,12 +877,14 @@ var srcDep = [
|
|||||||
':poi-ooxml-lite:generateModuleInfo'
|
':poi-ooxml-lite:generateModuleInfo'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
srcDistTar.setArchiveFileName("apache-poi-src-${subprojects[0].version}-${dateSuffix}.tgz")
|
||||||
|
srcDistZip.setArchiveFileName("apache-poi-src-${subprojects[0].version}-${dateSuffix}.zip")
|
||||||
srcDistTar.dependsOn srcDep
|
srcDistTar.dependsOn srcDep
|
||||||
srcDistZip.dependsOn srcDep
|
srcDistZip.dependsOn srcDep
|
||||||
soLinkCheck.dependsOn srcDep
|
soLinkCheck.dependsOn srcDep
|
||||||
rat.dependsOn soLinkCheck
|
rat.dependsOn soLinkCheck
|
||||||
|
|
||||||
task fixDistDir {
|
tasks.register('fixDistDir') {
|
||||||
doLast {
|
doLast {
|
||||||
ant.mkdir(dir: 'build/dist')
|
ant.mkdir(dir: 'build/dist')
|
||||||
ant.move(todir: 'build/dist') {
|
ant.move(todir: 'build/dist') {
|
||||||
|
|||||||
559
build.xml
559
build.xml
@ -26,7 +26,7 @@ under the License.
|
|||||||
To build the documentation you will need to install forrest and set
|
To build the documentation you will need to install forrest and set
|
||||||
the FORREST_HOME environment variable.
|
the FORREST_HOME environment variable.
|
||||||
|
|
||||||
Since POI 4.0 you will need JDK 1.8 or newer to build and run POI.
|
Since POI 6.0 you will need JDK 11 or newer to build and run POI.
|
||||||
|
|
||||||
Some people may find the tests hang when run through Ant. If this
|
Some people may find the tests hang when run through Ant. If this
|
||||||
happens to you, try giving Ant some more memory when you run it, eg:
|
happens to you, try giving Ant some more memory when you run it, eg:
|
||||||
@ -42,7 +42,7 @@ under the License.
|
|||||||
|
|
||||||
<description>The Apache POI project Ant build.</description>
|
<description>The Apache POI project Ant build.</description>
|
||||||
|
|
||||||
<property name="version.id" value="5.2.4"/>
|
<property name="version.id" value="6.0.0-SNAPSHOT"/>
|
||||||
<property name="release.rc" value=""/>
|
<property name="release.rc" value=""/>
|
||||||
|
|
||||||
<property environment="env"/>
|
<property environment="env"/>
|
||||||
@ -60,8 +60,8 @@ under the License.
|
|||||||
|
|
||||||
|
|
||||||
<!-- compiler options -->
|
<!-- compiler options -->
|
||||||
<property name="jdk.version.source" value="1.8" description="JDK version of source code"/>
|
<property name="jdk.version.source" value="11" description="JDK version of source code"/>
|
||||||
<property name="jdk.version.class" value="1.8" description="JDK version of generated class files"/>
|
<property name="jdk.version.class" value="11" description="JDK version of generated class files"/>
|
||||||
<property name="compile.debug" value="true"/>
|
<property name="compile.debug" value="true"/>
|
||||||
|
|
||||||
<condition property="isIBMVM">
|
<condition property="isIBMVM">
|
||||||
@ -69,7 +69,7 @@ under the License.
|
|||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<condition property="isJava8" else="false">
|
<condition property="isJava8" else="false">
|
||||||
<equals arg1="${ant.java.version}" arg2="1.8"/>
|
<equals arg1="${ant.java.version}" arg2="11"/>
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<!-- add addOpens parameter for Java 9 and higher -->
|
<!-- add addOpens parameter for Java 9 and higher -->
|
||||||
@ -263,92 +263,95 @@ under the License.
|
|||||||
|
|
||||||
|
|
||||||
<!-- jars in the /lib directory, see the fetch-jars target-->
|
<!-- jars in the /lib directory, see the fetch-jars target-->
|
||||||
<dependency prefix="main.commons-codec" artifact="commons-codec:commons-codec:1.16.0" usage="main"/>
|
<dependency prefix="main.commons-codec" artifact="commons-codec:commons-codec:1.19.0" usage="main"/>
|
||||||
<dependency prefix="main.commons-collections4" artifact="org.apache.commons:commons-collections4:4.4" usage="main"/>
|
<dependency prefix="main.commons-collections4" artifact="org.apache.commons:commons-collections4:4.5.0" usage="main"/>
|
||||||
<dependency prefix="main.commons-math3" artifact="org.apache.commons:commons-math3:3.6.1" usage="main"/>
|
<dependency prefix="main.commons-math3" artifact="org.apache.commons:commons-math3:3.6.1" usage="main"/>
|
||||||
<dependency prefix="main.commons-io" artifact="commons-io:commons-io:2.13.0" usage="main"/>
|
<dependency prefix="main.commons-io" artifact="commons-io:commons-io:2.20.0" usage="main"/>
|
||||||
<dependency prefix="main.com.zaxxer" artifact="com.zaxxer:SparseBitSet:1.3" usage="main"/>
|
<dependency prefix="main.com.zaxxer" artifact="com.zaxxer:SparseBitSet:1.3" usage="main"/>
|
||||||
<dependency prefix="main.log4j-api" artifact="org.apache.logging.log4j:log4j-api:2.20.0" usage="main"/>
|
<dependency prefix="main.log4j-api" artifact="org.apache.logging.log4j:log4j-api:2.25.3" usage="main"/>
|
||||||
|
|
||||||
<dependency prefix="main.junit-api" artifact="org.junit.jupiter:junit-jupiter-api:5.10.0" usage="main-tests"/>
|
<dependency prefix="main.junit-api" artifact="org.junit.jupiter:junit-jupiter-api:5.13.4" usage="main-tests"/>
|
||||||
<dependency prefix="main.junit-jengine" artifact="org.junit.jupiter:junit-jupiter-engine:5.10.0" usage="main-tests"/>
|
<dependency prefix="main.junit-jengine" artifact="org.junit.jupiter:junit-jupiter-engine:5.13.4" usage="main-tests"/>
|
||||||
<dependency prefix="main.junit-params" artifact="org.junit.jupiter:junit-jupiter-params:5.10.0" usage="main-tests"/>
|
<dependency prefix="main.junit-params" artifact="org.junit.jupiter:junit-jupiter-params:5.13.4" usage="main-tests"/>
|
||||||
<dependency prefix="main.junit-opentest4j" artifact="org.opentest4j:opentest4j:1.2.0" usage="main-tests"/>
|
<dependency prefix="main.junit-opentest4j" artifact="org.opentest4j:opentest4j:1.2.0" usage="main-tests"/>
|
||||||
<dependency prefix="main.junit-apiguardian" artifact="org.apiguardian:apiguardian-api:1.1.2" usage="main-tests"/>
|
<dependency prefix="main.junit-apiguardian" artifact="org.apiguardian:apiguardian-api:1.1.2" usage="main-tests"/>
|
||||||
<dependency prefix="main.junit-pcommons" artifact="org.junit.platform:junit-platform-commons:1.10.0" usage="main-tests"/>
|
<dependency prefix="main.junit-pcommons" artifact="org.junit.platform:junit-platform-commons:1.13.4" usage="main-tests"/>
|
||||||
<dependency prefix="main.junit-pengine" artifact="org.junit.platform:junit-platform-engine:1.10.0" usage="main-tests"/>
|
<dependency prefix="main.junit-pengine" artifact="org.junit.platform:junit-platform-engine:1.13.4" usage="main-tests"/>
|
||||||
<dependency prefix="main.junit-plauncher" artifact="org.junit.platform:junit-platform-launcher:1.10.0" usage="main-tests"/>
|
<dependency prefix="main.junit-plauncher" artifact="org.junit.platform:junit-platform-launcher:1.13.4" usage="main-tests"/>
|
||||||
|
|
||||||
|
|
||||||
<dependency prefix="main.jmh" artifact="org.openjdk.jmh:jmh-core:1.35" usage="main-tests"/>
|
<dependency prefix="main.jmh" artifact="org.openjdk.jmh:jmh-core:1.35" usage="main-tests"/>
|
||||||
<dependency prefix="main.jmhAnnotation" artifact="org.openjdk.jmh:jmh-generator-annprocess:1.35" usage="main-tests"/>
|
<dependency prefix="main.jmhAnnotation" artifact="org.openjdk.jmh:jmh-generator-annprocess:1.35" usage="main-tests"/>
|
||||||
<dependency prefix="main.hamcrest" artifact="org.hamcrest:hamcrest:2.2" usage="main-tests"/>
|
<dependency prefix="main.hamcrest" artifact="org.hamcrest:hamcrest:3.0" usage="main-tests"/>
|
||||||
<dependency prefix="main.xmlunit" artifact="org.xmlunit:xmlunit-core:2.9.1" usage="main-tests"/>
|
<dependency prefix="main.xmlunit" artifact="org.xmlunit:xmlunit-core:2.10.3" usage="main-tests"/>
|
||||||
<dependency prefix="main.mockito" artifact="org.mockito:mockito-core:4.11.0" usage="main-tests"/>
|
<dependency prefix="main.mockito" artifact="org.mockito:mockito-core:5.20.0" usage="main-tests"/>
|
||||||
<dependency prefix="main.byte-buddy" artifact="net.bytebuddy:byte-buddy:1.14.7" usage="main-tests"/>
|
<dependency prefix="main.byte-buddy" artifact="net.bytebuddy:byte-buddy:1.17.5" usage="main-tests"/>
|
||||||
<dependency prefix="main.byte-buddy-agent" artifact="net.bytebuddy:byte-buddy-agent:1.14.7" usage="main-tests"/>
|
<dependency prefix="main.byte-buddy-agent" artifact="net.bytebuddy:byte-buddy-agent:1.17.5" usage="main-tests"/>
|
||||||
<dependency prefix="main.objenesis" artifact="org.objenesis:objenesis:3.1" usage="main-tests"/>
|
<dependency prefix="main.objenesis" artifact="org.objenesis:objenesis:3.1" usage="main-tests"/>
|
||||||
<dependency prefix="main.log4j-core" artifact="org.apache.logging.log4j:log4j-core:2.20.0" usage="main-tests"/>
|
<dependency prefix="main.log4j-core" artifact="org.apache.logging.log4j:log4j-core:2.25.3" usage="main-tests"/>
|
||||||
<dependency prefix="main.commons-logging" artifact="commons-logging:commons-logging:1.2" usage="main-tests"/>
|
<dependency prefix="main.commons-logging" artifact="commons-logging:commons-logging:1.2" usage="main-tests"/>
|
||||||
|
|
||||||
<dependency prefix="main.ant" artifact="org.apache.ant:ant:1.10.14" usage="excelant"/>
|
<dependency prefix="main.ant" artifact="org.apache.ant:ant:1.10.15" usage="excelant"/>
|
||||||
<dependency prefix="main.antlauncher" artifact="org.apache.ant:ant-launcher:1.10.14" usage="excelant"/>
|
<dependency prefix="main.antlauncher" artifact="org.apache.ant:ant-launcher:1.10.15" usage="excelant"/>
|
||||||
|
|
||||||
<!-- xml signature libs - not part of the distribution -->
|
<!-- xml signature libs - not part of the distribution -->
|
||||||
<dependency prefix="dsig.xmlsec" artifact="org.apache.santuario:xmlsec:3.0.2" usage="ooxml-provided"/>
|
<dependency prefix="dsig.xmlsec" artifact="org.apache.santuario:xmlsec:3.0.6" usage="ooxml-provided"/>
|
||||||
<dependency prefix="dsig.bouncycastle-prov" artifact="org.bouncycastle:bcprov-jdk18on:1.76" usage="ooxml-provided"/>
|
<dependency prefix="dsig.bouncycastle-prov" artifact="org.bouncycastle:bcprov-jdk18on:1.82" usage="ooxml-provided"/>
|
||||||
<dependency prefix="dsig.bouncycastle-pkix" artifact="org.bouncycastle:bcpkix-jdk18on:1.76" usage="ooxml-provided"/>
|
<dependency prefix="dsig.bouncycastle-pkix" artifact="org.bouncycastle:bcpkix-jdk18on:1.82" usage="ooxml-provided"/>
|
||||||
<dependency prefix="dsig.bouncycastle-util" artifact="org.bouncycastle:bcutil-jdk18on:1.76" usage="ooxml-provided"/>
|
<dependency prefix="dsig.bouncycastle-util" artifact="org.bouncycastle:bcutil-jdk18on:1.82" usage="ooxml-provided"/>
|
||||||
<!-- only used for signing the release - not used with the ooxml signatures -->
|
<!-- only used for signing the release - not used with the ooxml signatures -->
|
||||||
<dependency prefix="dsig.bouncycastle-bcpg" artifact="org.bouncycastle:bcpg-jdk18on:1.76" usage="util"/>
|
<dependency prefix="dsig.bouncycastle-bcpg" artifact="org.bouncycastle:bcpg-jdk18on:1.82" usage="util"/>
|
||||||
<dependency prefix="ooxml.test.stax2" artifact="org.codehaus.woodstox:stax2-api:4.2.1" usage="ooxml-provided"/>
|
<dependency prefix="ooxml.test.stax2" artifact="org.codehaus.woodstox:stax2-api:4.2.1" usage="ooxml-provided"/>
|
||||||
|
|
||||||
<!-- svg/batik/pdf libs - not part of the distribution - move batik to its own directory because of JPMS module-path issues -->
|
<!-- svg/batik/pdf libs - not part of the distribution - move batik to its own directory because of JPMS module-path issues -->
|
||||||
<dependency prefix="svg.xml-apis-ext" artifact="xml-apis:xml-apis-ext:1.3.04" usage="ooxml-batik"/>
|
<dependency prefix="svg.xml-apis-ext" artifact="xml-apis:xml-apis-ext:1.3.04" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.xmlgraphics-commons" artifact="org.apache.xmlgraphics:xmlgraphics-commons:2.7" usage="ooxml-batik"/>
|
<dependency prefix="svg.xmlgraphics-commons" artifact="org.apache.xmlgraphics:xmlgraphics-commons:2.11" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-anim" artifact="org.apache.xmlgraphics:batik-anim:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-anim" artifact="org.apache.xmlgraphics:batik-anim:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-awt-util" artifact="org.apache.xmlgraphics:batik-awt-util:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-awt-util" artifact="org.apache.xmlgraphics:batik-awt-util:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-bridge" artifact="org.apache.xmlgraphics:batik-bridge:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-bridge" artifact="org.apache.xmlgraphics:batik-bridge:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-codec" artifact="org.apache.xmlgraphics:batik-codec:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-codec" artifact="org.apache.xmlgraphics:batik-codec:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-constants" artifact="org.apache.xmlgraphics:batik-constants:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-constants" artifact="org.apache.xmlgraphics:batik-constants:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-css" artifact="org.apache.xmlgraphics:batik-css:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-css" artifact="org.apache.xmlgraphics:batik-css:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-dom" artifact="org.apache.xmlgraphics:batik-dom:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-dom" artifact="org.apache.xmlgraphics:batik-dom:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-ext" artifact="org.apache.xmlgraphics:batik-ext:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-ext" artifact="org.apache.xmlgraphics:batik-ext:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-gvt" artifact="org.apache.xmlgraphics:batik-gvt:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-gvt" artifact="org.apache.xmlgraphics:batik-gvt:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-i18n" artifact="org.apache.xmlgraphics:batik-i18n:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-i18n" artifact="org.apache.xmlgraphics:batik-i18n:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-parser" artifact="org.apache.xmlgraphics:batik-parser:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-parser" artifact="org.apache.xmlgraphics:batik-parser:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-script" artifact="org.apache.xmlgraphics:batik-script:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-script" artifact="org.apache.xmlgraphics:batik-script:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-shared-resources" artifact="org.apache.xmlgraphics:batik-shared-resources:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-shared-resources" artifact="org.apache.xmlgraphics:batik-shared-resources:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-svg-dom" artifact="org.apache.xmlgraphics:batik-svg-dom:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-svg-dom" artifact="org.apache.xmlgraphics:batik-svg-dom:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-svggen" artifact="org.apache.xmlgraphics:batik-svggen:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-svggen" artifact="org.apache.xmlgraphics:batik-svggen:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-svgrasterizer" artifact="org.apache.xmlgraphics:batik-svgrasterizer:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-svgrasterizer" artifact="org.apache.xmlgraphics:batik-svgrasterizer:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-transcoder" artifact="org.apache.xmlgraphics:batik-transcoder:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-transcoder" artifact="org.apache.xmlgraphics:batik-transcoder:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-util" artifact="org.apache.xmlgraphics:batik-util:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-util" artifact="org.apache.xmlgraphics:batik-util:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="svg.batik-xml" artifact="org.apache.xmlgraphics:batik-xml:1.17" usage="ooxml-batik"/>
|
<dependency prefix="svg.batik-xml" artifact="org.apache.xmlgraphics:batik-xml:1.19" usage="ooxml-batik"/>
|
||||||
<dependency prefix="pdf.pdfbox" artifact="org.apache.pdfbox:pdfbox:2.0.29" usage="ooxml-provided"/>
|
<dependency prefix="pdf.pdfbox" artifact="org.apache.pdfbox:pdfbox:3.0.5" usage="ooxml-provided"/>
|
||||||
<dependency prefix="pdf.fontbox" artifact="org.apache.pdfbox:fontbox:2.0.29" usage="ooxml-provided"/>
|
<dependency prefix="pdf.pdfbox.io" artifact="org.apache.pdfbox:pdfbox-io:3.0.5" usage="ooxml-provided"/>
|
||||||
<dependency prefix="pdf.graphics2d" artifact="de.rototor.pdfbox:graphics2d:0.43" usage="ooxml-provided"/>
|
<dependency prefix="pdf.fontbox" artifact="org.apache.pdfbox:fontbox:3.0.5" usage="ooxml-provided"/>
|
||||||
|
<dependency prefix="pdf.graphics2d" artifact="de.rototor.pdfbox:graphics2d:3.0.3" usage="ooxml-provided"/>
|
||||||
|
|
||||||
<!-- jars in the ooxml-lib directory, see the fetch-ooxml-jars target-->
|
<!-- jars in the ooxml-lib directory, see the fetch-ooxml-jars target-->
|
||||||
<dependency prefix="ooxml.curvesapi" artifact="com.github.virtuald:curvesapi:1.08" usage="ooxml"/>
|
<dependency prefix="ooxml.curvesapi" artifact="com.github.virtuald:curvesapi:1.08" usage="ooxml"/>
|
||||||
<dependency prefix="ooxml.xmlbeans" artifact="org.apache.xmlbeans:xmlbeans:5.1.1" usage="ooxml"/>
|
<dependency prefix="ooxml.xmlbeans" artifact="org.apache.xmlbeans:xmlbeans:5.3.0" usage="ooxml"/>
|
||||||
<dependency prefix="ooxml.commons-compress" artifact="org.apache.commons:commons-compress:1.24.0" usage="ooxml"/>
|
<dependency prefix="ooxml.commons-compress" artifact="org.apache.commons:commons-compress:1.28.0" usage="ooxml"/>
|
||||||
|
<dependency prefix="ooxml.commons-lang3" artifact="org.apache.commons:commons-lang3:3.18.0" usage="ooxml"/>
|
||||||
|
|
||||||
<!-- jars in the ooxml-test-lib directory, see the fetch-ooxml-jars target-->
|
<!-- jars in the ooxml-test-lib directory, see the fetch-ooxml-jars target-->
|
||||||
<dependency prefix="ooxml.test.reflections" artifact="org.reflections:reflections:0.10.2" usage="ooxml-tests"/>
|
<dependency prefix="ooxml.test.reflections" artifact="org.reflections:reflections:0.10.2" usage="ooxml-tests"/>
|
||||||
<dependency prefix="ooxml.test.guava" artifact="com.google.guava:guava:32.1.1-jre" usage="ooxml-tests"/>
|
<dependency prefix="ooxml.test.guava" artifact="com.google.guava:guava:33.4.8-jre" usage="ooxml-tests"/>
|
||||||
|
<dependency prefix="ooxml.test.guava.failureaccess" artifact="com.google.guava:failureaccess:1.0.3" usage="ooxml-tests"/>
|
||||||
<dependency prefix="ooxml.test.javassist" artifact="org.javassist:javassist:3.27.0-GA" usage="ooxml-tests"/>
|
<dependency prefix="ooxml.test.javassist" artifact="org.javassist:javassist:3.27.0-GA" usage="ooxml-tests"/>
|
||||||
<dependency prefix="ooxml.test.slf4j-api" artifact="org.slf4j:slf4j-api:2.0.9" usage="ooxml-tests"/>
|
<dependency prefix="ooxml.test.slf4j-api" artifact="org.slf4j:slf4j-api:2.0.17" usage="ooxml-tests"/>
|
||||||
<dependency prefix="ooxml.test.opczip" artifact="com.github.rzymek:opczip:1.2.0" usage="ooxml-tests"/>
|
<dependency prefix="ooxml.test.opczip" artifact="com.github.rzymek:opczip:1.2.0" usage="ooxml-tests"/>
|
||||||
|
|
||||||
<!-- coverage libs -->
|
<!-- coverage libs -->
|
||||||
<dependency prefix="jacoco" artifact="org.jacoco:jacoco:0.8.10" usage="util" packaging="zip"/>
|
<dependency prefix="jacoco" artifact="org.jacoco:jacoco:0.8.13" usage="util" packaging="zip"/>
|
||||||
<dependency prefix="asm" artifact="org.ow2.asm:asm:9.5" usage="util"/>
|
<dependency prefix="asm" artifact="org.ow2.asm:asm:9.5" usage="util"/>
|
||||||
<dependency prefix="asm-commons" artifact="org.ow2.asm:asm-commons:9.5" usage="util"/>
|
<dependency prefix="asm-commons" artifact="org.ow2.asm:asm-commons:9.5" usage="util"/>
|
||||||
<dependency prefix="asm-tree" artifact="org.ow2.asm:asm-tree:9.5" usage="util"/>
|
<dependency prefix="asm-tree" artifact="org.ow2.asm:asm-tree:9.5" usage="util"/>
|
||||||
|
|
||||||
<!-- license and api checks -->
|
<!-- license and api checks -->
|
||||||
<dependency prefix="rat" artifact="org.apache.rat:apache-rat:0.15" usage="util"/>
|
<dependency prefix="rat" artifact="org.apache.rat:apache-rat:0.16.1" usage="util"/>
|
||||||
<dependency prefix="forbidden" artifact="de.thetaphi:forbiddenapis:3.5.1" usage="util"/>
|
<dependency prefix="forbidden" artifact="de.thetaphi:forbiddenapis:3.5.1" usage="util"/>
|
||||||
|
|
||||||
<!-- See https://www.ecma-international.org/publications/standards/Ecma-376.htm -->
|
<!-- See https://www.ecma-international.org/publications/standards/Ecma-376.htm -->
|
||||||
@ -381,7 +384,7 @@ under the License.
|
|||||||
<property name="rat.report" value="${rat.reportdir}/report.txt"/>
|
<property name="rat.report" value="${rat.reportdir}/report.txt"/>
|
||||||
|
|
||||||
<!-- build and distro settings -->
|
<!-- build and distro settings -->
|
||||||
<property name="jar.name" value="poi"/>
|
<property name="jar.name" value="apache-poi"/>
|
||||||
<property name="build.site" location="build/site"/>
|
<property name="build.site" location="build/site"/>
|
||||||
<property name="javadocs.report.dir" location="${build.site}/apidocs/dev"/>
|
<property name="javadocs.report.dir" location="${build.site}/apidocs/dev"/>
|
||||||
<property name="dist.dir" location="build/dist"/>
|
<property name="dist.dir" location="build/dist"/>
|
||||||
@ -395,27 +398,6 @@ under the License.
|
|||||||
<!-- jars required for maven helper targets -->
|
<!-- jars required for maven helper targets -->
|
||||||
<dependency prefix="maven.ant" artifact="org.apache.maven:maven-ant-tasks:2.1.3" usage="util"/>
|
<dependency prefix="maven.ant" artifact="org.apache.maven:maven-ant-tasks:2.1.3" usage="util"/>
|
||||||
|
|
||||||
<!-- subclipse.tigris.org is gone - left-over is hosted at https://bintray.com/openmeetings/maven/org.tigris.subclipse.svnant -->
|
|
||||||
<!-- request will be forwarded to d29vzk4ow07wi7.cloudfront.net which is an Atlassian Marketplace instance -->
|
|
||||||
<dependency prefix="dist.svnant" artifact="org.tigris.subclipse:svnant:1.3.1" usage="util"
|
|
||||||
repo="https://dl.bintray.com/openmeetings/maven"/>
|
|
||||||
|
|
||||||
<!-- hosted at https://bintray.com/subclipse/maven/svnclientadapter - https://github.com/subclipse/svnclientadapter -->
|
|
||||||
<dependency prefix="dist.svnclientadapter-base" artifact="org.tigris.svnclientadapter:adapter-base:1.12.0" usage="util"
|
|
||||||
repo="https://dl.bintray.com/subclipse/maven"/>
|
|
||||||
<dependency prefix="dist.svnclientadapter-svnkit" artifact="org.tigris.svnclientadapter:adapter-svnkit:1.12.0" usage="util"
|
|
||||||
repo="https://dl.bintray.com/subclipse/maven"/>
|
|
||||||
<dependency prefix="dist.svnclientadapter-javahl" artifact="org.tigris.svnclientadapter:adapter-javahl:1.12.0" usage="util"
|
|
||||||
repo="https://dl.bintray.com/subclipse/maven"/>
|
|
||||||
<dependency prefix="dist.svnkit" artifact="org.tmatesoft.svnkit:svnkit:1.10.1" usage="util"/>
|
|
||||||
<dependency prefix="dist.svnkit-javahl16" artifact="org.tmatesoft.svnkit:svnkit-javahl16:1.10.1" usage="util"/>
|
|
||||||
<dependency prefix="dist.sqljet" artifact="org.tmatesoft.sqljet:sqljet:1.1.13" usage="util"/>
|
|
||||||
<dependency prefix="dist.antlr" artifact="org.antlr:antlr-runtime:3.5.2" usage="util"/>
|
|
||||||
<dependency prefix="dist.sequence-library" artifact="de.regnis.q.sequence:sequence-library:1.0.4" usage="util"/>
|
|
||||||
<dependency prefix="dist.lz4-java" artifact="org.lz4:lz4-java:1.7.1" usage="util"/>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<propertyset id="junit.properties">
|
<propertyset id="junit.properties">
|
||||||
<propertyref name="POI.testdata.path"/>
|
<propertyref name="POI.testdata.path"/>
|
||||||
<propertyref name="java.awt.headless"/>
|
<propertyref name="java.awt.headless"/>
|
||||||
@ -478,9 +460,11 @@ under the License.
|
|||||||
<pathelement location="${ooxml.curvesapi.jar}"/>
|
<pathelement location="${ooxml.curvesapi.jar}"/>
|
||||||
<pathelement location="${ooxml.xmlbeans.jar}"/>
|
<pathelement location="${ooxml.xmlbeans.jar}"/>
|
||||||
<pathelement location="${ooxml.commons-compress.jar}"/>
|
<pathelement location="${ooxml.commons-compress.jar}"/>
|
||||||
|
<pathelement location="${ooxml.commons-lang3.jar}"/>
|
||||||
<path refid="main.classpath"/>
|
<path refid="main.classpath"/>
|
||||||
<pathelement location="${main.output.dir}"/>
|
<pathelement location="${main.output.dir}"/>
|
||||||
<pathelement location="${ooxml.test.guava.jar}"/>
|
<pathelement location="${ooxml.test.guava.jar}"/>
|
||||||
|
<pathelement location="${ooxml.test.guava.failureaccess.jar}"/>
|
||||||
<pathelement location="${ooxml.test.opczip.jar}"/>
|
<pathelement location="${ooxml.test.opczip.jar}"/>
|
||||||
<!-- classes are omitted on test cases outside the xml-dsign area to avoid classpath poisoning -->
|
<!-- classes are omitted on test cases outside the xml-dsign area to avoid classpath poisoning -->
|
||||||
<!--path refid="ooxml.xmlsec.classpath"/-->
|
<!--path refid="ooxml.xmlsec.classpath"/-->
|
||||||
@ -514,6 +498,7 @@ under the License.
|
|||||||
|
|
||||||
<path id="pdfbox.classpath">
|
<path id="pdfbox.classpath">
|
||||||
<pathelement location="${pdf.pdfbox.jar}"/>
|
<pathelement location="${pdf.pdfbox.jar}"/>
|
||||||
|
<pathelement location="${pdf.pdfbox.io.jar}"/>
|
||||||
<pathelement location="${pdf.fontbox.jar}"/>
|
<pathelement location="${pdf.fontbox.jar}"/>
|
||||||
<pathelement location="${pdf.graphics2d.jar}"/>
|
<pathelement location="${pdf.graphics2d.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
@ -533,6 +518,7 @@ under the License.
|
|||||||
<path id="test.ooxml.reflections.classpath">
|
<path id="test.ooxml.reflections.classpath">
|
||||||
<pathelement location="${ooxml.test.reflections.jar}"/>
|
<pathelement location="${ooxml.test.reflections.jar}"/>
|
||||||
<pathelement location="${ooxml.test.guava.jar}"/>
|
<pathelement location="${ooxml.test.guava.jar}"/>
|
||||||
|
<pathelement location="${ooxml.test.guava.failureaccess.jar}"/>
|
||||||
<pathelement location="${ooxml.test.javassist.jar}"/>
|
<pathelement location="${ooxml.test.javassist.jar}"/>
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
@ -684,11 +670,7 @@ under the License.
|
|||||||
<fileset dir="${basedir}/lib/main-tests">
|
<fileset dir="${basedir}/lib/main-tests">
|
||||||
<include name="byte-buddy-*1.12*.jar"/>
|
<include name="byte-buddy-*1.12*.jar"/>
|
||||||
<include name="mockito-core-3*.jar"/>
|
<include name="mockito-core-3*.jar"/>
|
||||||
<include name="mockito-core-4.0*.jar"/>
|
<include name="mockito-core-4*.jar"/>
|
||||||
<include name="mockito-core-4.2*.jar"/>
|
|
||||||
<include name="mockito-core-4.5*.jar"/>
|
|
||||||
<include name="mockito-core-4.6*.jar"/>
|
|
||||||
<include name="mockito-core-4.8*.jar"/>
|
|
||||||
<include name="hamcrest-core*"/>
|
<include name="hamcrest-core*"/>
|
||||||
<include name="junit-4*.jar"/>
|
<include name="junit-4*.jar"/>
|
||||||
<include name="*slf4j*.jar"/>
|
<include name="*slf4j*.jar"/>
|
||||||
@ -706,6 +688,7 @@ under the License.
|
|||||||
<include name="xmlbeans-4*.jar"/>
|
<include name="xmlbeans-4*.jar"/>
|
||||||
<include name="xmlbeans-5.0*.jar"/>
|
<include name="xmlbeans-5.0*.jar"/>
|
||||||
<include name="xmlbeans-5.1.0.jar"/>
|
<include name="xmlbeans-5.1.0.jar"/>
|
||||||
|
<include name="xmlbeans-5.2.2.jar"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${basedir}/lib/ooxml-provided">
|
<fileset dir="${basedir}/lib/ooxml-provided">
|
||||||
<include name="bc*-1.6*.jar"/>
|
<include name="bc*-1.6*.jar"/>
|
||||||
@ -714,6 +697,7 @@ under the License.
|
|||||||
<include name="batik*.jar"/>
|
<include name="batik*.jar"/>
|
||||||
<include name="slf4j*-1.*.jar"/>
|
<include name="slf4j*-1.*.jar"/>
|
||||||
<include name="xmlsec-2*.jar"/>
|
<include name="xmlsec-2*.jar"/>
|
||||||
|
<include name="xmlgraphics-commons-*.jar"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${basedir}/lib/ooxml-tests">
|
<fileset dir="${basedir}/lib/ooxml-tests">
|
||||||
<include name="guava-20.0.jar"/>
|
<include name="guava-20.0.jar"/>
|
||||||
@ -725,6 +709,8 @@ under the License.
|
|||||||
<include name="org.jacoco.*-0.8.5.*.jar"/>
|
<include name="org.jacoco.*-0.8.5.*.jar"/>
|
||||||
<include name="org.jacoco.*-0.8.6.*.jar"/>
|
<include name="org.jacoco.*-0.8.6.*.jar"/>
|
||||||
<include name="org.jacoco.*-0.8.8.*.jar"/>
|
<include name="org.jacoco.*-0.8.8.*.jar"/>
|
||||||
|
<include name="org.jacoco.*-0.8.10.*.jar"/>
|
||||||
|
<include name="org.jacoco.*-0.8.11.*.jar"/>
|
||||||
<include name="forbiddenapis-3.1.jar"/>
|
<include name="forbiddenapis-3.1.jar"/>
|
||||||
<include name="forbiddenapis-3.4.jar"/>
|
<include name="forbiddenapis-3.4.jar"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
@ -732,6 +718,8 @@ under the License.
|
|||||||
<include name="jacoco-0.8.5.zip"/>
|
<include name="jacoco-0.8.5.zip"/>
|
||||||
<include name="jacoco-0.8.6.zip"/>
|
<include name="jacoco-0.8.6.zip"/>
|
||||||
<include name="jacoco-0.8.8.zip"/>
|
<include name="jacoco-0.8.8.zip"/>
|
||||||
|
<include name="jacoco-0.8.10.zip"/>
|
||||||
|
<include name="jacoco-0.8.11.zip"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
<fileset dir="${basedir}/lib">
|
<fileset dir="${basedir}/lib">
|
||||||
<include name="jacoco-*.zip"/>
|
<include name="jacoco-*.zip"/>
|
||||||
@ -842,8 +830,10 @@ under the License.
|
|||||||
<available file="${ooxml.curvesapi.jar}"/>
|
<available file="${ooxml.curvesapi.jar}"/>
|
||||||
<available file="${ooxml.xmlbeans.jar}"/>
|
<available file="${ooxml.xmlbeans.jar}"/>
|
||||||
<available file="${ooxml.commons-compress.jar}"/>
|
<available file="${ooxml.commons-compress.jar}"/>
|
||||||
|
<available file="${ooxml.commons-lang3.jar}"/>
|
||||||
<available file="${ooxml.test.reflections.jar}"/>
|
<available file="${ooxml.test.reflections.jar}"/>
|
||||||
<available file="${ooxml.test.guava.jar}"/>
|
<available file="${ooxml.test.guava.jar}"/>
|
||||||
|
<available file="${ooxml.test.guava.failureaccess.jar}"/>
|
||||||
<available file="${ooxml.test.javassist.jar}"/>
|
<available file="${ooxml.test.javassist.jar}"/>
|
||||||
<available file="${ooxml.test.slf4j-api.jar}"/>
|
<available file="${ooxml.test.slf4j-api.jar}"/>
|
||||||
<available file="${ooxml.test.opczip.jar}"/>
|
<available file="${ooxml.test.opczip.jar}"/>
|
||||||
@ -870,6 +860,7 @@ under the License.
|
|||||||
<available file="${svg.batik-xml.jar}"/>
|
<available file="${svg.batik-xml.jar}"/>
|
||||||
<available file="${svg.xmlgraphics-commons.jar}"/>
|
<available file="${svg.xmlgraphics-commons.jar}"/>
|
||||||
<available file="${pdf.pdfbox.jar}"/>
|
<available file="${pdf.pdfbox.jar}"/>
|
||||||
|
<available file="${pdf.pdfbox.io.jar}"/>
|
||||||
<available file="${pdf.fontbox.jar}"/>
|
<available file="${pdf.fontbox.jar}"/>
|
||||||
<available file="${pdf.graphics2d.jar}"/>
|
<available file="${pdf.graphics2d.jar}"/>
|
||||||
</and>
|
</and>
|
||||||
@ -883,8 +874,10 @@ under the License.
|
|||||||
<downloadfile src="${ooxml.curvesapi.url}" dest="${ooxml.curvesapi.jar}"/>
|
<downloadfile src="${ooxml.curvesapi.url}" dest="${ooxml.curvesapi.jar}"/>
|
||||||
<downloadfile src="${ooxml.xmlbeans.url}" dest="${ooxml.xmlbeans.jar}"/>
|
<downloadfile src="${ooxml.xmlbeans.url}" dest="${ooxml.xmlbeans.jar}"/>
|
||||||
<downloadfile src="${ooxml.commons-compress.url}" dest="${ooxml.commons-compress.jar}"/>
|
<downloadfile src="${ooxml.commons-compress.url}" dest="${ooxml.commons-compress.jar}"/>
|
||||||
|
<downloadfile src="${ooxml.commons-lang3.url}" dest="${ooxml.commons-lang3.jar}"/>
|
||||||
<downloadfile src="${ooxml.test.reflections.url}" dest="${ooxml.test.reflections.jar}"/>
|
<downloadfile src="${ooxml.test.reflections.url}" dest="${ooxml.test.reflections.jar}"/>
|
||||||
<downloadfile src="${ooxml.test.guava.url}" dest="${ooxml.test.guava.jar}"/>
|
<downloadfile src="${ooxml.test.guava.url}" dest="${ooxml.test.guava.jar}"/>
|
||||||
|
<downloadfile src="${ooxml.test.guava.failureaccess.url}" dest="${ooxml.test.guava.failureaccess.jar}"/>
|
||||||
<downloadfile src="${ooxml.test.javassist.url}" dest="${ooxml.test.javassist.jar}"/>
|
<downloadfile src="${ooxml.test.javassist.url}" dest="${ooxml.test.javassist.jar}"/>
|
||||||
<downloadfile src="${ooxml.test.slf4j-api.url}" dest="${ooxml.test.slf4j-api.jar}"/>
|
<downloadfile src="${ooxml.test.slf4j-api.url}" dest="${ooxml.test.slf4j-api.jar}"/>
|
||||||
<downloadfile src="${ooxml.test.opczip.url}" dest="${ooxml.test.opczip.jar}"/>
|
<downloadfile src="${ooxml.test.opczip.url}" dest="${ooxml.test.opczip.jar}"/>
|
||||||
@ -911,42 +904,11 @@ under the License.
|
|||||||
<downloadfile src="${svg.xml-apis-ext.url}" dest="${svg.xml-apis-ext.jar}"/>
|
<downloadfile src="${svg.xml-apis-ext.url}" dest="${svg.xml-apis-ext.jar}"/>
|
||||||
<downloadfile src="${svg.xmlgraphics-commons.url}" dest="${svg.xmlgraphics-commons.jar}"/>
|
<downloadfile src="${svg.xmlgraphics-commons.url}" dest="${svg.xmlgraphics-commons.jar}"/>
|
||||||
<downloadfile src="${pdf.pdfbox.url}" dest="${pdf.pdfbox.jar}"/>
|
<downloadfile src="${pdf.pdfbox.url}" dest="${pdf.pdfbox.jar}"/>
|
||||||
|
<downloadfile src="${pdf.pdfbox.io.url}" dest="${pdf.pdfbox.io.jar}"/>
|
||||||
<downloadfile src="${pdf.fontbox.url}" dest="${pdf.fontbox.jar}"/>
|
<downloadfile src="${pdf.fontbox.url}" dest="${pdf.fontbox.jar}"/>
|
||||||
<downloadfile src="${pdf.graphics2d.url}" dest="${pdf.graphics2d.jar}"/>
|
<downloadfile src="${pdf.graphics2d.url}" dest="${pdf.graphics2d.jar}"/>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="check-svn-jars">
|
|
||||||
<condition property="svn.jars.present">
|
|
||||||
<or>
|
|
||||||
<and>
|
|
||||||
<available file="${dist.svnant.jar}"/>
|
|
||||||
<available file="${dist.svnclientadapter-base.jar}"/>
|
|
||||||
<available file="${dist.svnclientadapter-svnkit.jar}"/>
|
|
||||||
<available file="${dist.svnclientadapter-javahl.jar}"/>
|
|
||||||
<available file="${dist.svnkit.jar}"/>
|
|
||||||
<available file="${dist.svnkit-javahl16.jar}"/>
|
|
||||||
<available file="${dist.sqljet.jar}"/>
|
|
||||||
<available file="${dist.antlr.jar}"/>
|
|
||||||
<available file="${dist.sequence-library.jar}"/>
|
|
||||||
<available file="${dist.lz4-java.jar}"/>
|
|
||||||
</and>
|
|
||||||
<isset property="disconnected"/>
|
|
||||||
</or>
|
|
||||||
</condition>
|
|
||||||
</target>
|
|
||||||
<target name="fetch-svn-jars" depends="check-svn-jars" unless="svn.jars.present">
|
|
||||||
<!-- some jars are gone since bintray.dl is shutting down, so we started to include them in the sources for now -->
|
|
||||||
<copy todir="lib/util">
|
|
||||||
<fileset dir="lib.stored/" includes="*.jar"/>
|
|
||||||
</copy>
|
|
||||||
<downloadfile src="${dist.svnkit.url}" dest="${dist.svnkit.jar}"/>
|
|
||||||
<downloadfile src="${dist.svnkit-javahl16.url}" dest="${dist.svnkit-javahl16.jar}"/>
|
|
||||||
<downloadfile src="${dist.sqljet.url}" dest="${dist.sqljet.jar}"/>
|
|
||||||
<downloadfile src="${dist.antlr.url}" dest="${dist.antlr.jar}"/>
|
|
||||||
<downloadfile src="${dist.sequence-library.url}" dest="${dist.sequence-library.jar}"/>
|
|
||||||
<downloadfile src="${dist.lz4-java.url}" dest="${dist.lz4-java.jar}"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="check-compiled-ooxml-xsds">
|
<target name="check-compiled-ooxml-xsds">
|
||||||
<condition property="ooxml-compiled-xsds.present">
|
<condition property="ooxml-compiled-xsds.present">
|
||||||
<and>
|
<and>
|
||||||
@ -976,7 +938,7 @@ under the License.
|
|||||||
<zipfileset src="${ooxml.xsds.izip.1}"/>
|
<zipfileset src="${ooxml.xsds.izip.1}"/>
|
||||||
<fileset dir="${ooxml.visio.xsd.dir}"/>
|
<fileset dir="${ooxml.visio.xsd.dir}"/>
|
||||||
<fileset dir="${ooxml.schema.xsdconfig.dir}" includes="ooxmlSchemas.xsdconfig,markup-compatibility.xsd,vmlDrawing.xsd"/>
|
<fileset dir="${ooxml.schema.xsdconfig.dir}" includes="ooxmlSchemas.xsdconfig,markup-compatibility.xsd,vmlDrawing.xsd"/>
|
||||||
<fileset dir="${ooxml.schema.xsdconfig.dir}" includes="dml-drawing.xsd,word12.xsd,XAdES*.xsd,xlThreaded*.xsd,xmldsig*.xsd"/>
|
<fileset dir="${ooxml.schema.xsdconfig.dir}" includes="dml-drawing.xsd,word10.xsd,word12.xsd,XAdES*.xsd,xlThreaded*.xsd,xmldsig*.xsd"/>
|
||||||
<zipfileset src="${ooxml.xsds.izip.2}" includes="opc-digSig.xsd,opc-relationships.xsd"/>
|
<zipfileset src="${ooxml.xsds.izip.2}" includes="opc-digSig.xsd,opc-relationships.xsd"/>
|
||||||
<fileset dir="${ooxml.security.xsd.dir}" includes="signatureInfo.xsd"/>
|
<fileset dir="${ooxml.security.xsd.dir}" includes="signatureInfo.xsd"/>
|
||||||
</copy>
|
</copy>
|
||||||
@ -1021,7 +983,7 @@ under the License.
|
|||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
|
|
||||||
<javac release="9"
|
<javac release="11"
|
||||||
srcdir="${basedir}/poi-ooxml-full/src/main/java9"
|
srcdir="${basedir}/poi-ooxml-full/src/main/java9"
|
||||||
destdir="${basedir}/poi-ooxml-full/src/main/java9"
|
destdir="${basedir}/poi-ooxml-full/src/main/java9"
|
||||||
includeantruntime="false"
|
includeantruntime="false"
|
||||||
@ -1121,7 +1083,7 @@ under the License.
|
|||||||
<echo message="Building java9+ classes for @{module}"/>
|
<echo message="Building java9+ classes for @{module}"/>
|
||||||
|
|
||||||
<!-- compile jigsaw files to sources, so we don't forget to update/provide them for Java 8 builds -->
|
<!-- compile jigsaw files to sources, so we don't forget to update/provide them for Java 8 builds -->
|
||||||
<javac release="9"
|
<javac release="11"
|
||||||
srcdir="${basedir}/@{module}/src/main/java9"
|
srcdir="${basedir}/@{module}/src/main/java9"
|
||||||
destdir="${basedir}/@{module}/src/main/java9"
|
destdir="${basedir}/@{module}/src/main/java9"
|
||||||
includeantruntime="false"
|
includeantruntime="false"
|
||||||
@ -1160,7 +1122,7 @@ under the License.
|
|||||||
</jar>
|
</jar>
|
||||||
|
|
||||||
<!-- compile the tests -->
|
<!-- compile the tests -->
|
||||||
<javac release="8"
|
<javac release="11"
|
||||||
target="${jdk.version.class}"
|
target="${jdk.version.class}"
|
||||||
source="${jdk.version.source}"
|
source="${jdk.version.source}"
|
||||||
destdir="@{test-classes}"
|
destdir="@{test-classes}"
|
||||||
@ -1182,7 +1144,7 @@ under the License.
|
|||||||
<path location="@{test-classes}"/>
|
<path location="@{test-classes}"/>
|
||||||
</pathconvert>
|
</pathconvert>
|
||||||
|
|
||||||
<javac release="9"
|
<javac release="11"
|
||||||
srcdir="${basedir}/@{module}/src/test/java9"
|
srcdir="${basedir}/@{module}/src/test/java9"
|
||||||
destdir="${basedir}/@{module}/src/test/java9"
|
destdir="${basedir}/@{module}/src/test/java9"
|
||||||
includeantruntime="false"
|
includeantruntime="false"
|
||||||
@ -1310,7 +1272,7 @@ under the License.
|
|||||||
|
|
||||||
<!-- create ooxml-lite-agent jar -->
|
<!-- create ooxml-lite-agent jar -->
|
||||||
<mkdir dir="${ooxml.lite.output.dir}"/>
|
<mkdir dir="${ooxml.lite.output.dir}"/>
|
||||||
<javac release="8"
|
<javac release="11"
|
||||||
srcdir="${basedir}/poi-ooxml-lite-agent/src/main/java"
|
srcdir="${basedir}/poi-ooxml-lite-agent/src/main/java"
|
||||||
destdir="${ooxml.lite.output.dir}"
|
destdir="${ooxml.lite.output.dir}"
|
||||||
includeantruntime="false"
|
includeantruntime="false"
|
||||||
@ -1321,7 +1283,7 @@ under the License.
|
|||||||
</classpath>
|
</classpath>
|
||||||
</javac>
|
</javac>
|
||||||
|
|
||||||
<javac release="9"
|
<javac release="11"
|
||||||
srcdir="${basedir}/poi-ooxml-lite-agent/src/main/java9"
|
srcdir="${basedir}/poi-ooxml-lite-agent/src/main/java9"
|
||||||
destdir="${basedir}/poi-ooxml-lite-agent/src/main/java9"
|
destdir="${basedir}/poi-ooxml-lite-agent/src/main/java9"
|
||||||
includeantruntime="false"
|
includeantruntime="false"
|
||||||
@ -1529,7 +1491,7 @@ under the License.
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="compile-integration" depends="compile-scratchpad, compile-main, compile-ooxml, compile-examples">
|
<target name="compile-integration" depends="compile-scratchpad, compile-main, compile-ooxml, compile-examples">
|
||||||
<javac release="8"
|
<javac release="11"
|
||||||
target="${jdk.version.class}"
|
target="${jdk.version.class}"
|
||||||
source="${jdk.version.source}"
|
source="${jdk.version.source}"
|
||||||
destdir="${integration.output.test.dir}"
|
destdir="${integration.output.test.dir}"
|
||||||
@ -1556,7 +1518,7 @@ under the License.
|
|||||||
|
|
||||||
<mkdir dir="${integration.output.test.dir}/META-INF/versions/9"/>
|
<mkdir dir="${integration.output.test.dir}/META-INF/versions/9"/>
|
||||||
|
|
||||||
<javac release="9"
|
<javac release="11"
|
||||||
srcdir="${basedir}/poi-integration/src/test/java9"
|
srcdir="${basedir}/poi-integration/src/test/java9"
|
||||||
destdir="${integration.output.test.dir}/META-INF/versions/9"
|
destdir="${integration.output.test.dir}/META-INF/versions/9"
|
||||||
includeantruntime="false"
|
includeantruntime="false"
|
||||||
@ -1606,7 +1568,6 @@ under the License.
|
|||||||
<copy file="${main.version.template}" tofile="${main.version.java}" overwrite="true">
|
<copy file="${main.version.template}" tofile="${main.version.java}" overwrite="true">
|
||||||
<filterset>
|
<filterset>
|
||||||
<filter token="VERSION" value="${version.id}"/>
|
<filter token="VERSION" value="${version.id}"/>
|
||||||
<filter token="DSTAMP" value="${DSTAMP}"/>
|
|
||||||
</filterset>
|
</filterset>
|
||||||
</copy>
|
</copy>
|
||||||
|
|
||||||
@ -1931,7 +1892,7 @@ under the License.
|
|||||||
|
|
||||||
<echo output="${basedir}/poi-ooxml-lite/src/main/java9/module-info.java">${full.schema}${lite.exports}}</echo>
|
<echo output="${basedir}/poi-ooxml-lite/src/main/java9/module-info.java">${full.schema}${lite.exports}}</echo>
|
||||||
|
|
||||||
<javac release="9"
|
<javac release="11"
|
||||||
srcdir="${basedir}/poi-ooxml-lite/src/main/java9"
|
srcdir="${basedir}/poi-ooxml-lite/src/main/java9"
|
||||||
destdir="${basedir}/poi-ooxml-lite/src/main/java9"
|
destdir="${basedir}/poi-ooxml-lite/src/main/java9"
|
||||||
includeantruntime="false"
|
includeantruntime="false"
|
||||||
@ -2081,6 +2042,13 @@ under the License.
|
|||||||
unless="main.docs.notRequired" description="Builds the HTML pages of the POI website">
|
unless="main.docs.notRequired" description="Builds the HTML pages of the POI website">
|
||||||
<echo message="Using Apache Forrest from ${env.FORREST_HOME}"/>
|
<echo message="Using Apache Forrest from ${env.FORREST_HOME}"/>
|
||||||
|
|
||||||
|
<echo message="Adjusting http -> https in forrset itself"/>
|
||||||
|
<replace dir="${env.FORREST_HOME}"
|
||||||
|
token="'http://'"
|
||||||
|
value="'https://'"
|
||||||
|
summary="true"
|
||||||
|
includes="**/*.xsl"/>
|
||||||
|
|
||||||
<exec executable="${env.FORREST_HOME}/bin/forrest" osfamily="unix"/>
|
<exec executable="${env.FORREST_HOME}/bin/forrest" osfamily="unix"/>
|
||||||
<exec executable="cmd" osfamily="windows">
|
<exec executable="cmd" osfamily="windows">
|
||||||
<arg value="/c"/>
|
<arg value="/c"/>
|
||||||
@ -2129,6 +2097,7 @@ under the License.
|
|||||||
|
|
||||||
<!-- Generates the latest/development API documentation. -->
|
<!-- Generates the latest/development API documentation. -->
|
||||||
<target name="javadocs"
|
<target name="javadocs"
|
||||||
|
depends="compile-ooxml"
|
||||||
description="Generates the API documentation">
|
description="Generates the API documentation">
|
||||||
<echo message="Generating latest Javadocs in ${javadocs.report.dir}"/>
|
<echo message="Generating latest Javadocs in ${javadocs.report.dir}"/>
|
||||||
<javadoc verbose="false" author="true" destdir="${javadocs.report.dir}"
|
<javadoc verbose="false" author="true" destdir="${javadocs.report.dir}"
|
||||||
@ -2277,7 +2246,7 @@ under the License.
|
|||||||
|
|
||||||
<echo message="Building maven-jar for @{module}, module-name: ${module-name} with isJava8: ${isJava8} and src: @{src}"/>
|
<echo message="Building maven-jar for @{module}, module-name: ${module-name} with isJava8: ${isJava8} and src: @{src}"/>
|
||||||
|
|
||||||
<javac release="9"
|
<javac release="11"
|
||||||
srcdir="${basedir}/@{module}/src/main/java9"
|
srcdir="${basedir}/@{module}/src/main/java9"
|
||||||
destdir="@{src}/META-INF/versions/9"
|
destdir="@{src}/META-INF/versions/9"
|
||||||
includeantruntime="false"
|
includeantruntime="false"
|
||||||
@ -2452,7 +2421,7 @@ under the License.
|
|||||||
|
|
||||||
<!-- continuous integration targets -->
|
<!-- continuous integration targets -->
|
||||||
<target name="jenkins"
|
<target name="jenkins"
|
||||||
depends="replaceVersion, compile, test-all, jar, javadocs, assemble, findbugs, release-notes, rat-check, forbidden-apis-check, help, fetch-svn-jars, maventask"
|
depends="replaceVersion, compile, test-all, jar, javadocs, assemble, findbugs, release-notes, rat-check, forbidden-apis-check, help, maventask"
|
||||||
description="Target run by Jenkins on a continuous basis. Builds and tests POI, generates artifacts and documentation, and searches for problems."/>
|
description="Target run by Jenkins on a continuous basis. Builds and tests POI, generates artifacts and documentation, and searches for problems."/>
|
||||||
|
|
||||||
<target name="maventask" depends="init">
|
<target name="maventask" depends="init">
|
||||||
@ -2474,7 +2443,11 @@ under the License.
|
|||||||
uri="antlib:org.apache.rat.anttasks"
|
uri="antlib:org.apache.rat.anttasks"
|
||||||
classpath="${rat.jar}" />
|
classpath="${rat.jar}" />
|
||||||
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks" reportFile="${rat.report}">
|
<rat:report xmlns:rat="antlib:org.apache.rat.anttasks" reportFile="${rat.report}">
|
||||||
<fileset dir="poi-examples/src" excludes="main/java/org/apache/poi/**/*-chart-data.txt"/>
|
<fileset dir="poi-examples/src">
|
||||||
|
<exclude name="main/java/org/apache/poi/**/*-chart-data.txt" />
|
||||||
|
<exclude name="main/groovy/settings.gradle" />
|
||||||
|
<exclude name="main/groovy/.gradle/**" />
|
||||||
|
</fileset>
|
||||||
<fileset dir="poi-excelant/src"/>
|
<fileset dir="poi-excelant/src"/>
|
||||||
<fileset dir="poi-integration/src"/>
|
<fileset dir="poi-integration/src"/>
|
||||||
<fileset dir="poi/src">
|
<fileset dir="poi/src">
|
||||||
@ -2600,30 +2573,31 @@ under the License.
|
|||||||
|
|
||||||
<!-- findbugs successor, spotbugs ... need to use the dependencies used in the spotbugs release. -->
|
<!-- findbugs successor, spotbugs ... need to use the dependencies used in the spotbugs release. -->
|
||||||
<!-- compare with the entries found in the MANIFEST.MF of spotbugs.jar -->
|
<!-- compare with the entries found in the MANIFEST.MF of spotbugs.jar -->
|
||||||
<dependency prefix="spotbugs" artifact="com.github.spotbugs:spotbugs:4.7.3" usage="${spotbugs.lib}" target="spotbugs.jar"/>
|
<dependency prefix="spotbugs" artifact="com.github.spotbugs:spotbugs:4.9.8" usage="${spotbugs.lib}" target="spotbugs.jar"/>
|
||||||
<dependency prefix="spotbugs-ant" artifact="com.github.spotbugs:spotbugs-ant:4.7.3" usage="${spotbugs.lib}" target="spotbugs-ant.jar"/>
|
<dependency prefix="spotbugs-ant" artifact="com.github.spotbugs:spotbugs-ant:4.9.8" usage="${spotbugs.lib}" target="spotbugs-ant.jar"/>
|
||||||
<dependency prefix="spotbugs-anno" artifact="com.github.spotbugs:spotbugs-annotations:4.7.3" usage="${spotbugs.lib}" target="spotbugs-annotations.jar"/>
|
<dependency prefix="spotbugs-anno" artifact="com.github.spotbugs:spotbugs-annotations:4.9.8" usage="${spotbugs.lib}" target="spotbugs-annotations.jar"/>
|
||||||
<dependency prefix="spotbugs.asm" artifact="org.ow2.asm:asm:9.5" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.asm" artifact="org.ow2.asm:asm:9.9" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.asm-analysis" artifact="org.ow2.asm:asm-analysis:9.5" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.asm-analysis" artifact="org.ow2.asm:asm-analysis:9.9" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.asm-commons" artifact="org.ow2.asm:asm-commons:9.5" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.asm-commons" artifact="org.ow2.asm:asm-commons:9.9" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.asm-tree" artifact="org.ow2.asm:asm-tree:9.5" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.asm-tree" artifact="org.ow2.asm:asm-tree:9.9" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.asm-util" artifact="org.ow2.asm:asm-util:9.5" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.asm-util" artifact="org.ow2.asm:asm-util:9.9" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.jsr305" artifact="com.google.code.findbugs:jsr305:3.0.2" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.jsr305" artifact="com.google.code.findbugs:jsr305:3.0.2" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.dom4j" artifact="org.dom4j:dom4j:2.1.3" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.dom4j" artifact="org.dom4j:dom4j:2.2.0" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.jaxen" artifact="jaxen:jaxen:1.2.0" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.jaxen" artifact="jaxen:jaxen:2.0.0" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.bcel" artifact="org.apache.bcel:bcel:6.5.0" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.bcel" artifact="org.apache.bcel:bcel:6.11.0" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.slf4j-api" artifact="org.slf4j:slf4j-api:2.0.0" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.slf4j-api" artifact="org.slf4j:slf4j-api:2.0.17" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.commons-lang3" artifact="org.apache.commons:commons-lang3:3.12.0" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.commons-lang" artifact="org.apache.commons:commons-lang3:3.19.0" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.commons-text" artifact="org.apache.commons:commons-text:1.10.0" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.commons-text" artifact="org.apache.commons:commons-text:1.14.0" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.commons-codec" artifact="commons-codec:commons-codec:1.11" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.commons-codec" artifact="commons-codec:commons-codec:1.15" usage="${spotbugs.lib}"/>
|
||||||
|
<dependency prefix="spotbugs.commons-io" artifact="commons-io:commons-io:2.20.0" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.commons-logging" artifact="commons-logging:commons-logging:1.2" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.commons-logging" artifact="commons-logging:commons-logging:1.2" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.jcip-annotations" artifact="net.jcip:jcip-annotations:1.0" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.jcip-annotations" artifact="net.jcip:jcip-annotations:1.0" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.icu4j" artifact="com.ibm.icu:icu4j:68.2" usage="${spotbugs.lib}" target="icu4j-68.2.jar"/>
|
<dependency prefix="spotbugs.icu4j" artifact="com.ibm.icu:icu4j:68.2" usage="${spotbugs.lib}" target="icu4j-68.2.jar"/>
|
||||||
<dependency prefix="spotbugs.log4j-api" artifact="org.apache.logging.log4j:log4j-api:2.17.2" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.log4j-api" artifact="org.apache.logging.log4j:log4j-api:2.25.2" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.log4j-core" artifact="org.apache.logging.log4j:log4j-core:2.17.2" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.log4j-core" artifact="org.apache.logging.log4j:log4j-core:2.25.2" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.log4j-slf4j18-impl" artifact="org.apache.logging.log4j:log4j-slf4j18-impl:2.17.2" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.log4j-slf4j18-impl" artifact="org.apache.logging.log4j:log4j-slf4j2-impl:2.25.2" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.saxon" artifact="net.sf.saxon:Saxon-HE:11.5" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.saxon" artifact="net.sf.saxon:Saxon-HE:12.9" usage="${spotbugs.lib}"/>
|
||||||
<dependency prefix="spotbugs.xmlresolver" artifact="org.xmlresolver:xmlresolver:4.2.0" usage="${spotbugs.lib}"/>
|
<dependency prefix="spotbugs.xmlresolver" artifact="org.xmlresolver:xmlresolver:5.2.2" usage="${spotbugs.lib}"/>
|
||||||
|
|
||||||
<mkdir dir="${basedir}${spotbugs.lib}/config"/>
|
<mkdir dir="${basedir}${spotbugs.lib}/config"/>
|
||||||
|
|
||||||
@ -2634,9 +2608,10 @@ under the License.
|
|||||||
<downloadfile src="${spotbugs.jaxen.url}" dest="${spotbugs.jaxen.jar}"/>
|
<downloadfile src="${spotbugs.jaxen.url}" dest="${spotbugs.jaxen.jar}"/>
|
||||||
<downloadfile src="${spotbugs.bcel.url}" dest="${spotbugs.bcel.jar}"/>
|
<downloadfile src="${spotbugs.bcel.url}" dest="${spotbugs.bcel.jar}"/>
|
||||||
<downloadfile src="${spotbugs.slf4j-api.url}" dest="${spotbugs.slf4j-api.jar}"/>
|
<downloadfile src="${spotbugs.slf4j-api.url}" dest="${spotbugs.slf4j-api.jar}"/>
|
||||||
<downloadfile src="${spotbugs.commons-lang3.url}" dest="${spotbugs.commons-lang3.jar}"/>
|
<downloadfile src="${spotbugs.commons-lang.url}" dest="${spotbugs.commons-lang.jar}"/>
|
||||||
<downloadfile src="${spotbugs.commons-text.url}" dest="${spotbugs.commons-text.jar}"/>
|
<downloadfile src="${spotbugs.commons-text.url}" dest="${spotbugs.commons-text.jar}"/>
|
||||||
<downloadfile src="${spotbugs.commons-codec.url}" dest="${spotbugs.commons-codec.jar}"/>
|
<downloadfile src="${spotbugs.commons-codec.url}" dest="${spotbugs.commons-codec.jar}"/>
|
||||||
|
<downloadfile src="${spotbugs.commons-io.url}" dest="${spotbugs.commons-io.jar}"/>
|
||||||
<downloadfile src="${spotbugs.commons-logging.url}" dest="${spotbugs.commons-logging.jar}"/>
|
<downloadfile src="${spotbugs.commons-logging.url}" dest="${spotbugs.commons-logging.jar}"/>
|
||||||
<downloadfile src="${spotbugs.jcip-annotations.url}" dest="${spotbugs.jcip-annotations.jar}"/>
|
<downloadfile src="${spotbugs.jcip-annotations.url}" dest="${spotbugs.jcip-annotations.jar}"/>
|
||||||
<downloadfile src="${spotbugs.jsr305.url}" dest="${spotbugs.jsr305.jar}"/>
|
<downloadfile src="${spotbugs.jsr305.url}" dest="${spotbugs.jsr305.jar}"/>
|
||||||
@ -2693,6 +2668,7 @@ under the License.
|
|||||||
<auxClasspath path="${ooxml.curvesapi.jar}" />
|
<auxClasspath path="${ooxml.curvesapi.jar}" />
|
||||||
<auxClasspath path="${ooxml.xmlbeans.jar}" />
|
<auxClasspath path="${ooxml.xmlbeans.jar}" />
|
||||||
<auxClasspath path="${ooxml.commons-compress.jar}" />
|
<auxClasspath path="${ooxml.commons-compress.jar}" />
|
||||||
|
<auxClasspath path="${ooxml.commons-lang3.jar}" />
|
||||||
<auxClasspath path="${main.commons-collections4.jar}" />
|
<auxClasspath path="${main.commons-collections4.jar}" />
|
||||||
<auxClasspath path="${main.commons-math3.jar}" />
|
<auxClasspath path="${main.commons-math3.jar}" />
|
||||||
<auxClasspath path="${main.commons-io.jar}" />
|
<auxClasspath path="${main.commons-io.jar}" />
|
||||||
@ -2734,6 +2710,7 @@ under the License.
|
|||||||
<auxClasspath path="${svg.xml-apis-ext.jar}"/>
|
<auxClasspath path="${svg.xml-apis-ext.jar}"/>
|
||||||
<auxClasspath path="${svg.xmlgraphics-commons.jar}"/>
|
<auxClasspath path="${svg.xmlgraphics-commons.jar}"/>
|
||||||
<auxClasspath path="${pdf.pdfbox.jar}"/>
|
<auxClasspath path="${pdf.pdfbox.jar}"/>
|
||||||
|
<auxClasspath path="${pdf.pdfbox.io.jar}"/>
|
||||||
<auxClasspath path="${pdf.fontbox.jar}"/>
|
<auxClasspath path="${pdf.fontbox.jar}"/>
|
||||||
<auxClasspath path="${pdf.graphics2d.jar}"/>
|
<auxClasspath path="${pdf.graphics2d.jar}"/>
|
||||||
<sourcePath path="poi/src/main/java" />
|
<sourcePath path="poi/src/main/java" />
|
||||||
@ -2822,286 +2799,6 @@ under the License.
|
|||||||
</openpgp:signer>
|
</openpgp:signer>
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="dist-nexus" depends="load-maven-server-settings,dist-checksum"
|
|
||||||
description="upload build artifacts to nexus">
|
|
||||||
<delete dir="build/repo"/>
|
|
||||||
<delete dir="build/nexus-stage"/>
|
|
||||||
<nexus-upload artifactId="poi"/>
|
|
||||||
<nexus-upload artifactId="poi-examples"/>
|
|
||||||
<nexus-upload artifactId="poi-excelant"/>
|
|
||||||
<nexus-upload artifactId="poi-ooxml"/>
|
|
||||||
<nexus-upload artifactId="poi-ooxml-lite"/>
|
|
||||||
<nexus-upload artifactId="poi-ooxml-full"/>
|
|
||||||
<nexus-upload artifactId="poi-scratchpad"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<macrodef name="nexus-upload">
|
|
||||||
<attribute name="artifactId"/>
|
|
||||||
<sequential>
|
|
||||||
<local name="repo"/>
|
|
||||||
<property name="repo" location="build/repo/@{artifactId}"/>
|
|
||||||
|
|
||||||
<copy todir="${repo}">
|
|
||||||
<mappedresources>
|
|
||||||
<!-- add sha-512 when nexus rules are updated (1/2) -->
|
|
||||||
<fileset dir="build/dist/maven" includes="@{artifactId}/**" excludes="**/*.sha512,**/*.sha256"/>
|
|
||||||
<regexpmapper from="^([^/]+)/(.*)$$" to="org/apache/poi/\1/${version.id}/\2" handledirsep="true"/>
|
|
||||||
</mappedresources>
|
|
||||||
</copy>
|
|
||||||
|
|
||||||
<local name="lastUpdated"/>
|
|
||||||
<tstamp>
|
|
||||||
<format property="lastUpdated" pattern="yyyyMMddHHmmss" timezone="UTC"/>
|
|
||||||
</tstamp>
|
|
||||||
|
|
||||||
<local name="metadir"/>
|
|
||||||
<property name="metadir" location="${repo}/org/apache/poi/@{artifactId}"/>
|
|
||||||
|
|
||||||
<echo file="${metadir}/maven-metadata.xml"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<metadata>
|
|
||||||
<groupId>org.apache.poi</groupId>
|
|
||||||
<artifactId>@{artifactId}</artifactId>
|
|
||||||
<versioning>
|
|
||||||
<latest>${version.id}</latest>
|
|
||||||
<release>${version.id}</release>
|
|
||||||
<versions>
|
|
||||||
<version>${version.id}</version>
|
|
||||||
</versions>
|
|
||||||
<lastUpdated>${lastUpdated}</lastUpdated>
|
|
||||||
</versioning>
|
|
||||||
</metadata>]]></echo>
|
|
||||||
<fixcrlf srcdir="${metadir}" includes="maven-metadata.xml" eol="unix" eof="remove" />
|
|
||||||
<!-- add sha-512 when nexus rules are updated (2/2) -->
|
|
||||||
<!--checksum algorithm="SHA-512" fileext=".sha512" format="MD5SUM">
|
|
||||||
<fileset dir="${metadir}" includes="maven-metadata.xml"/>
|
|
||||||
</checksum-->
|
|
||||||
<checksum algorithm="sha1" format="MD5SUM">
|
|
||||||
<fileset dir="${metadir}" includes="maven-metadata.xml"/>
|
|
||||||
</checksum>
|
|
||||||
<checksum algorithm="md5" format="MD5SUM">
|
|
||||||
<fileset dir="${metadir}" includes="maven-metadata.xml"/>
|
|
||||||
</checksum>
|
|
||||||
|
|
||||||
<fixcrlf srcDir="${metadir}" includes="*.md5,*.sha1,*.sha256,*.sha512" eol="unix"/>
|
|
||||||
|
|
||||||
<downloadfile src="${dist.nexus-staging.url}" dest="${dist.nexus-staging.jar}"/>
|
|
||||||
<taskdef uri="antlib:org.sonatype.nexus.ant.staging" resource="org/sonatype/nexus/ant/staging/antlib.xml">
|
|
||||||
<classpath><pathelement path="${dist.nexus-staging.jar}"/></classpath>
|
|
||||||
</taskdef>
|
|
||||||
|
|
||||||
<staging:stageLocally description="@{artifactId} ${version.id}">
|
|
||||||
<staging:nexusStagingInfo stagingDirectory="build/nexus-stage/@{artifactId}"/>
|
|
||||||
<fileset dir="${repo}" />
|
|
||||||
</staging:stageLocally>
|
|
||||||
|
|
||||||
<!-- if this throws a "... dh keypair ..." exception, use Java 7+ for executing the task -->
|
|
||||||
<staging:stageRemotely description="@{artifactId} ${version.id}">
|
|
||||||
<staging:nexusStagingInfo stagingDirectory="build/nexus-stage/@{artifactId}">
|
|
||||||
<staging:projectInfo groupId="org.apache.poi" artifactId="@{artifactId}" version="${version.id}" />
|
|
||||||
<staging:connectionInfo baseUrl="https://repository.apache.org/">
|
|
||||||
<staging:authentication username="${settings.apache-id.username}" password="${settings.apache-id.password}" />
|
|
||||||
</staging:connectionInfo>
|
|
||||||
</staging:nexusStagingInfo>
|
|
||||||
</staging:stageRemotely>
|
|
||||||
</sequential>
|
|
||||||
</macrodef>
|
|
||||||
|
|
||||||
<target name="-init-svn" depends="init,fetch-svn-jars,load-maven-server-settings">
|
|
||||||
<!-- JAVA_HOME needs to point to a JRE/JDK7+, otherwise the svn/https connection throws a "Could not generate DH keypair"-->
|
|
||||||
<fail message="Environment needs to point to Java 8+">
|
|
||||||
<condition>
|
|
||||||
<or>
|
|
||||||
<equals arg1="${ant.java.version}" arg2="1.7"/>
|
|
||||||
<equals arg1="${ant.java.version}" arg2="1.6"/>
|
|
||||||
<equals arg1="${ant.java.version}" arg2="1.5"/>
|
|
||||||
</or>
|
|
||||||
</condition>
|
|
||||||
</fail>
|
|
||||||
|
|
||||||
<path id="path.svnant">
|
|
||||||
<pathelement location="${dist.svnant.jar}"/>
|
|
||||||
<pathelement location="${dist.svnclientadapter-base.jar}"/>
|
|
||||||
<pathelement location="${dist.svnclientadapter-svnkit.jar}"/>
|
|
||||||
<pathelement location="${dist.svnclientadapter-javahl.jar}"/>
|
|
||||||
<pathelement location="${dist.svnkit.jar}"/>
|
|
||||||
<pathelement location="${dist.svnkit-javahl16.jar}"/>
|
|
||||||
<pathelement location="${dist.sqljet.jar}"/>
|
|
||||||
<pathelement location="${dist.antlr.jar}"/>
|
|
||||||
<pathelement location="${dist.sequence-library.jar}"/>
|
|
||||||
<pathelement location="${dist.lz4-java.jar}"/>
|
|
||||||
</path>
|
|
||||||
<taskdef resource="org/tigris/subversion/svnant/svnantlib.xml" classpathref="path.svnant"/>
|
|
||||||
|
|
||||||
<svnSetting
|
|
||||||
svnkit="true"
|
|
||||||
javahl="false"
|
|
||||||
username="${settings.apache-id.username}"
|
|
||||||
password="${settings.apache-id.password}"
|
|
||||||
id="svn.settings"
|
|
||||||
/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="release-prep0" depends="-init-svn" description="check to make sure the release tag doesn't exist yet">
|
|
||||||
<!-- verify that svn username/password are valid ... -->
|
|
||||||
<fail message="Unable to connect to SVN repo. Verify apache-id username and password. If these are correct, change the release-prep0 target to check over http, which would indicate a problem with your https setup.">
|
|
||||||
<condition>
|
|
||||||
<not><svnExists refid="svn.settings" target="https://svn.apache.org/repos/asf/poi/"/></not>
|
|
||||||
</condition>
|
|
||||||
</fail>
|
|
||||||
|
|
||||||
<!-- verify that the release tag that we're about to create in release-prep1 does not already exist (no overwriting tags!) -->
|
|
||||||
<fail message="Cannot create release tag. https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG} already exists. Verify the requested release version (${version.id}).">
|
|
||||||
<condition>
|
|
||||||
<svnExists refid="svn.settings" target="https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG}/"/>
|
|
||||||
</condition>
|
|
||||||
</fail>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<!-- experimental release preparation ... tbd. ... -->
|
|
||||||
<target name="release-prep1" depends="-init-svn,release-prep0" description="update the documentation and create the svn tag - needs Java7+">
|
|
||||||
<local name="tstamp_rel"/>
|
|
||||||
<local name="tstamp_next"/>
|
|
||||||
<local name="rel_next"/>
|
|
||||||
<tstamp>
|
|
||||||
<format property="tstamp_rel" pattern="yyyy-MM-dd" offset="7" unit="day"/>
|
|
||||||
<format property="tstamp_next" pattern="yyyy-MM" offset="3" unit="month"/>
|
|
||||||
</tstamp>
|
|
||||||
|
|
||||||
<taskdef name="NextRelease" classname="NextRelease" classpath="poi-excelant/build/poi-ant-contrib"/>
|
|
||||||
<NextRelease property="rel_next"/>
|
|
||||||
|
|
||||||
<antcall target="-update-build.xml">
|
|
||||||
<param name="version_id" value="${version.id}"/>
|
|
||||||
</antcall>
|
|
||||||
|
|
||||||
<replaceregexp byline="true">
|
|
||||||
<regexp pattern="<release.*date=".*\?\?">"/>
|
|
||||||
<substitution expression="<!-- release version="${rel_next}" date="${tstamp_next}-??"> </release --> <release version="${version.id}" date="${tstamp_rel}">"/>
|
|
||||||
<fileset dir="src/documentation/content/xdocs">
|
|
||||||
<include name="changes.xml"/>
|
|
||||||
</fileset>
|
|
||||||
</replaceregexp>
|
|
||||||
|
|
||||||
<fixcrlf srcdir="." includes="src/documentation/content/xdocs/changes.xml" eol="unix" eof="remove" />
|
|
||||||
|
|
||||||
<!-- can't combine updating and pinning of the documentation ... so we need two commits -->
|
|
||||||
<!-- (revision)properties can't be set and read within one svn block -->
|
|
||||||
<echo message="updating build.xml and changes.xml"/>
|
|
||||||
<exec command="svn ci --username ${settings.apache-id.username} --password ${settings.apache-id.password} -m 'release prepare for ${version.id} - updating build.xml and changes.xml' build.xml src/documentation/content/xdocs/changes.xml"/>
|
|
||||||
<svn refid="svn.settings">
|
|
||||||
<!--<commit message="release prepare for ${version.id} - updating build.xml and changes.xml" recurse="false">
|
|
||||||
<fileset dir="." includes="build.xml,src/documentation/content/xdocs/changes.xml"/>
|
|
||||||
</commit>-->
|
|
||||||
<update dir="." recurse="true"/>
|
|
||||||
<status path="." revisionProperty="svn_version1"/>
|
|
||||||
</svn>
|
|
||||||
<echo message="pin documentation - release ${svn_version1}"/>
|
|
||||||
<exec command="svn ci --username ${settings.apache-id.username} --password ${settings.apache-id.password} -m 'release prepare for ${version.id} - pin documentation' src"/>
|
|
||||||
<svn refid="svn.settings">
|
|
||||||
<propset path="src" name="svn:externals" value="documentation -r${svn_version1} https://svn.apache.org/repos/asf/poi/site/src/documentation"/>
|
|
||||||
<!-- <commit message="release prepare for ${version.id} - pin documentation" dir="src" recurse="false"/>-->
|
|
||||||
<update dir="." recurse="true"/>
|
|
||||||
<status path="." revisionProperty="svn_version2"/>
|
|
||||||
</svn>
|
|
||||||
<echo message="create release tag"/>
|
|
||||||
<svn refid="svn.settings">
|
|
||||||
<copy
|
|
||||||
srcUrl="https://svn.apache.org/repos/asf/poi/trunk"
|
|
||||||
destUrl="https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG}"
|
|
||||||
message="tag r${svn_version2} as ${version.id}"/>
|
|
||||||
</svn>
|
|
||||||
|
|
||||||
<!-- update build.xml to the next snapshot version -->
|
|
||||||
<antcall target="-update-build.xml">
|
|
||||||
<param name="version_id" value="${rel_next}"/>
|
|
||||||
</antcall>
|
|
||||||
|
|
||||||
<!-- unpin documentation and commit next snapshot version -->
|
|
||||||
<svn refid="svn.settings">
|
|
||||||
<update dir="." recurse="true"/>
|
|
||||||
<propset path="src" name="svn:externals" value="documentation https://svn.apache.org/repos/asf/poi/site/src/documentation"/>
|
|
||||||
<!--<commit message="prepare for ${rel_next}" recurse="false">
|
|
||||||
<fileset dir="." includes="build.xml"/>
|
|
||||||
<dirset dir="src"/>
|
|
||||||
</commit>-->
|
|
||||||
</svn>
|
|
||||||
<exec command="svn ci --username ${settings.apache-id.username} --password ${settings.apache-id.password} -m 'prepare for ${rel_next}' build.xml src poi*"/>
|
|
||||||
|
|
||||||
<mkdir dir="build/release"/>
|
|
||||||
|
|
||||||
<svn refid="svn.settings">
|
|
||||||
<checkout url="https://svn.apache.org/repos/asf/poi/tags/${RELEASE_TAG}" destPath="build/release" ignoreExternals="false"/>
|
|
||||||
</svn>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="release-prep2" depends="init" description="compile the freshly checked out svn tag and upload it to the nexus - needs a JDK6">
|
|
||||||
<!-- JAVA_HOME needs to point to a JDK8, otherwise the ant invocation is failing on a missing javac -->
|
|
||||||
<fail message="Environment needs to point to a Java 8 JDK">
|
|
||||||
<condition>
|
|
||||||
<not><equals arg1="${ant.java.version}" arg2="1.8"/></not>
|
|
||||||
</condition>
|
|
||||||
</fail>
|
|
||||||
|
|
||||||
<local name="DSTAMP"/>
|
|
||||||
<tstamp>
|
|
||||||
<format property="DSTAMP" pattern="yyyyMMdd" offset="7" unit="day"/>
|
|
||||||
</tstamp>
|
|
||||||
|
|
||||||
<ant dir="build/release" inheritAll="false" inheritRefs="false" useNativeBasedir="true">
|
|
||||||
<property name="DSTAMP" value="${DSTAMP}"/>
|
|
||||||
<target name="dist" />
|
|
||||||
</ant>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="release-prep3" depends="-init-svn" description="write the dist to the release candidate repo - needs Java7+">
|
|
||||||
<ant dir="build/release" inheritAll="false" inheritRefs="false" useNativeBasedir="true">
|
|
||||||
<target name="dist-nexus" />
|
|
||||||
</ant>
|
|
||||||
|
|
||||||
<svn refid="svn.settings">
|
|
||||||
<import path="build/release/build/dist"
|
|
||||||
url="https://dist.apache.org/repos/dist/dev/poi"
|
|
||||||
newEntry="${version.id}-${release.rc}"
|
|
||||||
message="release candidate POI ${version.id}"/>
|
|
||||||
</svn>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="release-finish" description="write the dist to the release candidate repo - needs Java7+">
|
|
||||||
<!--svn refid="svn.settings">
|
|
||||||
<update dir="." recurse="true"/>
|
|
||||||
</svn-->
|
|
||||||
<local name="rel_prev"/>
|
|
||||||
<local name="file_date"/>
|
|
||||||
<local name="file_date_iso"/>
|
|
||||||
|
|
||||||
<tstamp>
|
|
||||||
<!-- usually overwritten by a command line argument -->
|
|
||||||
<!-- for convenience this is kept in the same format as in the release-prep call -->
|
|
||||||
<format property="file_date" pattern="yyyyMMdd" locale="US"/>
|
|
||||||
</tstamp>
|
|
||||||
|
|
||||||
|
|
||||||
<taskdef name="NextRelease" classname="NextRelease" classpath="poi-excelant/build/poi-ant-contrib"/>
|
|
||||||
<NextRelease property="rel_prev" increment="-1"/>
|
|
||||||
|
|
||||||
<!-- we don't simply generate a new iso file date with tstamp,
|
|
||||||
but potentially use the date given as an argument to ant -->
|
|
||||||
<loadresource property="file_date_iso">
|
|
||||||
<string>${file_date}</string>
|
|
||||||
<filterchain>
|
|
||||||
<replaceregex pattern="([0-9]{4})([0-9]{2})([0-9]{2})" replace="\1-\2-\3"/>
|
|
||||||
</filterchain>
|
|
||||||
</loadresource>
|
|
||||||
|
|
||||||
<replaceregexp file="build.gradle" match="( +version += +)'[^']+'" replace="\1'${version.id}'"/>
|
|
||||||
<replaceregexp file="poi-examples/src/main/groovy/build.gradle" match="( *compile 'org.apache.poi:[^0-9]+)([0-9.]+)'" replace="\1${rel_prev}'" byline="true"/>
|
|
||||||
<replaceregexp file="poi-examples/src/main/scala/build.sbt" match='( *org.apache.poi.* ")[0-9.]+(.+)' replace="\1${rel_prev}\2" byline="true"/>
|
|
||||||
<replaceregexp file="osgi/pom.xml" match="version>${rel_prev}[^<]+" replace="version>${version.id}"/>
|
|
||||||
<replaceregexp file="doap_POI.rdf" match="<release>" replace="<release> <Version> <name>Apache POI ${rel_prev}</name> <created>${file_date_iso}</created> <revision>${rel_prev}</revision> </Version> </release> <release>"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<target name="-update-build.xml">
|
<target name="-update-build.xml">
|
||||||
<replaceregexp byline="true">
|
<replaceregexp byline="true">
|
||||||
<regexp pattern="(<property name="version.id" value=")[^"]+("/>)"/>
|
<regexp pattern="(<property name="version.id" value=")[^"]+("/>)"/>
|
||||||
|
|||||||
57
doap_POI.rdf
57
doap_POI.rdf
@ -35,6 +35,55 @@
|
|||||||
<programming-language>Java</programming-language>
|
<programming-language>Java</programming-language>
|
||||||
<category rdf:resource="https://projects.apache.org/category/content" />
|
<category rdf:resource="https://projects.apache.org/category/content" />
|
||||||
<category rdf:resource="https://projects.apache.org/category/library" />
|
<category rdf:resource="https://projects.apache.org/category/library" />
|
||||||
|
<release>
|
||||||
|
<Version>
|
||||||
|
<name>Apache POI 5.5.1</name>
|
||||||
|
<created>2025-11-30</created>
|
||||||
|
<revision>5.5.1</revision>
|
||||||
|
</Version>
|
||||||
|
</release>
|
||||||
|
<release>
|
||||||
|
<Version>
|
||||||
|
<name>Apache POI 5.5.0</name>
|
||||||
|
<created>2025-11-15</created>
|
||||||
|
<revision>5.5.0</revision>
|
||||||
|
</Version>
|
||||||
|
</release>
|
||||||
|
<release>
|
||||||
|
<Version>
|
||||||
|
<name>Apache POI 5.4.1</name>
|
||||||
|
<created>2025-04-06</created>
|
||||||
|
<revision>5.4.1</revision>
|
||||||
|
</Version>
|
||||||
|
</release>
|
||||||
|
<release>
|
||||||
|
<Version>
|
||||||
|
<name>Apache POI 5.4.0</name>
|
||||||
|
<created>2025-01-08</created>
|
||||||
|
<revision>5.4.0</revision>
|
||||||
|
</Version>
|
||||||
|
</release>
|
||||||
|
<release>
|
||||||
|
<Version>
|
||||||
|
<name>Apache POI 5.3.0</name>
|
||||||
|
<created>2024-07-02</created>
|
||||||
|
<revision>5.3.0</revision>
|
||||||
|
</Version>
|
||||||
|
</release>
|
||||||
|
<release>
|
||||||
|
<Version>
|
||||||
|
<name>Apache POI 5.2.5</name>
|
||||||
|
<created>2023-11-25</created>
|
||||||
|
<revision>5.2.5</revision>
|
||||||
|
</Version>
|
||||||
|
</release>
|
||||||
|
<release>
|
||||||
|
<Version>
|
||||||
|
<name>Apache POI 5.2.4</name>
|
||||||
|
<created>2023-09-28</created>
|
||||||
|
<revision>5.2.4</revision>
|
||||||
|
</Version>
|
||||||
|
</release>
|
||||||
<release>
|
<release>
|
||||||
<Version>
|
<Version>
|
||||||
<name>Apache POI 5.2.3</name>
|
<name>Apache POI 5.2.3</name>
|
||||||
@ -218,10 +267,10 @@
|
|||||||
</Version>
|
</Version>
|
||||||
</release>
|
</release>
|
||||||
<repository>
|
<repository>
|
||||||
<SVNRepository>
|
<GitRepository>
|
||||||
<location rdf:resource="https://svn.apache.org/repos/asf/poi/"/>
|
<location rdf:resource="https://github.com/apache/poi.git"/>
|
||||||
<browse rdf:resource="https://svn.apache.org/viewvc/poi/"/>
|
<browse rdf:resource="https://github.com/apache/poi/"/>
|
||||||
</SVNRepository>
|
</GitRepository>
|
||||||
</repository>
|
</repository>
|
||||||
<maintainer>
|
<maintainer>
|
||||||
<foaf:Person>
|
<foaf:Person>
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
# Specifies the JVM arguments used for the daemon process.
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
# The setting is particularly useful for tweaking memory settings.
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
# Less than 2G definitely slows things down. -XX:+HeapDumpOnOutOfMemoryError
|
# Less than 2G definitely slows things down. Increased to 3G due to OOM issues on ci-builds.apache.org.
|
||||||
org.gradle.jvmargs=-Xmx2G -Dfile.encoding=UTF-8
|
# -XX:+HeapDumpOnOutOfMemoryError
|
||||||
|
org.gradle.jvmargs=-Xmx3G -Dfile.encoding=UTF-8
|
||||||
|
|
||||||
# Activating will be much faster, but break the build of 'poi-ooxml-lite'
|
# Activating will be much faster, but break the build of 'poi-ooxml-lite'
|
||||||
# @todo: look into poi-ooxml-lite task generateModuleInfo and enforce running whatever is needed before
|
org.gradle.caching=true
|
||||||
org.gradle.caching=false
|
|
||||||
|
|
||||||
# Modularise your project and enable parallel build
|
# Modularise your project and enable parallel build
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
|
|||||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
37
gradlew
vendored
37
gradlew
vendored
@ -15,6 +15,8 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@ -55,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@ -84,7 +86,7 @@ done
|
|||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||||
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
|
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@ -112,20 +114,7 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
CLASSPATH="\\\"\\\""
|
||||||
# Loop in case we encounter an error.
|
|
||||||
for attempt in 1 2 3; do
|
|
||||||
if [ ! -e "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" ]; then
|
|
||||||
if ! curl -s -S --retry 3 -L -o "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" "https://raw.githubusercontent.com/gradle/gradle/v8.3/gradle/wrapper/gradle-wrapper.jar"; then
|
|
||||||
rm -f "$APP_HOME/gradle/wrapper/gradle-wrapper.jar"
|
|
||||||
# Pause for a bit before looping in case the server throttled us.
|
|
||||||
sleep 5
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@ -158,7 +147,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@ -166,7 +155,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC3045
|
# shellcheck disable=SC2039,SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@ -215,16 +204,16 @@ fi
|
|||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command;
|
# Collect all arguments for the java command:
|
||||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||||
# shell script including quotes and variable substitutions, so put them in
|
# and any embedded shellness will be escaped.
|
||||||
# double quotes to make sure that they get re-expanded; and
|
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||||
# * put everything else in single quotes, so that it's not re-expanded.
|
# treated as '${Hostname}' itself on the command line.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-classpath "$CLASSPATH" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|||||||
26
gradlew.bat
vendored
26
gradlew.bat
vendored
@ -13,6 +13,8 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
@rem SPDX-License-Identifier: Apache-2.0
|
||||||
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@ -57,22 +59,22 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||||
echo.
|
echo. 1>&2
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation.
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
@ -1,3 +1,20 @@
|
|||||||
|
/* ====================================================================
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
this work for additional information regarding copyright ownership.
|
||||||
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
(the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
==================================================================== */
|
||||||
|
|
||||||
// This script is used as input to the Jenkins Job DSL plugin to create all the build-jobs that
|
// This script is used as input to the Jenkins Job DSL plugin to create all the build-jobs that
|
||||||
// Apache POI uses on the public Jenkins instance at https://ci-builds.apache.org/job/POI/
|
// Apache POI uses on the public Jenkins instance at https://ci-builds.apache.org/job/POI/
|
||||||
//
|
//
|
||||||
@ -14,42 +31,31 @@ def xercesUrl = 'https://repo1.maven.org/maven2/xerces/xercesImpl/2.6.1/xercesIm
|
|||||||
def xercesLib = './xercesImpl-2.6.1.jar'
|
def xercesLib = './xercesImpl-2.6.1.jar'
|
||||||
|
|
||||||
def poijobs = [
|
def poijobs = [
|
||||||
[ name: 'POI-DSL-1.8', trigger: 'H */12 * * *', jenkinsLite: true
|
[ name: 'POI-DSL-1.8',
|
||||||
|
jdk: '1.8',
|
||||||
|
trigger: 'H */12 * * *',
|
||||||
|
jenkinsLite: true,
|
||||||
|
disabled: true // JDK 8 is no longer supported by POI 6
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-OpenJDK', jdk: 'OpenJDK 1.8', trigger: 'H */12 * * *',
|
[ name: 'POI-DSL-1.8-branch-5.5.x',
|
||||||
// only a limited set of nodes still have OpenJDK 8 (on Ubuntu) installed
|
jdk: '1.8',
|
||||||
slaves: 'ubuntu',
|
branch: '5.5.x',
|
||||||
skipcigame: true,
|
trigger: 'H */12 * * *',
|
||||||
jenkinsLite: true
|
jenkinsLite: true,
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-1.11', jdk: '1.11', trigger: triggerSundays, skipcigame: true
|
[ name: 'POI-DSL-1.11', jdk: '1.11', trigger: triggerSundays, skipcigame: true
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-1.15', jdk: '1.15', trigger: triggerSundays, skipcigame: true,
|
|
||||||
// let's save some CPU cycles here, 15 is not an LTS and JDK 16 is GA
|
|
||||||
disabled: true
|
|
||||||
],
|
|
||||||
[ name: 'POI-DSL-1.16', jdk: '1.16', trigger: triggerSundays, skipcigame: true,
|
|
||||||
// let's save some CPU cycles here, 16 is not an LTS and JDK 17 is GA
|
|
||||||
disabled: true
|
|
||||||
],
|
|
||||||
[ name: 'POI-DSL-1.17', jdk: '1.17', trigger: 'H */12 * * *', skipcigame: true
|
[ name: 'POI-DSL-1.17', jdk: '1.17', trigger: 'H */12 * * *', skipcigame: true
|
||||||
],
|
],
|
||||||
// Jenkins on ci-builds.apache.org does not support spotbugs with a new enough version of asm for Java18+
|
[ name: 'POI-DSL-1.21', jdk: '1.21', trigger: 'H */12 * * *', skipcigame: true
|
||||||
[ name: 'POI-DSL-1.18', jdk: '1.18', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true,
|
|
||||||
// let's save some CPU cycles here, 18 is not a LTS and JDK 20 is out
|
|
||||||
disabled: true
|
|
||||||
],
|
],
|
||||||
// Jenkins on ci-builds.apache.org does not support spotbugs with a new enough version of asm for Java18+
|
[ name: 'POI-DSL-1.24', jdk: '1.24', trigger: triggerSundays, skipcigame: true,
|
||||||
[ name: 'POI-DSL-1.19', jdk: '1.19', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true
|
|
||||||
],
|
],
|
||||||
// Jenkins on ci-builds.apache.org does not support spotbugs with a new enough version of asm for Java18+
|
[ name: 'POI-DSL-1.25', jdk: '1.25', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true,
|
||||||
[ name: 'POI-DSL-1.20', jdk: '1.20', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true
|
// use Ant for building until Gradle supports JDK 25
|
||||||
],
|
// see https://docs.gradle.org/current/userguide/compatibility.html
|
||||||
// Jenkins on ci-builds.apache.org does not support spotbugs with a new enough version of asm for Java18+
|
// and https://github.com/gradle/gradle/issues/31625
|
||||||
[ name: 'POI-DSL-1.21', jdk: '1.21', trigger: 'H */12 * * *', skipcigame: true, skipSpotbugs: true
|
useAnt: true
|
||||||
],
|
|
||||||
// Jenkins on ci-builds.apache.org does not support spotbugs with a new enough version of asm for Java18+
|
|
||||||
[ name: 'POI-DSL-1.22', jdk: '1.22', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true
|
|
||||||
],
|
],
|
||||||
// Use Ant-build for now as selecting IBM JDK via toolchain does not work (yet)
|
// Use Ant-build for now as selecting IBM JDK via toolchain does not work (yet)
|
||||||
[ name: 'POI-DSL-IBM-JDK', jdk: 'IBMJDK', trigger: triggerSundays, skipcigame: true, useAnt: true
|
[ name: 'POI-DSL-IBM-JDK', jdk: 'IBMJDK', trigger: triggerSundays, skipcigame: true, useAnt: true
|
||||||
@ -60,17 +66,11 @@ def poijobs = [
|
|||||||
// the property triggers using Xerces as XML Parser and previously showed some exception that can occur
|
// the property triggers using Xerces as XML Parser and previously showed some exception that can occur
|
||||||
properties: ["-Dadditionaljar=${xercesLib}"]
|
properties: ["-Dadditionaljar=${xercesLib}"]
|
||||||
],
|
],
|
||||||
// [ name: 'POI-DSL-Maven', trigger: 'H */4 * * *', maven: true,
|
|
||||||
// // not needed any more now that we use Gradle for SonarQube
|
|
||||||
// disabled: true
|
|
||||||
// ],
|
|
||||||
[ name: 'POI-DSL-regenerate-javadoc', trigger: triggerSundays, javadoc: true
|
[ name: 'POI-DSL-regenerate-javadoc', trigger: triggerSundays, javadoc: true
|
||||||
],
|
],
|
||||||
// it was impossible to make this run stable in Gradle, thus disabling this for now
|
// it was impossible to make this run stable in Gradle, thus disabling this for now
|
||||||
[ name: 'POI-DSL-API-Check', trigger: '@daily', apicheck: true, disabled: true, useAnt: true
|
[ name: 'POI-DSL-API-Check', trigger: '@daily', apicheck: true, disabled: true, useAnt: true
|
||||||
],
|
],
|
||||||
// [ name: 'POI-DSL-Gradle', trigger: triggerSundays, email: 'centic@apache.org'
|
|
||||||
// ],
|
|
||||||
[ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true
|
[ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-saxon-test', trigger: triggerSundays, saxonTest: true
|
[ name: 'POI-DSL-saxon-test', trigger: triggerSundays, saxonTest: true
|
||||||
@ -80,33 +80,30 @@ def poijobs = [
|
|||||||
// // replaced by Gradle-based build now
|
// // replaced by Gradle-based build now
|
||||||
// disabled: true
|
// disabled: true
|
||||||
// ],
|
// ],
|
||||||
[ name: 'POI-DSL-SonarQube-Gradle', jdk: '1.11', trigger: 'H 7 * * *', sonar: true, skipcigame: true
|
[ name: 'POI-DSL-SonarQube-Gradle', jdk: '1.17', trigger: 'H 7 * * *', sonar: true, skipcigame: true
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-Windows-1.8', trigger: 'H */12 * * *', windows: true, slaves: 'Windows', jenkinsLite: true
|
[ name: 'POI-DSL-Windows-1.8',
|
||||||
|
trigger: 'H */12 * * *',
|
||||||
|
windows: true,
|
||||||
|
slaves: 'Windows',
|
||||||
|
jenkinsLite: true,
|
||||||
|
disabled: true // JDK 8 is no longer supported by POI 6
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-Windows-1.11', jdk: '1.11', trigger: triggerSundays, windows: true, slaves: 'Windows',
|
[ name: 'POI-DSL-Windows-1.11', jdk: '1.11', trigger: triggerSundays, windows: true, slaves: 'Windows',
|
||||||
jenkinsLite: true
|
jenkinsLite: true
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-Windows-1.15', jdk: '1.15', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
|
|
||||||
// let's save some CPU cycles here, 14 is not an LTS and JDK 15 is GA as of 15 September 2020
|
|
||||||
disabled: true
|
|
||||||
],
|
|
||||||
[ name: 'POI-DSL-Windows-1.16', jdk: '1.16', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
|
|
||||||
// let's save some CPU cycles here, 16 is not an LTS and JDK 17 is GA
|
|
||||||
disabled: true
|
|
||||||
],
|
|
||||||
[ name: 'POI-DSL-Windows-1.17', jdk: '1.17', trigger: 'H */12 * * *', windows: true, slaves: 'Windows', skipcigame: true
|
[ name: 'POI-DSL-Windows-1.17', jdk: '1.17', trigger: 'H */12 * * *', windows: true, slaves: 'Windows', skipcigame: true
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-Windows-1.18', jdk: '1.18', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
|
|
||||||
skipSpotbugs: true,
|
|
||||||
// let's save some CPU cycles here, 18 is not an LTS and JDK 20 is out
|
|
||||||
disabled: true
|
|
||||||
],
|
|
||||||
[ name: 'POI-DSL-Windows-1.20', jdk: '1.20', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true
|
|
||||||
],
|
|
||||||
[ name: 'POI-DSL-Windows-1.21', jdk: '1.21', trigger: 'H */12 * * *', windows: true, slaves: 'Windows', skipcigame: true
|
[ name: 'POI-DSL-Windows-1.21', jdk: '1.21', trigger: 'H */12 * * *', windows: true, slaves: 'Windows', skipcigame: true
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-Windows-1.22', jdk: '1.22', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true
|
[ name: 'POI-DSL-Windows-1.24', jdk: '1.24', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
|
||||||
|
],
|
||||||
|
[ name: 'POI-DSL-Windows-1.25', jdk: '1.25', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
|
||||||
|
skipSpotbugs: true,
|
||||||
|
// use Ant for building until Gradle supports JDK 24
|
||||||
|
// see https://docs.gradle.org/current/userguide/compatibility.html
|
||||||
|
// and https://github.com/gradle/gradle/issues/31625
|
||||||
|
useAnt: true
|
||||||
],
|
],
|
||||||
[ name: 'POI-DSL-Github-PullRequests', trigger: '', skipcigame: true, disabled: true
|
[ name: 'POI-DSL-Github-PullRequests', trigger: '', skipcigame: true, disabled: true
|
||||||
],
|
],
|
||||||
@ -117,37 +114,25 @@ def xmlbeansjobs = [
|
|||||||
],
|
],
|
||||||
[ name: 'POI-XMLBeans-DSL-1.11', jdk: '1.11', trigger: triggerSundays, skipcigame: true,
|
[ name: 'POI-XMLBeans-DSL-1.11', jdk: '1.11', trigger: triggerSundays, skipcigame: true,
|
||||||
],
|
],
|
||||||
[ name: 'POI-XMLBeans-DSL-1.16', jdk: '1.16', trigger: triggerSundays, skipcigame: true,
|
|
||||||
// let's save some CPU cycles here, 16 is not an LTS and JDK 17 is GA
|
|
||||||
disabled: true
|
|
||||||
],
|
|
||||||
[ name: 'POI-XMLBeans-DSL-1.17', jdk: '1.17', trigger: 'H */12 * * *', skipcigame: true,
|
[ name: 'POI-XMLBeans-DSL-1.17', jdk: '1.17', trigger: 'H */12 * * *', skipcigame: true,
|
||||||
],
|
],
|
||||||
[ name: 'POI-XMLBeans-DSL-1.18', jdk: '1.18', trigger: triggerSundays, skipcigame: true,
|
|
||||||
// let's save some CPU cycles here, 18 is not an LTS and JDK 20 is out
|
|
||||||
disabled: true
|
|
||||||
],
|
|
||||||
[ name: 'POI-XMLBeans-DSL-1.19', jdk: '1.19', trigger: triggerSundays, skipcigame: true,
|
|
||||||
// let's save some CPU cycles here, 19 is not an LTS
|
|
||||||
disabled: true
|
|
||||||
],
|
|
||||||
[ name: 'POI-XMLBeans-DSL-1.20', jdk: '1.20', trigger: triggerSundays, skipcigame: true,
|
|
||||||
],
|
|
||||||
[ name: 'POI-XMLBeans-DSL-1.21', jdk: '1.21', trigger: 'H */12 * * *', skipcigame: true,
|
[ name: 'POI-XMLBeans-DSL-1.21', jdk: '1.21', trigger: 'H */12 * * *', skipcigame: true,
|
||||||
],
|
],
|
||||||
[ name: 'POI-XMLBeans-DSL-1.22', jdk: '1.22', trigger: triggerSundays, skipcigame: true,
|
[ name: 'POI-XMLBeans-DSL-1.24', jdk: '1.24', trigger: triggerSundays, skipcigame: true,
|
||||||
|
disabled: true
|
||||||
],
|
],
|
||||||
[ name: 'POI-XMLBeans-DSL-1.20', jdk: '1.20', trigger: triggerSundays, skipcigame: true,
|
[ name: 'POI-XMLBeans-DSL-1.25', jdk: '1.25', trigger: triggerSundays, skipcigame: true,
|
||||||
],
|
],
|
||||||
[ name: 'POI-XMLBeans-DSL-Sonar', jdk: '1.11', trigger: triggerSundays, skipcigame: true,
|
[ name: 'POI-XMLBeans-DSL-Sonar', jdk: '1.17', trigger: triggerSundays, skipcigame: true,
|
||||||
sonar: true
|
sonar: true
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
def svnBase = 'https://svn.apache.org/repos/asf/poi/trunk'
|
def gitBase = 'https://github.com/apache/poi.git'
|
||||||
def xmlbeansSvnBase = 'https://svn.apache.org/repos/asf/xmlbeans/trunk'
|
def xmlbeansGitBase = 'https://github.com/apache/xmlbeans.git'
|
||||||
|
|
||||||
def defaultJdk = '1.8'
|
def defaultJdk = '1.11'
|
||||||
|
def defaultBranch = 'trunk'
|
||||||
def defaultTrigger = 'H/15 * * * *' // check SCM every 60/15 = 4 minutes
|
def defaultTrigger = 'H/15 * * * *' // check SCM every 60/15 = 4 minutes
|
||||||
def defaultEmail = 'dev@poi.apache.org'
|
def defaultEmail = 'dev@poi.apache.org'
|
||||||
def defaultAnt = 'ant_1.10_latest'
|
def defaultAnt = 'ant_1.10_latest'
|
||||||
@ -159,16 +144,12 @@ def defaultSlaves = '(ubuntu)&&!beam&&!cloud-slave&&!H29'
|
|||||||
def jdkMapping = [
|
def jdkMapping = [
|
||||||
'1.8': [ jenkinsJdk: 'jdk_1.8_latest', jdkVersion: 8, jdkVendor: '' ],
|
'1.8': [ jenkinsJdk: 'jdk_1.8_latest', jdkVersion: 8, jdkVendor: '' ],
|
||||||
'1.11': [ jenkinsJdk: 'jdk_11_latest', jdkVersion: 11, jdkVendor: '' ],
|
'1.11': [ jenkinsJdk: 'jdk_11_latest', jdkVersion: 11, jdkVendor: '' ],
|
||||||
'1.15': [ jenkinsJdk: 'jdk_15_latest', jdkVersion: 15, jdkVendor: '' ],
|
|
||||||
'1.16': [ jenkinsJdk: 'jdk_16_latest', jdkVersion: 16, jdkVendor: '' ],
|
|
||||||
'1.17': [ jenkinsJdk: 'jdk_17_latest', jdkVersion: 17, jdkVendor: '' ],
|
'1.17': [ jenkinsJdk: 'jdk_17_latest', jdkVersion: 17, jdkVendor: '' ],
|
||||||
'1.18': [ jenkinsJdk: 'jdk_18_latest', jdkVersion: 18, jdkVendor: '' ],
|
|
||||||
'1.19': [ jenkinsJdk: 'jdk_19_latest', jdkVersion: 19, jdkVendor: '' ],
|
|
||||||
'1.20': [ jenkinsJdk: 'jdk_20_latest', jdkVersion: 20, jdkVendor: '' ],
|
|
||||||
'1.21': [ jenkinsJdk: 'jdk_21_latest', jdkVersion: 21, jdkVendor: '' ],
|
'1.21': [ jenkinsJdk: 'jdk_21_latest', jdkVersion: 21, jdkVendor: '' ],
|
||||||
'1.22': [ jenkinsJdk: 'jdk_22_latest', jdkVersion: 22, jdkVendor: '' ],
|
'1.24': [ jenkinsJdk: 'jdk_24_latest', jdkVersion: 24, jdkVendor: '' ],
|
||||||
'OpenJDK 1.8': [ jenkinsJdk: 'adoptopenjdk_hotspot_8u282', jdkVersion: 8, jdkVendor: 'adoptopenjdk' ],
|
'1.25': [ jenkinsJdk: 'jdk_25_latest', jdkVersion: 25, jdkVendor: '' ],
|
||||||
'IBMJDK': [ jenkinsJdk: 'ibmjdk_1.8.0_261', jdkVersion: 8, jdkVendor: 'ibm' ]
|
// one of the few IBM JDKs that is still supported on ci-builds.apache.org
|
||||||
|
'IBMJDK': [ jenkinsJdk: 'ibm_semeru_21.0.2_13', jdkVersion: 21, jdkVendor: 'ibm' ]
|
||||||
]
|
]
|
||||||
|
|
||||||
static def shellEx(def context, String cmd, def poijob) {
|
static def shellEx(def context, String cmd, def poijob) {
|
||||||
@ -186,7 +167,7 @@ Apache POI - the Java API for Microsoft Documents
|
|||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<b>This is an automatically generated Job Config, do not edit it here!
|
<b>This is an automatically generated Job Config, do not edit it here!
|
||||||
Instead change the Jenkins Job DSL at <a href="https://svn.apache.org/repos/asf/poi/trunk/jenkins">https://svn.apache.org/repos/asf/poi/trunk/jenkins</a>,
|
Instead change the Jenkins Job DSL at <a href="https://github.com/apache/poi/blob/trunk/jenkins/">https://github.com/apache/poi/blob/trunk/jenkins/</a>,
|
||||||
see <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>
|
see <a href="https://github.com/jenkinsci/job-dsl-plugin/wiki">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>
|
||||||
for more details about the DSL.</b>
|
for more details about the DSL.</b>
|
||||||
</p>'''
|
</p>'''
|
||||||
@ -216,10 +197,9 @@ def shellCmdsUnix =
|
|||||||
rm -rf examples excelant integrationtest main ooxml ooxml-schema scratchpad build.javacheck.xml
|
rm -rf examples excelant integrationtest main ooxml ooxml-schema scratchpad build.javacheck.xml
|
||||||
|
|
||||||
# show which files are currently modified in the working copy
|
# show which files are currently modified in the working copy
|
||||||
svn status || true
|
git status || true
|
||||||
# make sure no changed module-class-files or ooxml-lite-report-files are lingering on
|
# make sure no changed module-class-files or ooxml-lite-report-files are lingering on
|
||||||
svn revert poi*/src/*/java9/module-info.* || true
|
git reset --hard || true
|
||||||
svn revert src/resources/ooxml-lite-report.* || true
|
|
||||||
|
|
||||||
# print out information about which exact version of java we are using
|
# print out information about which exact version of java we are using
|
||||||
echo Java-Home: $JAVA_HOME
|
echo Java-Home: $JAVA_HOME
|
||||||
@ -252,11 +232,9 @@ exit 0'''
|
|||||||
def shellCmdsWin =
|
def shellCmdsWin =
|
||||||
'''@echo off
|
'''@echo off
|
||||||
:: show which files are currently modified in the working copy
|
:: show which files are currently modified in the working copy
|
||||||
svn status
|
git status
|
||||||
:: make sure no changed module-class-files are lingering on
|
:: make sure no changed module-class-files are lingering on
|
||||||
svn revert poi*\\src\\*\\java9\\module-info.*
|
git reset --hard
|
||||||
:: also revert some files directly as the wildcard-based revert seems to fail sometimes
|
|
||||||
svn revert poi\\src\\main\\java9\\module-info.class poi\\src\\test\\java9\\module-info.class poi-examples\\src\\main\\java9\\module-info.class poi-excelant\\src\\main\\java9\\module-info.class poi-excelant\\src\\test\\java9\\module-info.class poi-integration\\src\\test\\java9\\module-info.class poi-ooxml\\src\\main\\java9\\module-info.class poi-ooxml\\src\\test\\java9\\module-info.class poi-ooxml-full\\src\\main\\java9\\module-info.class poi-ooxml-lite\\src\\main\\java9\\module-info.class poi-ooxml-lite\\src\\main\\java9\\module-info.java poi-ooxml-lite-agent\\src\\main\\java9\\module-info.class poi-scratchpad\\src\\main\\java9\\module-info.class poi-scratchpad\\src\\test\\java9\\module-info.class src\\resources\\ooxml-lite-report.clazz src\\resources\\ooxml-lite-report.xsb
|
|
||||||
|
|
||||||
:: print out information about which exact version of java we are using
|
:: print out information about which exact version of java we are using
|
||||||
echo Java-Home: %JAVA_HOME%
|
echo Java-Home: %JAVA_HOME%
|
||||||
@ -274,6 +252,7 @@ poijobs.each { poijob ->
|
|||||||
def email = poijob.email ?: defaultEmail
|
def email = poijob.email ?: defaultEmail
|
||||||
def slaves = poijob.slaves ?: defaultSlaves + (poijob.slaveAdd ?: '')
|
def slaves = poijob.slaves ?: defaultSlaves + (poijob.slaveAdd ?: '')
|
||||||
def antRT = poijob.windows ? defaultAntWindows : defaultAnt
|
def antRT = poijob.windows ? defaultAntWindows : defaultAnt
|
||||||
|
def checkoutBranch = poijob.branch ?: defaultBranch
|
||||||
|
|
||||||
job('POI/' + poijob.name) {
|
job('POI/' + poijob.name) {
|
||||||
if (poijob.disabled) {
|
if (poijob.disabled) {
|
||||||
@ -318,9 +297,11 @@ poijobs.each { poijob ->
|
|||||||
}
|
}
|
||||||
jdk(jdkMapping.get(jdkKey).jenkinsJdk)
|
jdk(jdkMapping.get(jdkKey).jenkinsJdk)
|
||||||
scm {
|
scm {
|
||||||
svn(svnBase) { svnNode ->
|
git {
|
||||||
svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
|
remote {
|
||||||
url << 'https://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
|
url(gitBase)
|
||||||
|
}
|
||||||
|
branch("*/${checkoutBranch}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
checkoutRetryCount(3)
|
checkoutRetryCount(3)
|
||||||
@ -358,7 +339,7 @@ poijobs.each { poijob ->
|
|||||||
|
|
||||||
gradle {
|
gradle {
|
||||||
switches('-PenableSonar')
|
switches('-PenableSonar')
|
||||||
switches('-Dsonar.login=${POI_SONAR_TOKEN}')
|
switches('-Dsonar.token=${POI_SONAR_TOKEN}')
|
||||||
switches('-Dsonar.organization=apache')
|
switches('-Dsonar.organization=apache')
|
||||||
switches('-Dsonar.projectKey=poi-parent')
|
switches('-Dsonar.projectKey=poi-parent')
|
||||||
switches('-Dsonar.host.url=https://sonarcloud.io')
|
switches('-Dsonar.host.url=https://sonarcloud.io')
|
||||||
@ -369,7 +350,7 @@ poijobs.each { poijob ->
|
|||||||
tasks('clean')
|
tasks('clean')
|
||||||
tasks('check')
|
tasks('check')
|
||||||
tasks('jacocoTestReport')
|
tasks('jacocoTestReport')
|
||||||
tasks('sonarqube')
|
tasks('sonar')
|
||||||
useWrapper(true)
|
useWrapper(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -458,7 +439,7 @@ poijobs.each { poijob ->
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// in archive, junit and jacoco publishers, matches beneath build/*/build/... are for Gradle-build results
|
// in archive, junit and jacoco publishers, matches beneath build/*/build/... are for Gradle-build results
|
||||||
archiveArtifacts('build/dist/*.zip,build/dist/*.tgz,build/dist/maven/*/*.jar,build/coverage/**,*/build/reports/*.bom.*,build/hs_err*.log')
|
archiveArtifacts('build/dist/*.zip,build/dist/*.tgz,build/dist/maven/*/*.jar,build/dist/maven/*/*.pom,build/dist/maven/*/*.asc,build/dist/maven/*/*.sha256,build/dist/maven/*/*.sha512,build/coverage/**,*/build/reports/*.bom.*,build/hs_err*.log')
|
||||||
/* this plugin is currently missing on the Apache Jenkins instance
|
/* this plugin is currently missing on the Apache Jenkins instance
|
||||||
warnings(['Java Compiler (javac)', 'JavaDoc Tool'], null) {
|
warnings(['Java Compiler (javac)', 'JavaDoc Tool'], null) {
|
||||||
resolveRelativePaths()
|
resolveRelativePaths()
|
||||||
@ -509,8 +490,8 @@ xmlbeansjobs.each { xjob ->
|
|||||||
label(slaves)
|
label(slaves)
|
||||||
environmentVariables {
|
environmentVariables {
|
||||||
env('LANG', 'en_US.UTF-8')
|
env('LANG', 'en_US.UTF-8')
|
||||||
if (jdkKey == '1.11' || jdkKey == '1.15' || jdkKey == '1.16' || jdkKey == '1.17'
|
if (jdkKey == '1.11' || jdkKey == '1.17' || jdkKey == '1.21'
|
||||||
|| jdkKey == '1.18' || jdkKey == '1.19' || jdkKey == '1.20' || jdkKey == '1.21') {
|
|| jdkKey == '1.23' || jdkKey == '1.24' || jdkKey == '1.25') {
|
||||||
env('ANT_OPTS', '--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED')
|
env('ANT_OPTS', '--add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED')
|
||||||
}
|
}
|
||||||
// will be needed for forbidden-apis-check: env('ANT_HOME', xjob.windows ? 'f:\\jenkins\\tools\\ant\\latest' : '/usr/share/ant')
|
// will be needed for forbidden-apis-check: env('ANT_HOME', xjob.windows ? 'f:\\jenkins\\tools\\ant\\latest' : '/usr/share/ant')
|
||||||
@ -533,9 +514,11 @@ xmlbeansjobs.each { xjob ->
|
|||||||
}
|
}
|
||||||
jdk(jdkMapping.get(jdkKey).jenkinsJdk)
|
jdk(jdkMapping.get(jdkKey).jenkinsJdk)
|
||||||
scm {
|
scm {
|
||||||
svn(xmlbeansSvnBase) { svnNode ->
|
git {
|
||||||
svnNode / browser(class: 'hudson.scm.browsers.ViewSVN') /
|
remote {
|
||||||
url << 'https://svn.apache.org/viewcvs.cgi/?root=Apache-SVN'
|
url(xmlbeansGitBase)
|
||||||
|
}
|
||||||
|
branch('*/trunk')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
checkoutRetryCount(3)
|
checkoutRetryCount(3)
|
||||||
@ -556,7 +539,7 @@ xmlbeansjobs.each { xjob ->
|
|||||||
gradle {
|
gradle {
|
||||||
if (xjob.sonar) {
|
if (xjob.sonar) {
|
||||||
switches('-PenableSonar')
|
switches('-PenableSonar')
|
||||||
switches('-Dsonar.login=${POI_SONAR_TOKEN}')
|
switches('-Dsonar.token=${POI_SONAR_TOKEN}')
|
||||||
switches('-Dsonar.organization=apache')
|
switches('-Dsonar.organization=apache')
|
||||||
switches('-Dsonar.projectKey=apache_xmlbeans')
|
switches('-Dsonar.projectKey=apache_xmlbeans')
|
||||||
switches('-Dsonar.host.url=https://sonarcloud.io')
|
switches('-Dsonar.host.url=https://sonarcloud.io')
|
||||||
@ -569,7 +552,7 @@ xmlbeansjobs.each { xjob ->
|
|||||||
tasks('jenkins')
|
tasks('jenkins')
|
||||||
tasks('jacocoTestReport')
|
tasks('jacocoTestReport')
|
||||||
if (xjob.sonar) {
|
if (xjob.sonar) {
|
||||||
tasks('sonarqube')
|
tasks('sonar')
|
||||||
}
|
}
|
||||||
useWrapper(true)
|
useWrapper(true)
|
||||||
}
|
}
|
||||||
@ -628,26 +611,19 @@ Unfortunately we often see builds break because of changes/new machines...''')
|
|||||||
}
|
}
|
||||||
axes {
|
axes {
|
||||||
jdk(
|
jdk(
|
||||||
'jdk_1.8_latest',
|
'jdk_8_latest',
|
||||||
'jdk_11_latest',
|
'jdk_11_latest',
|
||||||
/* don't look for JDKs that are out of support
|
|
||||||
'jdk_10_latest',
|
|
||||||
'jdk_12_latest',
|
|
||||||
'jdk_13_latest',
|
|
||||||
'jdk_14_latest',
|
|
||||||
'jdk_15_latest',
|
|
||||||
'jdk_16_latest',*/
|
|
||||||
'jdk_17_latest',
|
'jdk_17_latest',
|
||||||
'jdk_18_latest',
|
|
||||||
'jdk_19_latest',
|
|
||||||
'jdk_20_latest',
|
|
||||||
'jdk_21_latest',
|
'jdk_21_latest',
|
||||||
'jdk_22_latest',
|
'jdk_23_latest',
|
||||||
'adoptopenjdk_hotspot_8u282',
|
'jdk_24_latest',
|
||||||
'ibmjdk_1.8.0_261'
|
'jdk_25_latest',
|
||||||
|
'jdk_26_latest',
|
||||||
|
'ibm_semeru_21.0.2_13'
|
||||||
)
|
)
|
||||||
// Note H50 is reserved according to its node-description
|
// Note H50 is reserved according to its node-description
|
||||||
label('Nodes','builds22','builds23','builds24','builds25','builds26','builds27','builds28','builds29','builds30','builds31','builds32','builds33','builds34','builds35','builds36','builds37','builds38','builds39','builds40','builds50','builds56','builds57','builds58','builds59','builds60')
|
label('Nodes','builds22','builds23','builds24','builds25','builds26','builds27','builds28','builds29','builds30','builds31','builds32','builds33','builds34','builds35','builds36','builds37','builds38','builds39','builds40','builds50','builds56','builds57','builds58','builds59','builds60',
|
||||||
|
'jenkins-win-azr-1','jenkins-win-azr-2','jenkins-win-azr-3','jenkins-win-azr-4','jenkins-win-azr-5','jenkins-win-azr-6','jenkins-win-azr-7','jenkins-win-azr-8','jenkins-win-azr-10','jenkins-win-azr-11','jenkins-win-azr-12')
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
conditionalSteps {
|
conditionalSteps {
|
||||||
@ -657,7 +633,7 @@ Unfortunately we often see builds break because of changes/new machines...''')
|
|||||||
runner('DontRun')
|
runner('DontRun')
|
||||||
steps {
|
steps {
|
||||||
shell(
|
shell(
|
||||||
'''which svn || true
|
'''which git || true
|
||||||
which javac
|
which javac
|
||||||
javac -version
|
javac -version
|
||||||
echo '<?xml version="1.0"?><project name="POI Build" default="test"><target name="test"><echo>Using Ant: ${ant.version} from ${ant.home}</echo></target></project>' > build.xml
|
echo '<?xml version="1.0"?><project name="POI Build" default="test"><target name="test"><echo>Using Ant: ${ant.version} from ${ant.home}</echo></target></project>' > build.xml
|
||||||
@ -699,64 +675,3 @@ echo ^<?xml version=^"1.0^"?^>^<project name=^"POI Build^" default=^"test^"^>^<t
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* I tried to put the view into a sub-folder/sub-view, but failed, there are multiple related
|
|
||||||
plugins so this is all a bit confusing :(, see also https://issues.apache.org/jira/browse/INFRA-14002
|
|
||||||
dashboardView("P/POI-new") {
|
|
||||||
columns {
|
|
||||||
status()
|
|
||||||
weather()
|
|
||||||
configureProject()
|
|
||||||
buildButton()
|
|
||||||
cronTrigger()
|
|
||||||
lastBuildConsole()
|
|
||||||
name()
|
|
||||||
lastSuccess()
|
|
||||||
lastFailure()
|
|
||||||
lastDuration()
|
|
||||||
//lastSuccessDescription()
|
|
||||||
jacoco()
|
|
||||||
}
|
|
||||||
description("<table>\n" +
|
|
||||||
" <tr>\n" +
|
|
||||||
" <td><img src=\"https://poi.apache.org/images/project-header.png\" /></td>\n" +
|
|
||||||
" <td> \n" +
|
|
||||||
" <p>Apache POI - the Java API for Microsoft Documents</p>\n" +
|
|
||||||
" <p><b>Most of the POI Jobs are automatically generated by Jenkins Job DSL\n" +
|
|
||||||
" at <a href=\"https://svn.apache.org/repos/asf/poi/trunk/jenkins\">https://svn.apache.org/repos/asf/poi/trunk/jenkins</a>,<br/>\n" +
|
|
||||||
" see <a href=\"https://github.com/jenkinsci/job-dsl-plugin/wiki\">https://github.com/jenkinsci/job-dsl-plugin/wiki</a>\n" +
|
|
||||||
" for more details about the DSL.</b>\n" +
|
|
||||||
" </p>\n" +
|
|
||||||
" <p>\n" +
|
|
||||||
" <b><a href=\"job/POI-DSL-1.8/lastSuccessfulBuild/findbugsResult/\" target=\"_blank\">Findbugs report of latest build</a></b> -\n" +
|
|
||||||
" <b><a href=\"https://sonarcloud.io/dashboard?id=poi-parent\" target=\"_blank\">Sonar reports</a></b> -\n" +
|
|
||||||
" <b><a href=\"job/POI-DSL-1.8/lastSuccessfulBuild/artifact/build/coverage/index.html\" target=\"_blank\">Coverage of latest build</a></b>\n" +
|
|
||||||
" </p>\n" +
|
|
||||||
" </td>\n" +
|
|
||||||
" </tr>\n" +
|
|
||||||
"</table>")
|
|
||||||
filterBuildQueue(false)
|
|
||||||
filterExecutors(false)
|
|
||||||
|
|
||||||
// Job selection
|
|
||||||
jobs {*/
|
|
||||||
//regex(/.*POI.*/)
|
|
||||||
/*}
|
|
||||||
|
|
||||||
// Layout
|
|
||||||
topPortlets {
|
|
||||||
jenkinsJobsList {
|
|
||||||
displayName('POI jobs')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
leftPortlets {
|
|
||||||
testStatisticsChart()
|
|
||||||
}
|
|
||||||
rightPortlets {
|
|
||||||
testTrendChart()
|
|
||||||
}
|
|
||||||
bottomPortlets {
|
|
||||||
testStatisticsGrid()
|
|
||||||
buildStatistics()
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
Apache POI
|
Apache POI
|
||||||
Copyright 2003-2023 The Apache Software Foundation
|
Copyright 2003-2026 The Apache Software Foundation
|
||||||
|
|
||||||
This product includes software developed at
|
This product includes software developed at
|
||||||
The Apache Software Foundation (https://www.apache.org/).
|
The Apache Software Foundation (https://www.apache.org/).
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -21,15 +21,15 @@ The bundle embeds all the jars from lib/main:
|
|||||||
Required to render WMF/EMF images. The OSGi bundle is provided by ServiceMix and available in Maven Central: https://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.batik/1.14_1
|
Required to render WMF/EMF images. The OSGi bundle is provided by ServiceMix and available in Maven Central: https://mvnrepository.com/artifact/org.apache.servicemix.bundles/org.apache.servicemix.bundles.batik/1.14_1
|
||||||
2. Saxon
|
2. Saxon
|
||||||
Required if using as the XSLT and XQuery Processor engine in XML Beans.
|
Required if using as the XSLT and XQuery Processor engine in XML Beans.
|
||||||
Available in Maven Central (but version might be too old): https://mvnrepository.com/artifact/net.sf.saxon/saxon/8.9.0.4-osgi
|
Available in Maven Central: https://mvnrepository.com/artifact/net.sf.saxon/Saxon-HE/12.3
|
||||||
3. Apache XML Security for Java, Bouncy Castle and XML Commons Resolver
|
3. Apache XML Security for Java, Bouncy Castle and XML Commons Resolver
|
||||||
These are required to sign or validate signed Office documents. The OSGi bundles are available in Maven Central:
|
These are required to sign or validate signed Office documents. The OSGi bundles are available in Maven Central:
|
||||||
|
|
||||||
- Apache XML Security for Java: https://mvnrepository.com/artifact/org.apache.santuario/xmlsec/3.0.2 (use v3.0.2 with POI v5.2.3)
|
- Apache XML Security for Java: https://mvnrepository.com/artifact/org.apache.santuario/xmlsec/3.0.6
|
||||||
|
|
||||||
- XML Commons Resolver: https://mvnrepository.com/artifact/xml-resolver/xml-resolver/1.2-osgi
|
- XML Commons Resolver: https://mvnrepository.com/artifact/xml-resolver/xml-resolver/1.2-osgi
|
||||||
|
|
||||||
- Bouncy Castle: https://mvnrepository.com/artifact/org.bouncycastle/bcprov-ext-jdk18on/1.76, https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on/1.76
|
- Bouncy Castle: https://mvnrepository.com/artifact/org.bouncycastle/bcprov-ext-jdk18on/1.82, https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on/1.82
|
||||||
4. PDFBox and PDFBox Graphics2D
|
4. PDFBox and PDFBox Graphics2D
|
||||||
Required to render to PDF documents.
|
Required to render to PDF documents.
|
||||||
The required jars can be downloaded from:
|
The required jars can be downloaded from:
|
||||||
|
|||||||
14
osgi/pom.xml
14
osgi/pom.xml
@ -24,13 +24,13 @@
|
|||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-bundle</artifactId>
|
<artifactId>poi-bundle</artifactId>
|
||||||
<packaging>bundle</packaging>
|
<packaging>bundle</packaging>
|
||||||
<version>5.2.4</version>
|
<version>6.0.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<name>Apache POI OSGi bundle</name>
|
<name>Apache POI OSGi bundle</name>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<poi.version>5.2.4</poi.version>
|
<poi.version>6.0.0-SNAPSHOT</poi.version>
|
||||||
<pax.exam.version>4.12.0</pax.exam.version>
|
<pax.exam.version>4.14.0</pax.exam.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@ -39,8 +39,8 @@
|
|||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.8.0</version>
|
<version>3.8.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.8</source>
|
<source>11</source>
|
||||||
<target>1.8</target>
|
<target>11</target>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -176,7 +176,7 @@
|
|||||||
<groupId>junit</groupId>
|
<groupId>junit</groupId>
|
||||||
<artifactId>junit</artifactId>
|
<artifactId>junit</artifactId>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
<version>4.13.1</version>
|
<version>4.13.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Pax Exam -->
|
<!-- Pax Exam -->
|
||||||
@ -231,7 +231,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j-core</artifactId>
|
<artifactId>log4j-core</artifactId>
|
||||||
<version>2.20.0</version>
|
<version>2.25.3</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|||||||
@ -35,8 +35,6 @@ dependencies {
|
|||||||
implementation project(path: ':poi-scratchpad', configuration: 'archives')
|
implementation project(path: ':poi-scratchpad', configuration: 'archives')
|
||||||
}
|
}
|
||||||
|
|
||||||
implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}"
|
|
||||||
|
|
||||||
testImplementation(project(path: ':poi-ooxml', configuration: 'tests')) {
|
testImplementation(project(path: ':poi-ooxml', configuration: 'tests')) {
|
||||||
if (NO_SCRATCHPAD) {
|
if (NO_SCRATCHPAD) {
|
||||||
exclude group: 'org.apache.poi', module: 'poi-scratchpad'
|
exclude group: 'org.apache.poi', module: 'poi-scratchpad'
|
||||||
@ -49,14 +47,14 @@ final String MODULE_NAME = 'org.apache.poi.examples'
|
|||||||
final Pattern MODULE_REGEX = ~'\\.jar$'
|
final Pattern MODULE_REGEX = ~'\\.jar$'
|
||||||
final List MODULE_COMPILE_PATH = sourceSets.main.compileClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
|
final List MODULE_COMPILE_PATH = sourceSets.main.compileClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
|
||||||
|
|
||||||
task compileJava9(type: JavaCompile) {
|
tasks.register('compileJava9', JavaCompile) {
|
||||||
dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
|
dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
|
||||||
|
|
||||||
javaCompiler = javaToolchains.compilerFor {
|
javaCompiler = javaToolchains.compilerFor {
|
||||||
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
||||||
}
|
}
|
||||||
sourceCompatibility = 1.9
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 1.9
|
targetCompatibility = 11
|
||||||
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
||||||
source = file(JAVA9_SRC)
|
source = file(JAVA9_SRC)
|
||||||
classpath = files()
|
classpath = files()
|
||||||
@ -69,7 +67,7 @@ task compileJava9(type: JavaCompile) {
|
|||||||
jar {
|
jar {
|
||||||
dependsOn compileJava9
|
dependsOn compileJava9
|
||||||
|
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
||||||
|
|||||||
@ -36,7 +36,7 @@ WorkbookFactory.create(f,null,true).withCloseable { workbook ->
|
|||||||
|
|
||||||
def sheet = workbook.getSheetAt(sheetNum)
|
def sheet = workbook.getSheetAt(sheetNum)
|
||||||
sheet.each { row ->
|
sheet.each { row ->
|
||||||
def nonEmptyCells = row.grep { c -> c.getCellType() != Cell.CELL_TYPE_BLANK }
|
def nonEmptyCells = row.grep { c -> c.getCellType() != CellType.BLANK }
|
||||||
println " Row ${row.getRowNum()} has ${nonEmptyCells.size()} non-empty cells:"
|
println " Row ${row.getRowNum()} has ${nonEmptyCells.size()} non-empty cells:"
|
||||||
nonEmptyCells.each { c ->
|
nonEmptyCells.each { c ->
|
||||||
def cRef = [c] as CellReference
|
def cRef = [c] as CellReference
|
||||||
|
|||||||
@ -21,10 +21,11 @@ apply plugin: 'groovy'
|
|||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile 'org.codehaus.groovy:groovy-all:2.4.21'
|
implementation 'org.codehaus.groovy:groovy-all:2.4.21'
|
||||||
compile 'org.apache.poi:poi:5.2.2'
|
implementation 'org.apache.poi:poi:5.3.0'
|
||||||
compile 'org.apache.poi:poi-ooxml:5.2.2'
|
implementation 'org.apache.poi:poi-ooxml:5.3.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Our files are in the current directory
|
// Our files are in the current directory
|
||||||
@ -33,11 +34,11 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run out read demo by default
|
// Run out read demo by default
|
||||||
tasks.withType(JavaExec) {
|
tasks.withType(JavaExec).configureEach {
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
}
|
}
|
||||||
task runScript(type: JavaExec) {
|
tasks.register('runScript', JavaExec) {
|
||||||
mainClass = "SpreadSheetDemo"
|
mainClass = "SpreadSheetDemo"
|
||||||
args = ["../../../test-data/spreadsheet/Simple.xls"]
|
args = ["../../../../test-data/spreadsheet/Simple.xls"]
|
||||||
}
|
}
|
||||||
defaultTasks 'runScript'
|
defaultTasks 'runScript'
|
||||||
|
|||||||
1
poi-examples/src/main/groovy/settings.gradle
Normal file
1
poi-examples/src/main/groovy/settings.gradle
Normal file
@ -0,0 +1 @@
|
|||||||
|
// empty file required to have a standalone build
|
||||||
@ -21,7 +21,7 @@ package org.apache.poi.examples.crypt;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Path;
|
||||||
import java.security.GeneralSecurityException;
|
import java.security.GeneralSecurityException;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
@ -72,7 +72,7 @@ public final class OOXMLPasswordsTry {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Try each password in turn, reporting progress
|
// Try each password in turn, reporting progress
|
||||||
try (Stream<String> lines = Files.lines(Paths.get(words))) {
|
try (Stream<String> lines = Files.lines(Path.of(words))) {
|
||||||
Optional<String> found = lines.filter(counter).filter(w -> isValid(d, w)).findFirst();
|
Optional<String> found = lines.filter(counter).filter(w -> isValid(d, w)).findFirst();
|
||||||
System.out.println(found.map(s -> "Password found: " + s).orElse("Error - No password matched"));
|
System.out.println(found.map(s -> "Password found: " + s).orElse("Error - No password matched"));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -253,6 +253,10 @@ public class XLS2CSVmra implements HSSFListener {
|
|||||||
|
|
||||||
// Format
|
// Format
|
||||||
thisStr = formatListener.formatNumberDateCell(numrec);
|
thisStr = formatListener.formatNumberDateCell(numrec);
|
||||||
|
if (thisStr.contains(",")) {
|
||||||
|
thisStr = '"' + thisStr + '"';
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case RKRecord.sid:
|
case RKRecord.sid:
|
||||||
RKRecord rkrec = (RKRecord) record;
|
RKRecord rkrec = (RKRecord) record;
|
||||||
|
|||||||
@ -23,7 +23,6 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFCell;
|
import org.apache.poi.hssf.usermodel.HSSFCell;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||||
@ -32,6 +31,7 @@ import org.apache.poi.hssf.usermodel.HSSFRichTextString;
|
|||||||
import org.apache.poi.hssf.usermodel.HSSFRow;
|
import org.apache.poi.hssf.usermodel.HSSFRow;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class contains code that demonstrates how to insert plain, numbered
|
* This class contains code that demonstrates how to insert plain, numbered
|
||||||
@ -50,7 +50,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings({"java:S106","java:S4823"})
|
@SuppressWarnings({"java:S106","java:S4823"})
|
||||||
public class InCellLists {
|
public class InCellLists {
|
||||||
private static final Logger LOG = LogManager.getLogger(InCellLists.class);
|
private static final Logger LOG = PoiLogManager.getLogger(InCellLists.class);
|
||||||
|
|
||||||
|
|
||||||
// This character looks like a solid, black, loser case letter 'o'
|
// This character looks like a solid, black, loser case letter 'o'
|
||||||
|
|||||||
@ -22,12 +22,12 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFCell;
|
import org.apache.poi.hssf.usermodel.HSSFCell;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFRow;
|
import org.apache.poi.hssf.usermodel.HSSFRow;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates outlines.
|
* Creates outlines.
|
||||||
@ -35,7 +35,7 @@ import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|||||||
public class Outlines implements Closeable {
|
public class Outlines implements Closeable {
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
throws IOException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
|
throws IOException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
|
||||||
Logger LOGGER = LogManager.getLogger(Outlines.class);
|
Logger LOGGER = PoiLogManager.getLogger(Outlines.class);
|
||||||
for (int i=1; i<=13; i++) {
|
for (int i=1; i<=13; i++) {
|
||||||
try (Outlines o = new Outlines()) {
|
try (Outlines o = new Outlines()) {
|
||||||
String log = (String) Outlines.class.getDeclaredMethod("test" + i).invoke(o);
|
String log = (String) Outlines.class.getDeclaredMethod("test" + i).invoke(o);
|
||||||
|
|||||||
@ -59,7 +59,7 @@ public final class Word2Forrest
|
|||||||
{
|
{
|
||||||
Paragraph p = r.getParagraph (x);
|
Paragraph p = r.getParagraph (x);
|
||||||
String text = p.text ();
|
String text = p.text ();
|
||||||
if (text.trim ().length () == 0)
|
if (text.trim().isEmpty())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ package org.apache.poi.examples.ss;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Path;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||||
@ -95,7 +95,7 @@ public final class ConditionalFormats {
|
|||||||
if (wb instanceof XSSFWorkbook) {
|
if (wb instanceof XSSFWorkbook) {
|
||||||
file += "x";
|
file += "x";
|
||||||
}
|
}
|
||||||
try (OutputStream out = Files.newOutputStream(Paths.get(file))) {
|
try (OutputStream out = Files.newOutputStream(Path.of(file))) {
|
||||||
wb.write(out);
|
wb.write(out);
|
||||||
}
|
}
|
||||||
System.out.println("Generated: " + file);
|
System.out.println("Generated: " + file);
|
||||||
@ -203,7 +203,7 @@ public final class ConditionalFormats {
|
|||||||
if (rn%10 == 0) {
|
if (rn%10 == 0) {
|
||||||
str = str + "x10 ";
|
str = str + "x10 ";
|
||||||
}
|
}
|
||||||
if (str.length() == 0) {
|
if (str.isEmpty()) {
|
||||||
str = "nothing special...";
|
str = "nothing special...";
|
||||||
}
|
}
|
||||||
r.createCell(1).setCellValue("It is " + str);
|
r.createCell(1).setCellValue("It is " + str);
|
||||||
|
|||||||
@ -28,8 +28,8 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
import org.apache.poi.ss.usermodel.Cell;
|
import org.apache.poi.ss.usermodel.Cell;
|
||||||
import org.apache.poi.ss.usermodel.CellType;
|
import org.apache.poi.ss.usermodel.CellType;
|
||||||
import org.apache.poi.ss.usermodel.DataFormatter;
|
import org.apache.poi.ss.usermodel.DataFormatter;
|
||||||
@ -134,7 +134,7 @@ import org.apache.poi.ss.usermodel.WorkbookFactory;
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
|
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
|
||||||
public class ToCSV {
|
public class ToCSV {
|
||||||
private static final Logger LOG = LogManager.getLogger(ToCSV.class);
|
private static final Logger LOG = PoiLogManager.getLogger(ToCSV.class);
|
||||||
|
|
||||||
private Workbook workbook;
|
private Workbook workbook;
|
||||||
private ArrayList<ArrayList<String>> csvData;
|
private ArrayList<ArrayList<String>> csvData;
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import org.apache.poi.util.DefaultTempFileCreationStrategy;
|
|||||||
import org.apache.poi.util.TempFile;
|
import org.apache.poi.util.TempFile;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Path;
|
||||||
|
|
||||||
public final class TempFileUtils {
|
public final class TempFileUtils {
|
||||||
private TempFileUtils() {
|
private TempFileUtils() {
|
||||||
@ -31,7 +31,7 @@ public final class TempFileUtils {
|
|||||||
|
|
||||||
@SuppressWarnings("java:S106")
|
@SuppressWarnings("java:S106")
|
||||||
public static void checkTempFiles() {
|
public static void checkTempFiles() {
|
||||||
File tempDir = Paths.get(System.getProperty(TempFile.JAVA_IO_TMPDIR), DefaultTempFileCreationStrategy.POIFILES).toFile();
|
File tempDir = Path.of(System.getProperty(TempFile.JAVA_IO_TMPDIR), DefaultTempFileCreationStrategy.POIFILES).toFile();
|
||||||
if(tempDir.exists()) {
|
if(tempDir.exists()) {
|
||||||
String[] tempFiles = tempDir.list();
|
String[] tempFiles = tempDir.list();
|
||||||
if(tempFiles != null && tempFiles.length > 0) {
|
if(tempFiles != null && tempFiles.length > 0) {
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ public final class BarChartDemo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try (FileInputStream argIS = new FileInputStream(args[0]);
|
try (FileInputStream argIS = new FileInputStream(args[0]);
|
||||||
BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[1]), StandardCharsets.UTF_8)) {
|
BufferedReader modelReader = Files.newBufferedReader(Path.of(args[1]), StandardCharsets.UTF_8)) {
|
||||||
|
|
||||||
String chartTitle = modelReader.readLine(); // first line is chart title
|
String chartTitle = modelReader.readLine(); // first line is chart title
|
||||||
String seriesText = modelReader.readLine();
|
String seriesText = modelReader.readLine();
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ public final class ChartFromScratch {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try (BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.UTF_8)) {
|
try (BufferedReader modelReader = Files.newBufferedReader(Path.of(args[0]), StandardCharsets.UTF_8)) {
|
||||||
|
|
||||||
String chartTitle = modelReader.readLine(); // first line is chart title
|
String chartTitle = modelReader.readLine(); // first line is chart title
|
||||||
String seriesText = modelReader.readLine();
|
String seriesText = modelReader.readLine();
|
||||||
@ -180,6 +180,10 @@ public final class ChartFromScratch {
|
|||||||
chart.setTitleText(chartTitle);
|
chart.setTitleText(chartTitle);
|
||||||
chart.setTitleOverlay(false);
|
chart.setTitleOverlay(false);
|
||||||
chart.setAutoTitleDeleted(false);
|
chart.setAutoTitleDeleted(false);
|
||||||
|
|
||||||
|
// temporary workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=67510
|
||||||
|
if (bottomAxis.hasNumberFormat()) bottomAxis.setNumberFormat("@");
|
||||||
|
if (leftAxis.hasNumberFormat()) leftAxis.setNumberFormat("#,##0.00");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int COLUMN_LANGUAGES = 0;
|
private static final int COLUMN_LANGUAGES = 0;
|
||||||
|
|||||||
@ -41,7 +41,7 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ public final class DoughnutChartFromScratch {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try (BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.UTF_8)) {
|
try (BufferedReader modelReader = Files.newBufferedReader(Path.of(args[0]), StandardCharsets.UTF_8)) {
|
||||||
|
|
||||||
String chartTitle = modelReader.readLine(); // first line is chart title
|
String chartTitle = modelReader.readLine(); // first line is chart title
|
||||||
String seriesText = modelReader.readLine();
|
String seriesText = modelReader.readLine();
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ public final class PieChartDemo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try (FileInputStream argIS = new FileInputStream(args[0]);
|
try (FileInputStream argIS = new FileInputStream(args[0]);
|
||||||
BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[1]), StandardCharsets.UTF_8)) {
|
BufferedReader modelReader = Files.newBufferedReader(Path.of(args[1]), StandardCharsets.UTF_8)) {
|
||||||
String chartTitle = modelReader.readLine(); // first line is chart title
|
String chartTitle = modelReader.readLine(); // first line is chart title
|
||||||
|
|
||||||
try (XMLSlideShow pptx = new XMLSlideShow(argIS)) {
|
try (XMLSlideShow pptx = new XMLSlideShow(argIS)) {
|
||||||
|
|||||||
@ -136,7 +136,7 @@ public class FromHowTo {
|
|||||||
if(nextIsString && StringUtil.isNotBlank(lastContents)) {
|
if(nextIsString && StringUtil.isNotBlank(lastContents)) {
|
||||||
Integer idx = Integer.valueOf(lastContents);
|
Integer idx = Integer.valueOf(lastContents);
|
||||||
lastContents = lruCache.get(idx);
|
lastContents = lruCache.get(idx);
|
||||||
if (lastContents == null && !lruCache.containsKey(idx)) {
|
if (lastContents == null && !lruCache.containsKey(idx) && sst != null) {
|
||||||
lastContents = sst.getItemAt(idx).getString();
|
lastContents = sst.getItemAt(idx).getString();
|
||||||
lruCache.put(idx, lastContents);
|
lruCache.put(idx, lastContents);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,12 +20,12 @@
|
|||||||
package org.apache.poi.examples.xssf.eventusermodel;
|
package org.apache.poi.examples.xssf.eventusermodel;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.apache.poi.examples.xssf.usermodel.LoadPasswordProtectedXlsx;
|
import org.apache.poi.examples.xssf.usermodel.LoadPasswordProtectedXlsx;
|
||||||
import org.apache.poi.openxml4j.opc.OPCPackage;
|
import org.apache.poi.openxml4j.opc.OPCPackage;
|
||||||
import org.apache.poi.poifs.crypt.temp.AesZipFileZipEntrySource;
|
import org.apache.poi.poifs.crypt.temp.AesZipFileZipEntrySource;
|
||||||
import org.apache.poi.xssf.eventusermodel.XSSFReader;
|
import org.apache.poi.xssf.eventusermodel.XSSFReader;
|
||||||
import org.apache.poi.xssf.eventusermodel.XSSFReader.SheetIterator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An example that loads a password protected workbook and counts the sheets.
|
* An example that loads a password protected workbook and counts the sheets.
|
||||||
@ -48,12 +48,13 @@ public final class LoadPasswordProtectedXlsxStreaming {
|
|||||||
try (AesZipFileZipEntrySource source = AesZipFileZipEntrySource.createZipEntrySource(inputStream);
|
try (AesZipFileZipEntrySource source = AesZipFileZipEntrySource.createZipEntrySource(inputStream);
|
||||||
OPCPackage pkg = OPCPackage.open(source)) {
|
OPCPackage pkg = OPCPackage.open(source)) {
|
||||||
XSSFReader reader = new XSSFReader(pkg);
|
XSSFReader reader = new XSSFReader(pkg);
|
||||||
SheetIterator iter = (SheetIterator)reader.getSheetsData();
|
Iterator<InputStream> iter = reader.getSheetsData();
|
||||||
int count = 0;
|
int count = 0;
|
||||||
while(iter.hasNext()) {
|
while(iter.hasNext()) {
|
||||||
iter.next();
|
try (InputStream stream = iter.next()) {
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
System.out.println("sheet count: " + count);
|
System.out.println("sheet count: " + count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -212,7 +212,7 @@ public class XLSX2CSV {
|
|||||||
styles, null, strings, sheetHandler, formatter, false);
|
styles, null, strings, sheetHandler, formatter, false);
|
||||||
sheetParser.setContentHandler(handler);
|
sheetParser.setContentHandler(handler);
|
||||||
sheetParser.parse(sheetSource);
|
sheetParser.parse(sheetSource);
|
||||||
} catch(ParserConfigurationException e) {
|
} catch (ParserConfigurationException e) {
|
||||||
throw new RuntimeException("SAX parser appears to be broken - " + e.getMessage());
|
throw new RuntimeException("SAX parser appears to be broken - " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,7 +234,12 @@ public class XLSX2CSV {
|
|||||||
String sheetName = iter.getSheetName();
|
String sheetName = iter.getSheetName();
|
||||||
this.output.println();
|
this.output.println();
|
||||||
this.output.println(sheetName + " [index=" + index + "]:");
|
this.output.println(sheetName + " [index=" + index + "]:");
|
||||||
|
|
||||||
|
try {
|
||||||
processSheet(styles, strings, new SheetToCSV(), stream);
|
processSheet(styles, strings, new SheetToCSV(), stream);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
throw new IOException("Failed to parse sheet " + sheetName, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,12 +53,13 @@ public class DeferredGeneration {
|
|||||||
|
|
||||||
try (FileOutputStream fileOut = new FileOutputStream("DeferredGeneration.xlsx")) {
|
try (FileOutputStream fileOut = new FileOutputStream("DeferredGeneration.xlsx")) {
|
||||||
wb.write(fileOut);
|
wb.write(fileOut);
|
||||||
//writeAvoidingTempFiles was added as an experimental change in POI 5.1.0
|
// writeAvoidingTempFiles was added as an experimental change in POI 5.1.0
|
||||||
//wb.writeAvoidingTempFiles(fileOut);
|
// wb.writeAvoidingTempFiles(fileOut);
|
||||||
} finally {
|
|
||||||
//the dispose call is necessary to ensure temp files are removed
|
|
||||||
wb.dispose();
|
|
||||||
}
|
}
|
||||||
|
// finally {
|
||||||
|
// the dispose call is no longer necessary to ensure temp files are removed
|
||||||
|
// wb.dispose();
|
||||||
|
// }
|
||||||
System.out.println("wrote DeferredGeneration.xlsx");
|
System.out.println("wrote DeferredGeneration.xlsx");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,10 +46,11 @@ public class Outlining {
|
|||||||
|
|
||||||
try (FileOutputStream fileOut = new FileOutputStream("outlining_collapsed.xlsx")) {
|
try (FileOutputStream fileOut = new FileOutputStream("outlining_collapsed.xlsx")) {
|
||||||
wb2.write(fileOut);
|
wb2.write(fileOut);
|
||||||
} finally {
|
|
||||||
//the dispose call is necessary to ensure temp files are removed
|
|
||||||
wb2.dispose();
|
|
||||||
}
|
}
|
||||||
|
// finally {
|
||||||
|
// the dispose call is no longer necessary to ensure temp files are removed
|
||||||
|
// wb2.dispose();
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,8 +58,7 @@ public final class SavePasswordProtectedXlsx {
|
|||||||
TempFileUtils.checkTempFiles();
|
TempFileUtils.checkTempFiles();
|
||||||
String filename = args[0];
|
String filename = args[0];
|
||||||
String password = args[1];
|
String password = args[1];
|
||||||
SXSSFWorkbookWithCustomZipEntrySource wb = new SXSSFWorkbookWithCustomZipEntrySource();
|
try (SXSSFWorkbookWithCustomZipEntrySource wb = new SXSSFWorkbookWithCustomZipEntrySource()) {
|
||||||
try {
|
|
||||||
for(int i = 0; i < 10; i++) {
|
for(int i = 0; i < 10; i++) {
|
||||||
SXSSFSheet sheet = wb.createSheet("Sheet" + i);
|
SXSSFSheet sheet = wb.createSheet("Sheet" + i);
|
||||||
for(int r = 0; r < 1000; r++) {
|
for(int r = 0; r < 1000; r++) {
|
||||||
@ -78,10 +77,6 @@ public final class SavePasswordProtectedXlsx {
|
|||||||
} finally {
|
} finally {
|
||||||
tempData.dispose();
|
tempData.dispose();
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
wb.close();
|
|
||||||
//the dispose call is necessary to ensure temp files are removed
|
|
||||||
wb.dispose();
|
|
||||||
}
|
}
|
||||||
TempFileUtils.checkTempFiles();
|
TempFileUtils.checkTempFiles();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,6 +104,10 @@ public final class BarChart {
|
|||||||
solidFillSeries(data, 0, PresetColor.CHARTREUSE);
|
solidFillSeries(data, 0, PresetColor.CHARTREUSE);
|
||||||
solidFillSeries(data, 1, PresetColor.TURQUOISE);
|
solidFillSeries(data, 1, PresetColor.TURQUOISE);
|
||||||
|
|
||||||
|
// temporary workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=67510
|
||||||
|
if (bottomAxis.hasNumberFormat()) bottomAxis.setNumberFormat("@");
|
||||||
|
if (leftAxis.hasNumberFormat()) leftAxis.setNumberFormat("#,##0.00");
|
||||||
|
|
||||||
// Write the output to a file
|
// Write the output to a file
|
||||||
try (FileOutputStream fileOut = new FileOutputStream("ooxml-bar-chart.xlsx")) {
|
try (FileOutputStream fileOut = new FileOutputStream("ooxml-bar-chart.xlsx")) {
|
||||||
wb.write(fileOut);
|
wb.write(fileOut);
|
||||||
|
|||||||
@ -35,8 +35,8 @@ import java.util.Random;
|
|||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
|
||||||
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
|
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
|
||||||
import org.apache.commons.compress.archivers.zip.ZipFile;
|
import org.apache.commons.compress.archivers.zip.ZipFile;
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
import org.apache.poi.openxml4j.opc.internal.ZipHelper;
|
import org.apache.poi.openxml4j.opc.internal.ZipHelper;
|
||||||
import org.apache.poi.ss.usermodel.DateUtil;
|
import org.apache.poi.ss.usermodel.DateUtil;
|
||||||
import org.apache.poi.ss.usermodel.FillPatternType;
|
import org.apache.poi.ss.usermodel.FillPatternType;
|
||||||
@ -77,7 +77,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|||||||
* See <a href="https://poi.apache.org/spreadsheet/how-to.html#sxssf">SXSSF (Streaming Usermodel API)</a>.
|
* See <a href="https://poi.apache.org/spreadsheet/how-to.html#sxssf">SXSSF (Streaming Usermodel API)</a>.
|
||||||
*/
|
*/
|
||||||
public final class BigGridDemo {
|
public final class BigGridDemo {
|
||||||
private static final Logger LOG = LogManager.getLogger(BigGridDemo.class);
|
private static final Logger LOG = PoiLogManager.getLogger(BigGridDemo.class);
|
||||||
|
|
||||||
private static final Random rnd = new Random();
|
private static final Random rnd = new Random();
|
||||||
|
|
||||||
|
|||||||
@ -105,6 +105,10 @@ public final class LineChart {
|
|||||||
solidLineSeries(data, 0, PresetColor.CHARTREUSE);
|
solidLineSeries(data, 0, PresetColor.CHARTREUSE);
|
||||||
solidLineSeries(data, 1, PresetColor.TURQUOISE);
|
solidLineSeries(data, 1, PresetColor.TURQUOISE);
|
||||||
|
|
||||||
|
// temporary workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=67510
|
||||||
|
if (bottomAxis.hasNumberFormat()) bottomAxis.setNumberFormat("@");
|
||||||
|
if (leftAxis.hasNumberFormat()) leftAxis.setNumberFormat("#,##0.00");
|
||||||
|
|
||||||
// Write the output to a file
|
// Write the output to a file
|
||||||
try (FileOutputStream fileOut = new FileOutputStream("ooxml-line-chart.xlsx")) {
|
try (FileOutputStream fileOut = new FileOutputStream("ooxml-line-chart.xlsx")) {
|
||||||
wb.write(fileOut);
|
wb.write(fileOut);
|
||||||
|
|||||||
@ -99,6 +99,10 @@ public final class ScatterChart {
|
|||||||
solidLineSeries(data, 0, PresetColor.CHARTREUSE);
|
solidLineSeries(data, 0, PresetColor.CHARTREUSE);
|
||||||
solidLineSeries(data, 1, PresetColor.TURQUOISE);
|
solidLineSeries(data, 1, PresetColor.TURQUOISE);
|
||||||
|
|
||||||
|
// temporary workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=67510
|
||||||
|
if (bottomAxis.hasNumberFormat()) bottomAxis.setNumberFormat("@");
|
||||||
|
if (leftAxis.hasNumberFormat()) leftAxis.setNumberFormat("#,##0.00");
|
||||||
|
|
||||||
// Write the output to a file
|
// Write the output to a file
|
||||||
try (FileOutputStream fileOut = new FileOutputStream("ooxml-scatter-chart.xlsx")) {
|
try (FileOutputStream fileOut = new FileOutputStream("ooxml-scatter-chart.xlsx")) {
|
||||||
wb.write(fileOut);
|
wb.write(fileOut);
|
||||||
|
|||||||
@ -26,7 +26,7 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ public final class BarChartExample {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try (FileInputStream argIS = new FileInputStream(args[0]);
|
try (FileInputStream argIS = new FileInputStream(args[0]);
|
||||||
BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[1]), StandardCharsets.UTF_8)) {
|
BufferedReader modelReader = Files.newBufferedReader(Path.of(args[1]), StandardCharsets.UTF_8)) {
|
||||||
|
|
||||||
String chartTitle = modelReader.readLine(); // first line is chart title
|
String chartTitle = modelReader.readLine(); // first line is chart title
|
||||||
String seriesText = modelReader.readLine();
|
String seriesText = modelReader.readLine();
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ public final class ChartFromScratch {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try (BufferedReader modelReader = Files.newBufferedReader(Paths.get(args[0]), StandardCharsets.UTF_8)) {
|
try (BufferedReader modelReader = Files.newBufferedReader(Path.of(args[0]), StandardCharsets.UTF_8)) {
|
||||||
|
|
||||||
String chartTitle = modelReader.readLine(); // first line is chart title
|
String chartTitle = modelReader.readLine(); // first line is chart title
|
||||||
String seriesText = modelReader.readLine();
|
String seriesText = modelReader.readLine();
|
||||||
@ -146,6 +146,10 @@ public final class ChartFromScratch {
|
|||||||
chart.setTitleText(chartTitle);
|
chart.setTitleText(chartTitle);
|
||||||
chart.setTitleOverlay(false);
|
chart.setTitleOverlay(false);
|
||||||
chart.setAutoTitleDeleted(false);
|
chart.setAutoTitleDeleted(false);
|
||||||
|
|
||||||
|
// temporary workaround for https://bz.apache.org/bugzilla/show_bug.cgi?id=67510
|
||||||
|
if (bottomAxis.hasNumberFormat()) bottomAxis.setNumberFormat("@");
|
||||||
|
if (leftAxis.hasNumberFormat()) leftAxis.setNumberFormat("#,##0.00");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int COLUMN_LANGUAGES = 0;
|
private static final int COLUMN_LANGUAGES = 0;
|
||||||
|
|||||||
@ -22,10 +22,10 @@ import java.io.FileInputStream;
|
|||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.apache.poi.common.usermodel.PictureType;
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||||
import org.apache.poi.util.Units;
|
import org.apache.poi.util.Units;
|
||||||
import org.apache.poi.xwpf.usermodel.BreakType;
|
import org.apache.poi.xwpf.usermodel.BreakType;
|
||||||
import org.apache.poi.xwpf.usermodel.Document;
|
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFRun;
|
import org.apache.poi.xwpf.usermodel.XWPFRun;
|
||||||
@ -45,30 +45,30 @@ public final class SimpleImages {
|
|||||||
XWPFRun r = p.createRun();
|
XWPFRun r = p.createRun();
|
||||||
|
|
||||||
for (String imgFile : args) {
|
for (String imgFile : args) {
|
||||||
int format;
|
PictureType format;
|
||||||
|
|
||||||
if (imgFile.endsWith(".emf")) {
|
if (imgFile.endsWith(".emf")) {
|
||||||
format = Document.PICTURE_TYPE_EMF;
|
format = PictureType.EMF;
|
||||||
} else if (imgFile.endsWith(".wmf")) {
|
} else if (imgFile.endsWith(".wmf")) {
|
||||||
format = Document.PICTURE_TYPE_WMF;
|
format = PictureType.WMF;
|
||||||
} else if (imgFile.endsWith(".pict")) {
|
} else if (imgFile.endsWith(".pict")) {
|
||||||
format = Document.PICTURE_TYPE_PICT;
|
format = PictureType.PICT;
|
||||||
} else if (imgFile.endsWith(".jpeg") || imgFile.endsWith(".jpg")) {
|
} else if (imgFile.endsWith(".jpeg") || imgFile.endsWith(".jpg")) {
|
||||||
format = Document.PICTURE_TYPE_JPEG;
|
format = PictureType.JPEG;
|
||||||
} else if (imgFile.endsWith(".png")) {
|
} else if (imgFile.endsWith(".png")) {
|
||||||
format = Document.PICTURE_TYPE_PNG;
|
format = PictureType.PNG;
|
||||||
} else if (imgFile.endsWith(".dib")) {
|
} else if (imgFile.endsWith(".dib")) {
|
||||||
format = Document.PICTURE_TYPE_DIB;
|
format = PictureType.DIB;
|
||||||
} else if (imgFile.endsWith(".gif")) {
|
} else if (imgFile.endsWith(".gif")) {
|
||||||
format = Document.PICTURE_TYPE_GIF;
|
format = PictureType.GIF;
|
||||||
} else if (imgFile.endsWith(".tiff")) {
|
} else if (imgFile.endsWith(".tiff")) {
|
||||||
format = Document.PICTURE_TYPE_TIFF;
|
format = PictureType.TIFF;
|
||||||
} else if (imgFile.endsWith(".eps")) {
|
} else if (imgFile.endsWith(".eps")) {
|
||||||
format = Document.PICTURE_TYPE_EPS;
|
format = PictureType.EPS;
|
||||||
} else if (imgFile.endsWith(".bmp")) {
|
} else if (imgFile.endsWith(".bmp")) {
|
||||||
format = Document.PICTURE_TYPE_BMP;
|
format = PictureType.BMP;
|
||||||
} else if (imgFile.endsWith(".wpg")) {
|
} else if (imgFile.endsWith(".wpg")) {
|
||||||
format = Document.PICTURE_TYPE_WPG;
|
format = PictureType.WPG;
|
||||||
} else {
|
} else {
|
||||||
System.err.println("Unsupported picture: " + imgFile +
|
System.err.println("Unsupported picture: " + imgFile +
|
||||||
". Expected emf|wmf|pict|jpeg|png|dib|gif|tiff|eps|bmp|wpg");
|
". Expected emf|wmf|pict|jpeg|png|dib|gif|tiff|eps|bmp|wpg");
|
||||||
|
|||||||
@ -44,7 +44,7 @@ import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
|||||||
* SpreadsheetML workbook embedded into the document.<p>
|
* SpreadsheetML workbook embedded into the document.<p>
|
||||||
*
|
*
|
||||||
* This code was successfully tested with the following file from the POI test collection:
|
* This code was successfully tested with the following file from the POI test collection:
|
||||||
* http://svn.apache.org/repos/asf/poi/trunk/test-data/document/EmbeddedDocument.docx
|
* test-data/document/EmbeddedDocument.docx
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
|
@SuppressWarnings({"java:S106","java:S4823","java:S1192"})
|
||||||
public class UpdateEmbeddedDoc {
|
public class UpdateEmbeddedDoc {
|
||||||
|
|||||||
@ -0,0 +1,115 @@
|
|||||||
|
/* ====================================================================
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
this work for additional information regarding copyright ownership.
|
||||||
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
(the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
==================================================================== */
|
||||||
|
|
||||||
|
package org.apache.poi.examples.hssf.eventusermodel;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
import org.apache.poi.hssf.HSSFTestDataSamples;
|
||||||
|
import org.apache.poi.hssf.record.NumberRecord;
|
||||||
|
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
class TestXLS2CSVmra {
|
||||||
|
@Test
|
||||||
|
void test() throws Exception {
|
||||||
|
XLS2CSVmra.main(new String[] { HSSFTestDataSamples.getSampleFile("SampleSS.xls").getAbsolutePath() });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testWithMinCols() throws Exception {
|
||||||
|
XLS2CSVmra.main(new String[] { HSSFTestDataSamples.getSampleFile("SampleSS.xls").getAbsolutePath(), "100" });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testProcess() throws IOException {
|
||||||
|
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
|
||||||
|
PrintStream out = new PrintStream(outStream, false, StandardCharsets.UTF_8.name());
|
||||||
|
XLS2CSVmra cvs = new XLS2CSVmra(
|
||||||
|
new POIFSFileSystem(new FileInputStream(HSSFTestDataSamples.getSampleFile("SampleSS.xls").getAbsolutePath())),
|
||||||
|
out, -1);
|
||||||
|
|
||||||
|
cvs.process();
|
||||||
|
|
||||||
|
outStream.flush();
|
||||||
|
|
||||||
|
assertEquals(sanitize("\n"
|
||||||
|
+ "First Sheet [1]:\n"
|
||||||
|
+ "\"Test spreadsheet\"\n"
|
||||||
|
+ "\"2nd row\",\"2nd row 2nd column\"\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "\"This one is red\"\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "Sheet Number 2 [2]:\n"
|
||||||
|
+ "\"Start of 2nd sheet\"\n"
|
||||||
|
+ "\"Sheet 2 row 2\"\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "\"I'm in bold blue, on a yellow background\"\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "\"cb=1\",\"cb=10\",\"cb=2\",\"cb=sum\"\n"
|
||||||
|
+ "1,10,2,13\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "Sheet3 [3]:\n"), sanitize(new String(outStream.toByteArray(), StandardCharsets.UTF_8)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testProcessNumberRecord() throws IOException {
|
||||||
|
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
|
||||||
|
PrintStream out = new PrintStream(outStream, false, StandardCharsets.UTF_8.name());
|
||||||
|
XLS2CSVmra cvs = new XLS2CSVmra(
|
||||||
|
new POIFSFileSystem(new FileInputStream(HSSFTestDataSamples.getSampleFile("empty.xls").getAbsolutePath())),
|
||||||
|
out, -1);
|
||||||
|
|
||||||
|
// need to call process() first to initialize members
|
||||||
|
cvs.process();
|
||||||
|
|
||||||
|
outStream.flush();
|
||||||
|
|
||||||
|
assertEquals(sanitize("\n"
|
||||||
|
+ "Лист1 [1]:\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "Лист2 [2]:\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "Лист3 [3]:\n"), sanitize(new String(outStream.toByteArray(), StandardCharsets.UTF_8)));
|
||||||
|
|
||||||
|
|
||||||
|
NumberRecord record = new NumberRecord();
|
||||||
|
record.setValue(1.243);
|
||||||
|
|
||||||
|
cvs.processRecord(record);
|
||||||
|
|
||||||
|
outStream.flush();
|
||||||
|
|
||||||
|
assertEquals(sanitize("\n"
|
||||||
|
+ "Лист1 [1]:\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "Лист2 [2]:\n"
|
||||||
|
+ "\n"
|
||||||
|
+ "Лист3 [3]:\n"
|
||||||
|
+ "1.243"), sanitize(new String(outStream.toByteArray(), StandardCharsets.UTF_8)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String sanitize(String str) {
|
||||||
|
return str.replace("\r\n", "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -18,9 +18,11 @@
|
|||||||
package org.apache.poi.integration;
|
package org.apache.poi.integration;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
@ -33,8 +35,11 @@ import org.apache.poi.openxml4j.opc.PackageAccess;
|
|||||||
import org.apache.poi.xssf.XSSFTestDataSamples;
|
import org.apache.poi.xssf.XSSFTestDataSamples;
|
||||||
import org.junit.jupiter.api.AfterEach;
|
import org.junit.jupiter.api.AfterEach;
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
import org.junit.jupiter.api.Disabled;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
import net.bytebuddy.utility.RandomString;
|
||||||
|
|
||||||
public class TestXLSX2CSV {
|
public class TestXLSX2CSV {
|
||||||
private PrintStream err;
|
private PrintStream err;
|
||||||
private final UnsynchronizedByteArrayOutputStream errorBytes = UnsynchronizedByteArrayOutputStream.builder().get();
|
private final UnsynchronizedByteArrayOutputStream errorBytes = UnsynchronizedByteArrayOutputStream.builder().get();
|
||||||
@ -133,4 +138,84 @@ public class TestXLSX2CSV {
|
|||||||
assertTrue(output.contains("\"Lorem\",111,,,"), "Had: " + output);
|
assertTrue(output.contains("\"Lorem\",111,,,"), "Had: " + output);
|
||||||
assertTrue(output.contains(",\"hello, xssf\",,\"hello, xssf\","), "Had: " + output);
|
assertTrue(output.contains(",\"hello, xssf\",,\"hello, xssf\","), "Had: " + output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Disabled("Used for local micro-benchmarking")
|
||||||
|
@Test
|
||||||
|
public void microBenchmark() {
|
||||||
|
checkReplace("str");
|
||||||
|
checkReplace("str.123");
|
||||||
|
checkReplace("str.123,");
|
||||||
|
checkReplace("str,,,.123,,,,");
|
||||||
|
for (int i = 0; i < 1000;i++) {
|
||||||
|
checkReplace(RandomString.make(20));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0;i < 10;i++) {
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
String str = RandomString.make(100) + "\"\"" + RandomString.make(100) + "\"\"" + RandomString.make(100);
|
||||||
|
String expected = str.replace("\"", "\"\"");
|
||||||
|
for (int j = 0;j < 300000;j++) {
|
||||||
|
//assertEquals(expected, replaceString(str, "\"", "\"\""));
|
||||||
|
assertEquals(expected, replaceDirect(str, "\"", "\"\""));
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println(" , " + (System.currentTimeMillis() - start));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Java 8: replaceString: 1001, 921, 1264, 1019, 1258, 990, 1089, 1430, 1153, 907
|
||||||
|
// Java 8: replaceDirect: 375, 282, 240, 246, 264, 271, 258, 250, 263, 259
|
||||||
|
// Java 11: replaceString: 510, 218, 202, 205, 202, 198, 202, 198, 208, 201
|
||||||
|
// Java 11: replaceDirect: 384, 228, 204, 201, 201, 200, 206, 196, 200, 200
|
||||||
|
//
|
||||||
|
// => On Java 8, a custom implementation would make sense, however on Java 9
|
||||||
|
// String.replace() was optimized so that it does not make any difference
|
||||||
|
// anymore!
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkReplace(String orig) {
|
||||||
|
assertEquals(replaceString(orig, ",", "."), replaceDirect(orig, ",", "."),
|
||||||
|
"Did have a difference with " + orig);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String replaceString(String originalStr, String oldStr, String newStr) {
|
||||||
|
return originalStr.replace(oldStr, newStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String replaceDirect(String originalStr, String oldStr, String newStr) {
|
||||||
|
int p = originalStr.indexOf(oldStr);
|
||||||
|
if (p == -1) {
|
||||||
|
return originalStr;
|
||||||
|
} else {
|
||||||
|
StringBuilder result = new StringBuilder();
|
||||||
|
result.append(originalStr, 0, p);
|
||||||
|
result.append(newStr);
|
||||||
|
int q = p + oldStr.length();
|
||||||
|
while ((p = originalStr.indexOf(oldStr, q)) != -1) {
|
||||||
|
result.append(originalStr, q, p);
|
||||||
|
result.append(newStr);
|
||||||
|
q = p + oldStr.length();
|
||||||
|
}
|
||||||
|
result.append(originalStr, q, originalStr.length());
|
||||||
|
return result.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDeepFile() {
|
||||||
|
// returns with some System.err
|
||||||
|
try {
|
||||||
|
assertThrows(IOException.class,
|
||||||
|
() -> XLSX2CSV.main(new String[] { XSSFTestDataSamples.getSampleFile("deep-data.xlsx").getAbsolutePath() }));
|
||||||
|
} catch (Throwable e) {
|
||||||
|
// restore output-streams again to get proper error output
|
||||||
|
System.setErr(err);
|
||||||
|
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
String output = errorBytes.toString(StandardCharsets.UTF_8);
|
||||||
|
assertFalse(output.contains("Not found"), "Had: " + output);
|
||||||
|
|
||||||
|
System.out.println(output);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,7 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api 'org.apache.ant:ant:1.10.14'
|
api 'org.apache.ant:ant:1.10.15'
|
||||||
|
|
||||||
api project(':poi-ooxml')
|
api project(':poi-ooxml')
|
||||||
compileOnly project(path: ':poi-ooxml', configuration: 'archives')
|
compileOnly project(path: ':poi-ooxml', configuration: 'archives')
|
||||||
@ -41,9 +41,9 @@ dependencies {
|
|||||||
testImplementation(project(path: ':poi-ooxml', configuration: 'tests')) {
|
testImplementation(project(path: ':poi-ooxml', configuration: 'tests')) {
|
||||||
exclude group: 'org.apache.poi', module: 'poi-scratchpad'
|
exclude group: 'org.apache.poi', module: 'poi-scratchpad'
|
||||||
}
|
}
|
||||||
testImplementation 'com.google.guava:guava:32.1.1-jre'
|
testImplementation 'com.google.guava:guava:33.5.0-jre'
|
||||||
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
|
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
|
||||||
testImplementation 'org.slf4j:slf4j-simple:2.0.9'
|
testImplementation 'org.slf4j:slf4j-simple:2.0.17'
|
||||||
testRuntimeOnly "org.apiguardian:apiguardian-api:${apiGuardianVersion}"
|
testRuntimeOnly "org.apiguardian:apiguardian-api:${apiGuardianVersion}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,14 +57,14 @@ final String OOXML_LITE_AGENT = "../build/dist/maven/poi-ooxml-lite-agent/poi-oo
|
|||||||
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
|
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
|
||||||
final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
|
final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
|
||||||
|
|
||||||
task compileJava9(type: JavaCompile) {
|
tasks.register('compileJava9', JavaCompile) {
|
||||||
dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
|
dependsOn 'compileJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
|
||||||
|
|
||||||
javaCompiler = javaToolchains.compilerFor {
|
javaCompiler = javaToolchains.compilerFor {
|
||||||
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
||||||
}
|
}
|
||||||
sourceCompatibility = 1.9
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 1.9
|
targetCompatibility = 11
|
||||||
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
||||||
source = file(JAVA9_SRC)
|
source = file(JAVA9_SRC)
|
||||||
classpath = files()
|
classpath = files()
|
||||||
@ -74,14 +74,14 @@ task compileJava9(type: JavaCompile) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
task compileTest9(type: JavaCompile) {
|
tasks.register('compileTest9', JavaCompile) {
|
||||||
dependsOn 'compileTestJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
|
dependsOn 'compileTestJava', ':poi-ooxml:jar', ':poi-scratchpad:jar'
|
||||||
|
|
||||||
javaCompiler = javaToolchains.compilerFor {
|
javaCompiler = javaToolchains.compilerFor {
|
||||||
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
||||||
}
|
}
|
||||||
sourceCompatibility = 1.9
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 1.9
|
targetCompatibility = 11
|
||||||
destinationDirectory = file(TEST9_OUT + VERSIONS9)
|
destinationDirectory = file(TEST9_OUT + VERSIONS9)
|
||||||
source = file(TEST9_SRC)
|
source = file(TEST9_SRC)
|
||||||
options.compilerArgs = [
|
options.compilerArgs = [
|
||||||
@ -95,7 +95,7 @@ task compileTest9(type: JavaCompile) {
|
|||||||
jar {
|
jar {
|
||||||
dependsOn compileJava9
|
dependsOn compileJava9
|
||||||
|
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
||||||
@ -119,11 +119,11 @@ sourcesJar {
|
|||||||
// Create a separate jar for test-code to depend on it in other projects
|
// Create a separate jar for test-code to depend on it in other projects
|
||||||
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
||||||
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ] ) {
|
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ] ) {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
|
||||||
|
|
||||||
setArchiveClassifier 'tests'
|
setArchiveClassifier 'tests'
|
||||||
// ignore second module-info.class from main
|
// ignore second module-info.class from main
|
||||||
duplicatesStrategy = 'exclude'
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
|
||||||
from sourceSets.test.output + sourceSets.main.output
|
from sourceSets.test.output + sourceSets.main.output
|
||||||
|
|
||||||
@ -142,14 +142,10 @@ test {
|
|||||||
doFirst {
|
doFirst {
|
||||||
jvmArgs += [
|
jvmArgs += [
|
||||||
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
|
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
|
||||||
]
|
|
||||||
if (jdkVersion > 8) {
|
|
||||||
jvmArgs += [
|
|
||||||
'--add-modules', MODULE_NAME,
|
'--add-modules', MODULE_NAME,
|
||||||
'--module-path', '../build/dist/maven/poi-excelant-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
|
'--module-path', '../build/dist/maven/poi-excelant-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
|
|||||||
@ -27,7 +27,7 @@ import java.util.Map;
|
|||||||
*/
|
*/
|
||||||
public final class ExcelAntWorkbookUtilFactory {
|
public final class ExcelAntWorkbookUtilFactory {
|
||||||
|
|
||||||
private static Map<String, ExcelAntWorkbookUtil> workbookUtilMap;
|
private static final Map<String, ExcelAntWorkbookUtil> workbookUtilMap = new HashMap<>();
|
||||||
|
|
||||||
private ExcelAntWorkbookUtilFactory() {
|
private ExcelAntWorkbookUtilFactory() {
|
||||||
}
|
}
|
||||||
@ -41,10 +41,7 @@ public final class ExcelAntWorkbookUtilFactory {
|
|||||||
* a freshly instantiated one if none did exist before.
|
* a freshly instantiated one if none did exist before.
|
||||||
*/
|
*/
|
||||||
public static ExcelAntWorkbookUtil getInstance(String fileName) {
|
public static ExcelAntWorkbookUtil getInstance(String fileName) {
|
||||||
if(workbookUtilMap == null) {
|
synchronized (workbookUtilMap) {
|
||||||
workbookUtilMap = new HashMap<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(workbookUtilMap.containsKey(fileName)) {
|
if(workbookUtilMap.containsKey(fileName)) {
|
||||||
return workbookUtilMap.get(fileName);
|
return workbookUtilMap.get(fileName);
|
||||||
}
|
}
|
||||||
@ -53,4 +50,5 @@ public final class ExcelAntWorkbookUtilFactory {
|
|||||||
workbookUtilMap.put(fileName, wbu);
|
workbookUtilMap.put(fileName, wbu);
|
||||||
return wbu;
|
return wbu;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
module org.apache.poi.excelant {
|
module org.apache.poi.excelant {
|
||||||
|
|
||||||
requires ant;
|
requires ant;
|
||||||
|
requires transitive org.apache.poi.poi;
|
||||||
requires org.apache.poi.ooxml;
|
requires org.apache.poi.ooxml;
|
||||||
|
|
||||||
exports org.apache.poi.ss.excelant;
|
exports org.apache.poi.ss.excelant;
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
import java.util.regex.Pattern
|
|
||||||
|
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -17,8 +15,10 @@ import java.util.regex.Pattern
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==================================================================== */
|
==================================================================== */
|
||||||
|
|
||||||
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
final String TEST9_SRC = 'src/test/java9'
|
final String TEST9_SRC = 'src/test/java9'
|
||||||
final String TEST9_OUT = "${buildDir}/classes/java9/test/"
|
final String TEST9_OUT = layout.buildDirectory.dir('classes/java9/test/').get().asFile.absolutePath
|
||||||
final String VERSIONS9 = 'META-INF/versions/9'
|
final String VERSIONS9 = 'META-INF/versions/9'
|
||||||
final boolean IBMVM = System.getProperty("java.vendor").contains("IBM")
|
final boolean IBMVM = System.getProperty("java.vendor").contains("IBM")
|
||||||
|
|
||||||
@ -39,9 +39,9 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testImplementation 'org.apache.ant:ant:1.10.14'
|
testImplementation 'org.apache.ant:ant:1.10.15'
|
||||||
testImplementation 'org.apache.commons:commons-collections4:4.4'
|
testImplementation 'org.apache.commons:commons-collections4:4.5.0'
|
||||||
testImplementation 'com.google.guava:guava:32.1.1-jre'
|
testImplementation 'com.google.guava:guava:33.5.0-jre'
|
||||||
|
|
||||||
misc(project(':poi-ooxml')) {
|
misc(project(':poi-ooxml')) {
|
||||||
capabilities {
|
capabilities {
|
||||||
@ -76,7 +76,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
testImplementation project(path: ':poi-ooxml-lite-agent', configuration: 'archives')
|
testImplementation project(path: ':poi-ooxml-lite-agent', configuration: 'archives')
|
||||||
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
|
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
|
||||||
testImplementation 'org.slf4j:slf4j-simple:2.0.9'
|
testImplementation 'org.slf4j:slf4j-simple:2.0.17'
|
||||||
testRuntimeOnly "org.apiguardian:apiguardian-api:${apiGuardianVersion}"
|
testRuntimeOnly "org.apiguardian:apiguardian-api:${apiGuardianVersion}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,14 +90,14 @@ final String OOXML_LITE_AGENT = "../build/dist/maven/poi-ooxml-lite-agent/poi-oo
|
|||||||
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
|
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
|
||||||
final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
|
final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
|
||||||
|
|
||||||
task compileTest9(type: JavaCompile) {
|
tasks.register('compileTest9', JavaCompile) {
|
||||||
dependsOn 'compileTestJava', ':poi-ooxml:testJar', ':poi-scratchpad:testJar', ':poi-examples:jar'
|
dependsOn 'compileTestJava', ':poi-ooxml:testJar', ':poi-scratchpad:testJar', ':poi-examples:jar'
|
||||||
|
|
||||||
javaCompiler = javaToolchains.compilerFor {
|
javaCompiler = javaToolchains.compilerFor {
|
||||||
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
||||||
}
|
}
|
||||||
sourceCompatibility = 1.9
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 1.9
|
targetCompatibility = 11
|
||||||
destinationDirectory = file(TEST9_OUT + VERSIONS9)
|
destinationDirectory = file(TEST9_OUT + VERSIONS9)
|
||||||
source = file(TEST9_SRC)
|
source = file(TEST9_SRC)
|
||||||
options.compilerArgs = [
|
options.compilerArgs = [
|
||||||
@ -109,7 +109,7 @@ task compileTest9(type: JavaCompile) {
|
|||||||
|
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
||||||
@ -119,11 +119,11 @@ jar {
|
|||||||
// Create a separate jar for test-code to depend on it in other projects
|
// Create a separate jar for test-code to depend on it in other projects
|
||||||
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
||||||
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ] ) {
|
task testJar(type: Jar, dependsOn: [ testClasses, compileTest9 ] ) {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
|
||||||
|
|
||||||
setArchiveClassifier 'tests'
|
setArchiveClassifier 'tests'
|
||||||
// ignore second module-info.class from main
|
// ignore second module-info.class from main
|
||||||
duplicatesStrategy = 'exclude'
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
|
||||||
from sourceSets.test.output + sourceSets.main.output
|
from sourceSets.test.output + sourceSets.main.output
|
||||||
|
|
||||||
@ -143,29 +143,26 @@ test {
|
|||||||
dependsOn { testJar }
|
dependsOn { testJar }
|
||||||
|
|
||||||
systemProperties['junit.jupiter.execution.parallel.enabled'] = 'true'
|
systemProperties['junit.jupiter.execution.parallel.enabled'] = 'true'
|
||||||
if (jdkVersion == 8) {
|
|
||||||
systemProperties['sun.java2d.renderer'] = 'sun.java2d.marlin.MarlinRenderingEngine'
|
|
||||||
}
|
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
jvmArgs += [
|
jvmArgs += [
|
||||||
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
|
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
|
||||||
]
|
|
||||||
if (jdkVersion > 8) {
|
|
||||||
jvmArgs += [
|
|
||||||
'--add-modules', MODULE_NAME,
|
'--add-modules', MODULE_NAME,
|
||||||
'--module-path', '../build/dist/maven/poi-integration-tests' + File.pathSeparator + files(MODULE_RUNTIME_PATH).asPath,
|
'--module-path', '../build/dist/maven/poi-integration-tests' + File.pathSeparator + files(MODULE_RUNTIME_PATH).asPath,
|
||||||
]
|
]
|
||||||
}
|
|
||||||
if (NO_SCRATCHPAD) {
|
if (NO_SCRATCHPAD) {
|
||||||
systemProperty 'scratchpad.ignore', 'true'
|
systemProperty 'scratchpad.ignore', 'true'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
javadoc { enabled(false) }
|
javadoc {
|
||||||
|
enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
sourcesJar { enabled(false) }
|
sourcesJar {
|
||||||
|
enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
generateMetadataFileForPOIPublication.enabled = false
|
generateMetadataFileForPOIPublication.enabled = false
|
||||||
publishPOIPublicationToMavenLocal.enabled = false
|
publishPOIPublicationToMavenLocal.enabled = false
|
||||||
|
|||||||
@ -27,11 +27,14 @@ Before running this, you should execute the "jar" target in the main build.gradl
|
|||||||
<property name="dist" value="../build/dist"/>
|
<property name="dist" value="../build/dist"/>
|
||||||
<property name="build" value="../build/distsourcebuild"/>
|
<property name="build" value="../build/distsourcebuild"/>
|
||||||
|
|
||||||
<condition property="gradle.executable" value="../gradlew.bat" else="../gradlew">
|
<!-- Gradle is executed in ../build/poi-<version>, so three ".." are needed to use gradle from the root-dir -->
|
||||||
|
<condition property="gradle.executable" value="../../../gradlew.bat" else="../../../gradlew">
|
||||||
<os family="windows" />
|
<os family="windows" />
|
||||||
</condition>
|
</condition>
|
||||||
|
|
||||||
<target name="init" depends="">
|
<target name="init" depends="">
|
||||||
|
<echo message="Using Ant: ${ant.version} from ${ant.home}, Ant detected Java ${ant.java.version} (may be different than actual Java sometimes...)" />
|
||||||
|
<echo message="Using Java: ${java.version}/${java.runtime.version}/${java.vm.version}/${java.vm.name} from ${java.vm.vendor} on ${os.name}: ${os.version}" />
|
||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="run" depends="init,runSourceBuild,runCompileTest"/>
|
<target name="run" depends="init,runSourceBuild,runCompileTest"/>
|
||||||
@ -48,14 +51,14 @@ Before running this, you should execute the "jar" target in the main build.gradl
|
|||||||
<date xmlns="antlib:org.apache.tools.ant.types.resources.comparators"/>
|
<date xmlns="antlib:org.apache.tools.ant.types.resources.comparators"/>
|
||||||
<resources>
|
<resources>
|
||||||
<fileset dir="${dist}">
|
<fileset dir="${dist}">
|
||||||
<include name="poi-src-*.zip"/>
|
<include name="apache-poi-src-*.zip"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
</resources>
|
</resources>
|
||||||
</sort>
|
</sort>
|
||||||
</last>
|
</last>
|
||||||
</pathconvert>
|
</pathconvert>
|
||||||
|
|
||||||
<echo message="Found source package at ${srcpackage}"/>
|
<echo message="Found source package with pattern 'apache-poi-src-*.zip' in ${dist} at '${srcpackage}'. Run Gradle-task 'srcDistZip' in the main directory if it is missing"/>
|
||||||
<unzip src="${srcpackage}" dest="${build}" failOnEmptyArchive="true"/>
|
<unzip src="${srcpackage}" dest="${build}" failOnEmptyArchive="true"/>
|
||||||
|
|
||||||
<!-- look for name of sub-dir, do this dynamically as it changes with every (beta|rc)-release -->
|
<!-- look for name of sub-dir, do this dynamically as it changes with every (beta|rc)-release -->
|
||||||
@ -74,7 +77,7 @@ Before running this, you should execute the "jar" target in the main build.gradl
|
|||||||
<!-- finally call Ant on the extracted source to check if we can build the packages -->
|
<!-- finally call Ant on the extracted source to check if we can build the packages -->
|
||||||
<echo message="Building in temporary dir ${dirversion}/"/>
|
<echo message="Building in temporary dir ${dirversion}/"/>
|
||||||
<!--ant dir="${dirversion}" target="assemble" inheritAll="false" inheritRefs="false" useNativeBasedir="true"/-->
|
<!--ant dir="${dirversion}" target="assemble" inheritAll="false" inheritRefs="false" useNativeBasedir="true"/-->
|
||||||
<exec executable="${gradle.executable}" dir="." failonerror="true">
|
<exec executable="${gradle.executable}" dir="${dirversion}" failonerror="true">
|
||||||
<arg value="assemble" />
|
<arg value="assemble" />
|
||||||
</exec>
|
</exec>
|
||||||
</target>
|
</target>
|
||||||
@ -91,9 +94,9 @@ Before running this, you should execute the "jar" target in the main build.gradl
|
|||||||
<sort>
|
<sort>
|
||||||
<resources>
|
<resources>
|
||||||
<fileset dir="${dist}">
|
<fileset dir="${dist}">
|
||||||
<include name="**/poi-5.*.jar"/>
|
<include name="**/poi-6.*.jar"/>
|
||||||
<include name="**/poi-ooxml-5.*.jar"/>
|
<include name="**/poi-ooxml-6.*.jar"/>
|
||||||
<include name="**/poi-ooxml-lite-5.*.jar"/>
|
<include name="**/poi-ooxml-lite-6.*.jar"/>
|
||||||
<exclude name="**/*-javadoc*"/>
|
<exclude name="**/*-javadoc*"/>
|
||||||
<exclude name="**/*-sources*"/>
|
<exclude name="**/*-sources*"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
@ -123,7 +126,7 @@ Before running this, you should execute the "jar" target in the main build.gradl
|
|||||||
|
|
||||||
<echo message="Compiling examples without linking to scratchpad.jar to ensure that only some specific ones require this jar"/>
|
<echo message="Compiling examples without linking to scratchpad.jar to ensure that only some specific ones require this jar"/>
|
||||||
<javac srcdir="../poi-examples/src/main/java" destdir="${build}"
|
<javac srcdir="../poi-examples/src/main/java" destdir="${build}"
|
||||||
target="1.8" source="1.8" debug="true"
|
target="11" source="11" debug="true"
|
||||||
encoding="ASCII" fork="yes" includeantruntime="false"
|
encoding="ASCII" fork="yes" includeantruntime="false"
|
||||||
excludes="org/apache/poi/examples/hslf/**,org/apache/poi/examples/hsmf/**,org/apache/poi/examples/hwmf/**,**/EmbeddedObjects.java,**/EmeddedObjects.java,**/LoadEmbedded.java,**/Word2Forrest.java"
|
excludes="org/apache/poi/examples/hslf/**,org/apache/poi/examples/hsmf/**,org/apache/poi/examples/hwmf/**,**/EmbeddedObjects.java,**/EmeddedObjects.java,**/LoadEmbedded.java,**/Word2Forrest.java"
|
||||||
classpath="${jarpackage}" classpathref="libs">
|
classpath="${jarpackage}" classpathref="libs">
|
||||||
@ -134,10 +137,10 @@ Before running this, you should execute the "jar" target in the main build.gradl
|
|||||||
<sort>
|
<sort>
|
||||||
<resources>
|
<resources>
|
||||||
<fileset dir="${dist}">
|
<fileset dir="${dist}">
|
||||||
<include name="**/poi-5.*.jar"/>
|
<include name="**/poi-6.*.jar"/>
|
||||||
<include name="**/poi-ooxml-5.*.jar"/>
|
<include name="**/poi-ooxml-6.*.jar"/>
|
||||||
<include name="**/poi-ooxml-lite-5.*.jar"/>
|
<include name="**/poi-ooxml-lite-6.*.jar"/>
|
||||||
<include name="**/poi-scratchpad-5.*.jar"/>
|
<include name="**/poi-scratchpad-6.*.jar"/>
|
||||||
<exclude name="**/*-javadoc*"/>
|
<exclude name="**/*-javadoc*"/>
|
||||||
<exclude name="**/*-sources*"/>
|
<exclude name="**/*-sources*"/>
|
||||||
</fileset>
|
</fileset>
|
||||||
@ -147,7 +150,7 @@ Before running this, you should execute the "jar" target in the main build.gradl
|
|||||||
|
|
||||||
<echo message="Compiling all examples with the additional scratchpad.jar"/>
|
<echo message="Compiling all examples with the additional scratchpad.jar"/>
|
||||||
<javac srcdir="../poi-examples/src/main/java" destdir="${build}"
|
<javac srcdir="../poi-examples/src/main/java" destdir="${build}"
|
||||||
target="1.8" source="1.8" debug="true"
|
target="11" source="11" debug="true"
|
||||||
encoding="ASCII" fork="yes" includeantruntime="false"
|
encoding="ASCII" fork="yes" includeantruntime="false"
|
||||||
classpath="${jarpackagescratchpad}" classpathref="libs">
|
classpath="${jarpackagescratchpad}" classpathref="libs">
|
||||||
</javac>
|
</javac>
|
||||||
|
|||||||
@ -37,7 +37,6 @@ import org.apache.poi.hpsf.extractor.HPSFPropertiesExtractor;
|
|||||||
import org.apache.poi.hssf.extractor.EventBasedExcelExtractor;
|
import org.apache.poi.hssf.extractor.EventBasedExcelExtractor;
|
||||||
import org.apache.poi.ooxml.POIXMLException;
|
import org.apache.poi.ooxml.POIXMLException;
|
||||||
import org.apache.poi.ss.extractor.ExcelExtractor;
|
import org.apache.poi.ss.extractor.ExcelExtractor;
|
||||||
import org.apache.poi.util.IOUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class with things that can be run for any supported file handler
|
* Base class with things that can be run for any supported file handler
|
||||||
@ -88,18 +87,18 @@ public abstract class AbstractFileHandler implements FileHandler {
|
|||||||
long length = file.length();
|
long length = file.length();
|
||||||
long modified = file.lastModified();
|
long modified = file.lastModified();
|
||||||
|
|
||||||
POITextExtractor extractor = null;
|
|
||||||
String fileAndParentName = file.getParentFile().getName() + "/" + file.getName();
|
String fileAndParentName = file.getParentFile().getName() + "/" + file.getName();
|
||||||
try {
|
try {
|
||||||
|
handleExtractingAsStream(file);
|
||||||
|
|
||||||
// fix windows absolute paths for exception message tracking
|
// fix windows absolute paths for exception message tracking
|
||||||
String relPath = file.getPath().replaceAll(".*test-data", "test-data").replace('\\', '/');
|
String relPath = file.getPath().replaceAll(".*test-data", "test-data").replace('\\', '/');
|
||||||
extractor = ExtractorFactory.createExtractor(file);
|
try (POITextExtractor extractor = ExtractorFactory.createExtractor(file)) {
|
||||||
assertNotNull(extractor, "Should get a POITextExtractor but had none for file " + relPath);
|
assertNotNull(extractor, "Should get a POITextExtractor but had none for file " + relPath);
|
||||||
|
|
||||||
assertNotNull(extractor.getText(), "Should get some text but had none for file " + relPath);
|
assertNotNull(extractor.getText(), "Should get some text but had none for file " + relPath);
|
||||||
|
|
||||||
// also try metadata
|
// also try metadata
|
||||||
@SuppressWarnings("resource")
|
|
||||||
POITextExtractor metadataExtractor = extractor.getMetadataTextExtractor();
|
POITextExtractor metadataExtractor = extractor.getMetadataTextExtractor();
|
||||||
assertNotNull(metadataExtractor.getText());
|
assertNotNull(metadataExtractor.getText());
|
||||||
|
|
||||||
@ -109,16 +108,39 @@ public abstract class AbstractFileHandler implements FileHandler {
|
|||||||
assertEquals(length, file.length(), "File should not be modified by extractor");
|
assertEquals(length, file.length(), "File should not be modified by extractor");
|
||||||
assertEquals(modified, file.lastModified(), "File should not be modified by extractor");
|
assertEquals(modified, file.lastModified(), "File should not be modified by extractor");
|
||||||
|
|
||||||
handleExtractingAsStream(file);
|
|
||||||
|
|
||||||
if (extractor instanceof POIOLE2TextExtractor) {
|
if (extractor instanceof POIOLE2TextExtractor) {
|
||||||
try (HPSFPropertiesExtractor hpsfExtractor = new HPSFPropertiesExtractor((POIOLE2TextExtractor) extractor)) {
|
POIOLE2TextExtractor ole2Extractor = (POIOLE2TextExtractor) extractor;
|
||||||
|
ole2Extractor.getRoot();
|
||||||
|
if (!(ole2Extractor instanceof EventBasedExcelExtractor)) {
|
||||||
|
ole2Extractor.getSummaryInformation();
|
||||||
|
ole2Extractor.getDocSummaryInformation();
|
||||||
|
}
|
||||||
|
|
||||||
|
try (HPSFPropertiesExtractor hpsfExtractor = new HPSFPropertiesExtractor(ole2Extractor)) {
|
||||||
assertNotNull(hpsfExtractor.getDocumentSummaryInformationText());
|
assertNotNull(hpsfExtractor.getDocumentSummaryInformationText());
|
||||||
assertNotNull(hpsfExtractor.getSummaryInformationText());
|
assertNotNull(hpsfExtractor.getSummaryInformationText());
|
||||||
String text = hpsfExtractor.getText();
|
String text = hpsfExtractor.getText();
|
||||||
//System.out.println(text);
|
//System.out.println(text);
|
||||||
assertNotNull(text);
|
assertNotNull(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ole2Extractor.getRoot() != null && !Boolean.getBoolean("scratchpad.ignore")) {
|
||||||
|
POITextExtractor[] embedded = ExtractorFactory.getEmbeddedDocsTextExtractors(ole2Extractor);
|
||||||
|
try {
|
||||||
|
for (POITextExtractor poiTextExtractor : embedded) {
|
||||||
|
poiTextExtractor.getText();
|
||||||
|
poiTextExtractor.getDocument();
|
||||||
|
poiTextExtractor.getFilesystem();
|
||||||
|
POITextExtractor metaData = poiTextExtractor.getMetadataTextExtractor();
|
||||||
|
metaData.getFilesystem();
|
||||||
|
metaData.getText();
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
for (POITextExtractor embeddedExtractor : embedded) {
|
||||||
|
embeddedExtractor.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// test again with including formulas and cell-comments as this caused some bugs
|
// test again with including formulas and cell-comments as this caused some bugs
|
||||||
@ -136,6 +158,7 @@ public abstract class AbstractFileHandler implements FileHandler {
|
|||||||
text = extractor.getText();
|
text = extractor.getText();
|
||||||
assertNotNull(text);
|
assertNotNull(text);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (IOException | POIXMLException e) {
|
} catch (IOException | POIXMLException e) {
|
||||||
Exception prevE = e;
|
Exception prevE = e;
|
||||||
Throwable cause;
|
Throwable cause;
|
||||||
@ -159,8 +182,6 @@ public abstract class AbstractFileHandler implements FileHandler {
|
|||||||
if (!e.getMessage().contains("POI Scratchpad jar missing") || !Boolean.getBoolean("scratchpad.ignore")) {
|
if (!e.getMessage().contains("POI Scratchpad jar missing") || !Boolean.getBoolean("scratchpad.ignore")) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
} finally {
|
|
||||||
IOUtils.closeQuietly(extractor);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,6 +191,11 @@ public abstract class AbstractFileHandler implements FileHandler {
|
|||||||
assertNotNull(streamExtractor);
|
assertNotNull(streamExtractor);
|
||||||
|
|
||||||
assertNotNull(streamExtractor.getText());
|
assertNotNull(streamExtractor.getText());
|
||||||
|
|
||||||
|
POITextExtractor metadataTextExtractor = streamExtractor.getMetadataTextExtractor();
|
||||||
|
assertNotNull(metadataTextExtractor);
|
||||||
|
|
||||||
|
assertNotNull(metadataTextExtractor.getText());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,6 +29,8 @@ public enum FileHandlerKnown {
|
|||||||
HSLF,
|
HSLF,
|
||||||
HSMF,
|
HSMF,
|
||||||
HSSF,
|
HSSF,
|
||||||
|
HEMF,
|
||||||
|
HWMF,
|
||||||
HWPF,
|
HWPF,
|
||||||
OPC,
|
OPC,
|
||||||
POIFS,
|
POIFS,
|
||||||
|
|||||||
@ -0,0 +1,85 @@
|
|||||||
|
/* ====================================================================
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
this work for additional information regarding copyright ownership.
|
||||||
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
(the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
==================================================================== */
|
||||||
|
package org.apache.poi.stress;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
|
||||||
|
|
||||||
|
import java.awt.geom.Rectangle2D;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
|
import org.apache.poi.hemf.record.emf.HemfRecord;
|
||||||
|
import org.apache.poi.hemf.record.emf.HemfRecordType;
|
||||||
|
import org.apache.poi.hemf.record.emf.HemfText;
|
||||||
|
import org.apache.poi.hemf.usermodel.HemfPicture;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
public class HEMFFileHandler implements FileHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleExtracting(File file) throws Exception {
|
||||||
|
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
|
||||||
|
HemfPicture picture = new HemfPicture(stream);
|
||||||
|
|
||||||
|
// mimic a bit what e.g. Tika does to extract some information from .emf files
|
||||||
|
for (HemfRecord record : picture.getRecords()) {
|
||||||
|
if (record.getEmfRecordType().equals(HemfRecordType.extTextOutW)) {
|
||||||
|
assertInstanceOf(HemfText.EmfExtTextOutW.class, record);
|
||||||
|
HemfText.EmfExtTextOutW textOut = (HemfText.EmfExtTextOutW) record;
|
||||||
|
textOut.getText(StandardCharsets.UTF_16LE);
|
||||||
|
} else if (record.getEmfRecordType().equals(HemfRecordType.extTextOutA)) {
|
||||||
|
assertInstanceOf(HemfText.EmfExtTextOutA.class, record);
|
||||||
|
HemfText.EmfExtTextOutA textOut = (HemfText.EmfExtTextOutA) record;
|
||||||
|
textOut.getText(StandardCharsets.UTF_8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleAdditional(File file) throws Exception {
|
||||||
|
// no additional checks for now
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleFile(InputStream stream, String path) throws Exception {
|
||||||
|
HemfPicture picture = new HemfPicture(stream);
|
||||||
|
|
||||||
|
for (HemfRecord record : picture.getRecords()) {
|
||||||
|
record.getEmfRecordType();
|
||||||
|
record.getGenericRecordType();
|
||||||
|
}
|
||||||
|
|
||||||
|
BufferedImage dest = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
|
||||||
|
picture.draw(dest.createGraphics(), new Rectangle2D.Double(0, 0, 256, 256));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test() throws Exception {
|
||||||
|
String file = "test-data/slideshow/wrench.emf";
|
||||||
|
|
||||||
|
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
|
||||||
|
handleFile(stream, file);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleExtracting(new File(file));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -23,15 +23,15 @@ import java.io.File;
|
|||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
|
import org.apache.poi.hslf.usermodel.HSLFSlideShow;
|
||||||
import org.apache.poi.hslf.usermodel.HSLFSlideShowImpl;
|
import org.apache.poi.hslf.usermodel.HSLFSlideShowImpl;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
public class HSLFFileHandler extends SlideShowHandler {
|
public class HSLFFileHandler extends SlideShowHandler {
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(HSLFFileHandler.class);
|
private static final Logger LOGGER = PoiLogManager.getLogger(HSLFFileHandler.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleFile(InputStream stream, String path) throws Exception {
|
public void handleFile(InputStream stream, String path) throws Exception {
|
||||||
|
|||||||
@ -0,0 +1,93 @@
|
|||||||
|
/* ====================================================================
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
this work for additional information regarding copyright ownership.
|
||||||
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
(the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
==================================================================== */
|
||||||
|
package org.apache.poi.stress;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
|
||||||
|
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
|
import org.apache.poi.hwmf.record.HwmfFont;
|
||||||
|
import org.apache.poi.hwmf.record.HwmfRecord;
|
||||||
|
import org.apache.poi.hwmf.record.HwmfRecordType;
|
||||||
|
import org.apache.poi.hwmf.record.HwmfText;
|
||||||
|
import org.apache.poi.hwmf.usermodel.HwmfPicture;
|
||||||
|
import org.apache.poi.util.LocaleUtil;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
public class HWMFFileHandler implements FileHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleExtracting(File file) throws Exception {
|
||||||
|
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
|
||||||
|
HwmfPicture picture = new HwmfPicture(stream);
|
||||||
|
Charset charset = LocaleUtil.CHARSET_1252;
|
||||||
|
|
||||||
|
// mimic a bit what e.g. Tika does to extract some information from .wmf files
|
||||||
|
for (HwmfRecord record : picture.getRecords()) {
|
||||||
|
if (record.getWmfRecordType().equals(HwmfRecordType.createFontIndirect)) {
|
||||||
|
HwmfFont font = ((HwmfText.WmfCreateFontIndirect) record).getFont();
|
||||||
|
charset = (font.getCharset() == null || font.getCharset().getCharset() == null) ?
|
||||||
|
LocaleUtil.CHARSET_1252 : font.getCharset().getCharset();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (record.getWmfRecordType().equals(HwmfRecordType.extTextOut)) {
|
||||||
|
assertInstanceOf(HwmfText.WmfExtTextOut.class, record);
|
||||||
|
HwmfText.WmfExtTextOut textOut = (HwmfText.WmfExtTextOut) record;
|
||||||
|
textOut.getText(charset);
|
||||||
|
} else if (record.getWmfRecordType().equals(HwmfRecordType.textOut)) {
|
||||||
|
assertInstanceOf(HwmfText.WmfTextOut.class, record);
|
||||||
|
HwmfText.WmfTextOut textOut = (HwmfText.WmfTextOut) record;
|
||||||
|
textOut.getText(charset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleAdditional(File file) throws Exception {
|
||||||
|
// no additional checks for now
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleFile(InputStream stream, String path) throws Exception {
|
||||||
|
HwmfPicture picture = new HwmfPicture(stream);
|
||||||
|
|
||||||
|
for (HwmfRecord record : picture.getRecords()) {
|
||||||
|
record.getWmfRecordType();
|
||||||
|
record.getGenericRecordType();
|
||||||
|
}
|
||||||
|
|
||||||
|
BufferedImage dest = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
|
||||||
|
picture.draw(dest.createGraphics());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void test() throws Exception {
|
||||||
|
String file = "test-data/slideshow/santa.wmf";
|
||||||
|
|
||||||
|
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
|
||||||
|
handleFile(stream, file);
|
||||||
|
}
|
||||||
|
|
||||||
|
handleExtracting(new File(file));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -19,10 +19,11 @@ package org.apache.poi.stress;
|
|||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
import java.io.BufferedInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.PushbackInputStream;
|
import java.io.PushbackInputStream;
|
||||||
|
import java.nio.file.Files;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.poi.openxml4j.opc.ContentTypes;
|
import org.apache.poi.openxml4j.opc.ContentTypes;
|
||||||
@ -61,17 +62,13 @@ public class OPCFileHandler extends AbstractFileHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handleExtracting(File file) {
|
|
||||||
// text-extraction is not possible currently for these types of files
|
|
||||||
}
|
|
||||||
|
|
||||||
// a test-case to test this locally without executing the full TestAllFiles
|
// a test-case to test this locally without executing the full TestAllFiles
|
||||||
@Test
|
@Test
|
||||||
void test() throws Exception {
|
void test() throws Exception {
|
||||||
File file = new File("test-data/diagram/test.vsdx");
|
File file = new File("test-data/diagram/test.vsdx");
|
||||||
|
|
||||||
try (InputStream stream = new PushbackInputStream(new FileInputStream(file), 100000)) {
|
try (InputStream stream = new BufferedInputStream(
|
||||||
|
new PushbackInputStream(Files.newInputStream(file.toPath()), 100000))) {
|
||||||
handleFile(stream, file.getPath());
|
handleFile(stream, file.getPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ import java.lang.ref.WeakReference;
|
|||||||
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
|
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
|
||||||
import org.apache.poi.sl.draw.Drawable;
|
import org.apache.poi.sl.draw.Drawable;
|
||||||
import org.apache.poi.sl.usermodel.GroupShape;
|
import org.apache.poi.sl.usermodel.GroupShape;
|
||||||
|
import org.apache.poi.sl.usermodel.MasterSheet;
|
||||||
import org.apache.poi.sl.usermodel.Notes;
|
import org.apache.poi.sl.usermodel.Notes;
|
||||||
import org.apache.poi.sl.usermodel.PictureData;
|
import org.apache.poi.sl.usermodel.PictureData;
|
||||||
import org.apache.poi.sl.usermodel.Shape;
|
import org.apache.poi.sl.usermodel.Shape;
|
||||||
@ -76,11 +77,14 @@ public abstract class SlideShowHandler extends POIFSFileHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Shape<?,?> shape : s.getMasterSheet()) {
|
MasterSheet<?, ?> masterSheet = s.getMasterSheet();
|
||||||
|
if (masterSheet != null) {
|
||||||
|
for (Shape<?,?> shape : masterSheet) {
|
||||||
readShapes(shape);
|
readShapes(shape);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void readShapes(Shape<?,?> s) {
|
private void readShapes(Shape<?,?> s) {
|
||||||
// recursively walk group-shapes
|
// recursively walk group-shapes
|
||||||
|
|||||||
@ -37,6 +37,8 @@ public abstract class SpreadsheetHandler extends AbstractFileHandler {
|
|||||||
// try to access some of the content
|
// try to access some of the content
|
||||||
readContent(wb);
|
readContent(wb);
|
||||||
|
|
||||||
|
extractEmbedded(wb);
|
||||||
|
|
||||||
// write out the file
|
// write out the file
|
||||||
writeToArray(wb);
|
writeToArray(wb);
|
||||||
|
|
||||||
|
|||||||
@ -96,14 +96,19 @@ public class TestAllFiles {
|
|||||||
"poifs/protected_sha512.xlsx",
|
"poifs/protected_sha512.xlsx",
|
||||||
"poifs/60320-protected.xlsx",
|
"poifs/60320-protected.xlsx",
|
||||||
"poifs/protected_sha512.xlsx",
|
"poifs/protected_sha512.xlsx",
|
||||||
|
|
||||||
|
// stress docs
|
||||||
|
"document/deep-table-cell.docx",
|
||||||
|
|
||||||
|
// invalid files
|
||||||
|
"spreadsheet/bug69769.xlsx",
|
||||||
|
|
||||||
|
// NOTE: Expected failures should usually be added in file "stress.xls" instead
|
||||||
|
// of being listed here in order to also verify the expected exception details!
|
||||||
};
|
};
|
||||||
|
|
||||||
// cheap workaround of skipping the few problematic files
|
// cheap workaround of skipping the few problematic files
|
||||||
public static final String[] SCAN_EXCLUDES_NOSCRATCHPAD = {
|
public static final String[] SCAN_EXCLUDES_NOSCRATCHPAD = concat(SCAN_EXCLUDES, new String[] {
|
||||||
"**/.svn/**",
|
|
||||||
"lost+found",
|
|
||||||
"**/.git/**",
|
|
||||||
"**/ExternalEntityInText.docx", //the DocType (DTD) declaration causes this to fail
|
|
||||||
"**/right-to-left.xlsx", //the threaded comments in this file cause XSSF clone to fail
|
"**/right-to-left.xlsx", //the threaded comments in this file cause XSSF clone to fail
|
||||||
"document/word2.doc",
|
"document/word2.doc",
|
||||||
"document/cpansearch.perl.org_src_tobyink_acme-rundoc-0.001_word-lib_hello_world.docm",
|
"document/cpansearch.perl.org_src_tobyink_acme-rundoc-0.001_word-lib_hello_world.docm",
|
||||||
@ -130,17 +135,28 @@ public class TestAllFiles {
|
|||||||
"document/clusterfuzz-testcase-minimized-POIHWPFFuzzer-5418937293340672.doc",
|
"document/clusterfuzz-testcase-minimized-POIHWPFFuzzer-5418937293340672.doc",
|
||||||
"document/clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc",
|
"document/clusterfuzz-testcase-minimized-POIHWPFFuzzer-5440721166139392.doc",
|
||||||
"diagram/clusterfuzz-testcase-minimized-POIHDGFFuzzer-5947849161179136.vsd",
|
"diagram/clusterfuzz-testcase-minimized-POIHDGFFuzzer-5947849161179136.vsd",
|
||||||
|
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-5436547081830400.xls",
|
||||||
// exclude files failing on windows nodes, because of limited JCE policies
|
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-4819588401201152.xls",
|
||||||
"document/bug53475-password-is-pass.docx",
|
"diagram/clusterfuzz-testcase-minimized-POIVisioFuzzer-4537225637134336.vsd",
|
||||||
"poifs/60320-protected.xlsx",
|
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-6537773940867072.xls",
|
||||||
"poifs/protected_sha512.xlsx",
|
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-4977868385681408.xls",
|
||||||
"poifs/60320-protected.xlsx",
|
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-4651309315719168.xls",
|
||||||
"poifs/protected_sha512.xlsx",
|
"document/clusterfuzz-testcase-POIHWPFFuzzer-5696094627495936.doc",
|
||||||
};
|
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-4657005060816896.xls",
|
||||||
|
"diagram/clusterfuzz-testcase-minimized-POIHDGFFuzzer-4913778037489664.vsd",
|
||||||
|
"diagram/clusterfuzz-testcase-minimized-POIHDGFFuzzer-6478389109981184.vsd",
|
||||||
|
"publisher/clusterfuzz-testcase-minimized-POIHPBFFuzzer-4918886059278336.pub",
|
||||||
|
"publisher/clusterfuzz-testcase-minimized-POIHPBFFuzzer-4918886059278336.pub",
|
||||||
|
"publisher/clusterfuzz-testcase-minimized-POIHPBFFuzzer-6325615354773504.pub",
|
||||||
|
"spreadsheet/clusterfuzz-testcase-minimized-POIHSSFFuzzer-4734163573080064.xls",
|
||||||
|
"spreadsheet/rde.imf.ru_sites_default_files_rde_documents_vodootvedenie_2020.xlsb.xls",
|
||||||
|
"publisher/clusterfuzz-testcase-minimized-POIHPBFFuzzer-6325615354773504.pub",
|
||||||
|
});
|
||||||
|
|
||||||
private static final Set<String> EXPECTED_FAILURES = StressTestUtils.unmodifiableHashSet(
|
private static final Set<String> EXPECTED_FAILURES = StressTestUtils.unmodifiableHashSet(
|
||||||
"document/truncated62886.docx"
|
"document/truncated62886.docx",
|
||||||
|
// this document fails with IBM JDK because of a different exception being thrown
|
||||||
|
"spreadsheet/clusterfuzz-testcase-minimized-POIXSSFFuzzer-5089447305609216.xlsx"
|
||||||
);
|
);
|
||||||
|
|
||||||
public static Stream<Arguments> allfiles(String testName) throws IOException {
|
public static Stream<Arguments> allfiles(String testName) throws IOException {
|
||||||
@ -162,6 +178,7 @@ public class TestAllFiles {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean found = false;
|
||||||
for (FileHandlerKnown handler : sm.getHandler(file)) {
|
for (FileHandlerKnown handler : sm.getHandler(file)) {
|
||||||
ExcInfo info1 = sm.getExcInfo(file, testName, handler);
|
ExcInfo info1 = sm.getExcInfo(file, testName, handler);
|
||||||
if (info1 == null || info1.isValid(testName, handler.name())) {
|
if (info1 == null || info1.isValid(testName, handler.name())) {
|
||||||
@ -172,8 +189,13 @@ public class TestAllFiles {
|
|||||||
(info1 != null) ? info1.getExClazz() : null,
|
(info1 != null) ? info1.getExClazz() : null,
|
||||||
(info1 != null) ? info1.getExMessage() : null
|
(info1 != null) ? info1.getExMessage() : null
|
||||||
));
|
));
|
||||||
|
found = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!found) {
|
||||||
|
System.out.println("Could not find a handler for " + file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.stream();
|
return result.stream();
|
||||||
@ -241,6 +263,9 @@ public class TestAllFiles {
|
|||||||
String threadName = Thread.currentThread().getName();
|
String threadName = Thread.currentThread().getName();
|
||||||
try {
|
try {
|
||||||
Thread.currentThread().setName("Additional - " + file + " - " + handler);
|
Thread.currentThread().setName("Additional - " + file + " - " + handler);
|
||||||
|
if (StressTestUtils.excludeFile(file, EXPECTED_FAILURES))
|
||||||
|
return;
|
||||||
|
|
||||||
System.out.println("Running additionals on "+file);
|
System.out.println("Running additionals on "+file);
|
||||||
FileHandler fileHandler = handler.getHandler();
|
FileHandler fileHandler = handler.getHandler();
|
||||||
assertNotNull(fileHandler, "Did not find a handler for file " + file);
|
assertNotNull(fileHandler, "Did not find a handler for file " + file);
|
||||||
@ -284,9 +309,10 @@ public class TestAllFiles {
|
|||||||
errPrefix + " for " + exClass + " expected message '" + exMessage + "' but had '" + actMsg + "': " + e);
|
errPrefix + " for " + exClass + " expected message '" + exMessage + "' but had '" + actMsg + "': " + e);
|
||||||
|
|
||||||
if (actMsg != null &&
|
if (actMsg != null &&
|
||||||
// sometimes ArrayIndexOutOfBoundsException has null-message?!?
|
// in newer JDK versions IndexOutOfBoundsException switch from empty message
|
||||||
|
// to more useful content
|
||||||
// so skip the check for this type of exception if expected message is null
|
// so skip the check for this type of exception if expected message is null
|
||||||
(exMessage != null || !ArrayIndexOutOfBoundsException.class.isAssignableFrom(exClass))) {
|
(exMessage != null || !IndexOutOfBoundsException.class.isAssignableFrom(exClass))) {
|
||||||
assertNotNull(exMessage,
|
assertNotNull(exMessage,
|
||||||
errPrefix + "Expected message was null, but actMsg wasn't: Message: " + actMsg + ": " + e);
|
errPrefix + "Expected message was null, but actMsg wasn't: Message: " + actMsg + ": " + e);
|
||||||
assertTrue(actMsg.contains(exMessage),
|
assertTrue(actMsg.contains(exMessage),
|
||||||
@ -329,4 +355,11 @@ public class TestAllFiles {
|
|||||||
private static boolean isJava8() {
|
private static boolean isJava8() {
|
||||||
return System.getProperty("java.version").startsWith("1.8");
|
return System.getProperty("java.version").startsWith("1.8");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String[] concat(String[] a, String[] b) {
|
||||||
|
String[] result = new String[a.length + b.length];
|
||||||
|
System.arraycopy(a, 0, result, 0, a.length);
|
||||||
|
System.arraycopy(b, 0, result, a.length, b.length);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,7 +78,7 @@ public class XSSFBFileHandler extends AbstractFileHandler {
|
|||||||
XSSFBEventBasedExcelExtractor ex = new XSSFBEventBasedExcelExtractor(pkg);
|
XSSFBEventBasedExcelExtractor ex = new XSSFBEventBasedExcelExtractor(pkg);
|
||||||
String txt = ex.getText();
|
String txt = ex.getText();
|
||||||
if (txt.length() < 1) {
|
if (txt.length() < 1) {
|
||||||
throw new RuntimeException("Should have gotten some text.");
|
throw new IllegalArgumentException("Should have gotten some text.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -203,7 +203,7 @@ public class XSSFFileHandler extends SpreadsheetHandler {
|
|||||||
XLSX2CSV.main(new String[]{file.getAbsolutePath()});
|
XLSX2CSV.main(new String[]{file.getAbsolutePath()});
|
||||||
ExcelComparator.main(new String[]{file.getAbsolutePath(), file.getAbsolutePath()});
|
ExcelComparator.main(new String[]{file.getAbsolutePath(), file.getAbsolutePath()});
|
||||||
|
|
||||||
assertFalse( EXPECTED_ADDITIONAL_FAILURES.contains(testFile), "Expected Extraction to fail for file " + file + " and handler " + this + ", but did not fail!" );
|
assertFalse(EXPECTED_ADDITIONAL_FAILURES.contains(testFile), "Expected Extraction to fail for file " + file + " and handler " + this + ", but did not fail!" );
|
||||||
|
|
||||||
} catch (OLE2NotOfficeXmlFileException e) {
|
} catch (OLE2NotOfficeXmlFileException e) {
|
||||||
// we have some files that are not actually OOXML and thus cannot be tested here
|
// we have some files that are not actually OOXML and thus cannot be tested here
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import java.io.FileInputStream;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.apache.commons.io.output.NullOutputStream;
|
||||||
import org.apache.poi.ooxml.POIXMLException;
|
import org.apache.poi.ooxml.POIXMLException;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
@ -41,6 +42,8 @@ public class XWPFFileHandler extends AbstractFileHandler {
|
|||||||
try (XWPFDocument doc = new XWPFDocument(stream)) {
|
try (XWPFDocument doc = new XWPFDocument(stream)) {
|
||||||
new POIXMLDocumentHandler().handlePOIXMLDocument(doc);
|
new POIXMLDocumentHandler().handlePOIXMLDocument(doc);
|
||||||
POIXMLDocumentHandler.cursorRecursive(doc.getDocument());
|
POIXMLDocumentHandler.cursorRecursive(doc.getDocument());
|
||||||
|
|
||||||
|
doc.write(NullOutputStream.INSTANCE);
|
||||||
} catch (POIXMLException e) {
|
} catch (POIXMLException e) {
|
||||||
Exception cause = (Exception)e.getCause();
|
Exception cause = (Exception)e.getCause();
|
||||||
throw cause == null ? e : cause;
|
throw cause == null ? e : cause;
|
||||||
|
|||||||
@ -16,13 +16,14 @@
|
|||||||
==================================================================== */
|
==================================================================== */
|
||||||
|
|
||||||
module org.apache.poi.stress {
|
module org.apache.poi.stress {
|
||||||
requires org.apache.logging.log4j;
|
|
||||||
requires org.junit.jupiter.api;
|
requires org.junit.jupiter.api;
|
||||||
requires org.junit.jupiter.params;
|
requires org.junit.jupiter.params;
|
||||||
requires net.bytebuddy;
|
requires net.bytebuddy;
|
||||||
requires java.desktop;
|
requires java.desktop;
|
||||||
|
|
||||||
requires org.apache.commons.collections4;
|
requires org.apache.commons.collections4;
|
||||||
|
requires org.apache.commons.io;
|
||||||
|
requires transitive org.apache.poi.poi;
|
||||||
requires org.apache.poi.examples;
|
requires org.apache.poi.examples;
|
||||||
requires org.apache.poi.scratchpad;
|
requires org.apache.poi.scratchpad;
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,7 @@
|
|||||||
<Logger name="org.apache.poi.xssf.usermodel.XSSFWorkbook" level="ERROR" />
|
<Logger name="org.apache.poi.xssf.usermodel.XSSFWorkbook" level="ERROR" />
|
||||||
<Logger name="org.apache.poi.hslf.usermodel.HSLFGroupShape" level="WARN" />
|
<Logger name="org.apache.poi.hslf.usermodel.HSLFGroupShape" level="WARN" />
|
||||||
<Logger name="org.apache.poi.hslf.record.Record" level="ERROR" />
|
<Logger name="org.apache.poi.hslf.record.Record" level="ERROR" />
|
||||||
|
<Logger name="org.apache.poi.hwpf.sprm.ParagraphSprmUncompressor" level="FATAL" />
|
||||||
|
|
||||||
<!-- Change to DEBUG or another level to get log output -->
|
<!-- Change to DEBUG or another level to get log output -->
|
||||||
<Root level="ERROR">
|
<Root level="ERROR">
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
import java.util.regex.Pattern
|
|
||||||
|
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -17,9 +15,11 @@ import java.util.regex.Pattern
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==================================================================== */
|
==================================================================== */
|
||||||
|
|
||||||
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
final String MODULE_NAME = 'org.apache.poi.ooxml.schemas'
|
final String MODULE_NAME = 'org.apache.poi.ooxml.schemas'
|
||||||
final String BEANS_SRC = "${buildDir}/generated-sources"
|
final String BEANS_SRC = layout.buildDirectory.dir('generated-sources').get().asFile.absolutePath
|
||||||
final String BEANS_RES = "${buildDir}/generated-resources"
|
final String BEANS_RES = layout.buildDirectory.dir('generated-resources').get().asFile.absolutePath
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
@ -54,14 +54,14 @@ compileJava {
|
|||||||
options.forkOptions.jvmArgs += '-Xmx2G'
|
options.forkOptions.jvmArgs += '-Xmx2G'
|
||||||
}
|
}
|
||||||
|
|
||||||
task compileJava9(type: JavaCompile) {
|
tasks.register('compileJava9', JavaCompile) {
|
||||||
dependsOn 'compileJava'
|
dependsOn 'compileJava'
|
||||||
|
|
||||||
javaCompiler = javaToolchains.compilerFor {
|
javaCompiler = javaToolchains.compilerFor {
|
||||||
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
||||||
}
|
}
|
||||||
sourceCompatibility = 1.9
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 1.9
|
targetCompatibility = 11
|
||||||
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
||||||
source = file(JAVA9_SRC)
|
source = file(JAVA9_SRC)
|
||||||
classpath = files()
|
classpath = files()
|
||||||
@ -71,19 +71,19 @@ task compileJava9(type: JavaCompile) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
task copy_xsds(type: Copy) {
|
tasks.register('copy_xsds', Copy) {
|
||||||
from ('src/main/xmlschema/org/apache/poi/xdgf')
|
from('src/main/xmlschema/org/apache/poi/xdgf')
|
||||||
from ('src/main/xmlschema/org/apache/poi/schemas') {
|
from('src/main/xmlschema/org/apache/poi/schemas') {
|
||||||
include 'XAdES*.xsd', '*.xsdconfig', 'xmldsig*.xsd', 'ooxmlSchemas.xsdconfig', 'markup-compatibility.xsd',
|
include 'XAdES*.xsd', '*.xsdconfig', 'xmldsig*.xsd', 'ooxmlSchemas.xsdconfig', 'markup-compatibility.xsd',
|
||||||
'vmlDrawing.xsd', 'word12.xsd', 'xlThreaded*.xsd', 'dml-drawing.xsd', 'drawing-chart2012.xsd',
|
'vmlDrawing.xsd', 'word10.xsd', 'word12.xsd', 'xlThreaded*.xsd', 'dml-drawing.xsd', 'drawing-chart2012.xsd',
|
||||||
'chartEx.xsd'
|
'chartEx.xsd'
|
||||||
exclude '*.zip'
|
exclude '*.zip'
|
||||||
}
|
}
|
||||||
from ('src/main/xmlschema/org/apache/poi/poifs/crypt') {
|
from('src/main/xmlschema/org/apache/poi/poifs/crypt') {
|
||||||
include 'signatureInfo.xsd'
|
include 'signatureInfo.xsd'
|
||||||
}
|
}
|
||||||
from (zipTree('src/main/xmlschema/org/apache/poi/schemas/OfficeOpenXML-XMLSchema-Transitional.zip'))
|
from(zipTree('src/main/xmlschema/org/apache/poi/schemas/OfficeOpenXML-XMLSchema-Transitional.zip'))
|
||||||
from (zipTree('src/main/xmlschema/org/apache/poi/schemas/OpenPackagingConventions-XMLSchema.zip')) {
|
from(zipTree('src/main/xmlschema/org/apache/poi/schemas/OpenPackagingConventions-XMLSchema.zip')) {
|
||||||
include 'opc-digSig.xsd', 'opc-relationships.xsd'
|
include 'opc-digSig.xsd', 'opc-relationships.xsd'
|
||||||
}
|
}
|
||||||
into 'build/xsds'
|
into 'build/xsds'
|
||||||
@ -126,7 +126,7 @@ task generate_beans(dependsOn: copy_xsds) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task sourceJar(type: Jar) {
|
tasks.register('sourceJar', Jar) {
|
||||||
setArchiveClassifier 'sources'
|
setArchiveClassifier 'sources'
|
||||||
from sourceSets.main.allJava
|
from sourceSets.main.allJava
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,562 @@
|
|||||||
|
<xsd:schema attributeFormDefault="qualified" blockDefault="#all" elementFormDefault="qualified"
|
||||||
|
targetNamespace="http://schemas.microsoft.com/office/word/2010/wordml"
|
||||||
|
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
|
||||||
|
xmlns:w06="http://schemas.openxmlformats.org/wordprocessingml/2006/main"
|
||||||
|
xmlns:od06st="http://schemas.openxmlformats.org/officeDocument/2006/sharedTypes"
|
||||||
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns="http://schemas.microsoft.com/office/word/2010/wordml">
|
||||||
|
<xsd:complexType name="CT_LongHexNumber">
|
||||||
|
<xsd:attribute name="val" type="w06:ST_LongHexNumber" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:simpleType name="ST_OnOff">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="true"/>
|
||||||
|
<xsd:enumeration value="false"/>
|
||||||
|
<xsd:enumeration value="0"/>
|
||||||
|
<xsd:enumeration value="1"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:complexType name="CT_OnOff">
|
||||||
|
<xsd:attribute name="val" type="ST_OnOff"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:element name="docId" type="CT_LongHexNumber"/>
|
||||||
|
<xsd:element name="conflictMode" type="CT_OnOff"/>
|
||||||
|
<xsd:attributeGroup name="AG_Parids">
|
||||||
|
<xsd:attribute name="paraId" type="w06:ST_LongHexNumber"/>
|
||||||
|
<xsd:attribute name="textId" type="w06:ST_LongHexNumber"/>
|
||||||
|
</xsd:attributeGroup>
|
||||||
|
<xsd:attribute name="anchorId" type="w06:ST_LongHexNumber"/>
|
||||||
|
<xsd:attribute name="noSpellErr" type="od06st:ST_OnOff"/>
|
||||||
|
<xsd:element name="customXmlConflictInsRangeStart" type="w06:CT_TrackChange"/>
|
||||||
|
<xsd:element name="customXmlConflictInsRangeEnd" type="w06:CT_Markup"/>
|
||||||
|
<xsd:element name="customXmlConflictDelRangeStart" type="w06:CT_TrackChange"/>
|
||||||
|
<xsd:element name="customXmlConflictDelRangeEnd" type="w06:CT_Markup"/>
|
||||||
|
<xsd:group name="EG_RunLevelConflicts">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="conflictIns" type="w06:CT_RunTrackChange" minOccurs="0"/>
|
||||||
|
<xsd:element name="conflictDel" type="w06:CT_RunTrackChange" minOccurs="0"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:group>
|
||||||
|
<xsd:group name="EG_Conflicts">
|
||||||
|
<xsd:choice>
|
||||||
|
<xsd:element name="conflictIns" type="w06:CT_TrackChange" minOccurs="0"/>
|
||||||
|
<xsd:element name="conflictDel" type="w06:CT_TrackChange" minOccurs="0"/>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:group>
|
||||||
|
<xsd:complexType name="CT_Percentage">
|
||||||
|
<xsd:attribute name="val" type="a:ST_Percentage" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_PositiveFixedPercentage">
|
||||||
|
<xsd:attribute name="val" type="a:ST_PositiveFixedPercentage" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_PositivePercentage">
|
||||||
|
<xsd:attribute name="val" type="a:ST_PositivePercentage" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:simpleType name="ST_SchemeColorVal">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="bg1"/>
|
||||||
|
<xsd:enumeration value="tx1"/>
|
||||||
|
<xsd:enumeration value="bg2"/>
|
||||||
|
<xsd:enumeration value="tx2"/>
|
||||||
|
<xsd:enumeration value="accent1"/>
|
||||||
|
<xsd:enumeration value="accent2"/>
|
||||||
|
<xsd:enumeration value="accent3"/>
|
||||||
|
<xsd:enumeration value="accent4"/>
|
||||||
|
<xsd:enumeration value="accent5"/>
|
||||||
|
<xsd:enumeration value="accent6"/>
|
||||||
|
<xsd:enumeration value="hlink"/>
|
||||||
|
<xsd:enumeration value="folHlink"/>
|
||||||
|
<xsd:enumeration value="dk1"/>
|
||||||
|
<xsd:enumeration value="lt1"/>
|
||||||
|
<xsd:enumeration value="dk2"/>
|
||||||
|
<xsd:enumeration value="lt2"/>
|
||||||
|
<xsd:enumeration value="phClr"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:simpleType name="ST_RectAlignment">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="none"/>
|
||||||
|
<xsd:enumeration value="tl"/>
|
||||||
|
<xsd:enumeration value="t"/>
|
||||||
|
<xsd:enumeration value="tr"/>
|
||||||
|
<xsd:enumeration value="l"/>
|
||||||
|
<xsd:enumeration value="ctr"/>
|
||||||
|
<xsd:enumeration value="r"/>
|
||||||
|
<xsd:enumeration value="bl"/>
|
||||||
|
<xsd:enumeration value="b"/>
|
||||||
|
<xsd:enumeration value="br"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:simpleType name="ST_PathShadeType">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="shape"/>
|
||||||
|
<xsd:enumeration value="circle"/>
|
||||||
|
<xsd:enumeration value="rect"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:simpleType name="ST_LineCap">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="rnd"/>
|
||||||
|
<xsd:enumeration value="sq"/>
|
||||||
|
<xsd:enumeration value="flat"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:simpleType name="ST_PresetLineDashVal">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="solid"/>
|
||||||
|
<xsd:enumeration value="dot"/>
|
||||||
|
<xsd:enumeration value="sysDot"/>
|
||||||
|
<xsd:enumeration value="dash"/>
|
||||||
|
<xsd:enumeration value="sysDash"/>
|
||||||
|
<xsd:enumeration value="lgDash"/>
|
||||||
|
<xsd:enumeration value="dashDot"/>
|
||||||
|
<xsd:enumeration value="sysDashDot"/>
|
||||||
|
<xsd:enumeration value="lgDashDot"/>
|
||||||
|
<xsd:enumeration value="lgDashDotDot"/>
|
||||||
|
<xsd:enumeration value="sysDashDotDot"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:simpleType name="ST_PenAlignment">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="ctr"/>
|
||||||
|
<xsd:enumeration value="in"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:simpleType name="ST_CompoundLine">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="sng"/>
|
||||||
|
<xsd:enumeration value="dbl"/>
|
||||||
|
<xsd:enumeration value="thickThin"/>
|
||||||
|
<xsd:enumeration value="thinThick"/>
|
||||||
|
<xsd:enumeration value="tri"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:complexType name="CT_RelativeRect">
|
||||||
|
<xsd:attribute name="l" use="optional" type="a:ST_Percentage"/>
|
||||||
|
<xsd:attribute name="t" use="optional" type="a:ST_Percentage"/>
|
||||||
|
<xsd:attribute name="r" use="optional" type="a:ST_Percentage"/>
|
||||||
|
<xsd:attribute name="b" use="optional" type="a:ST_Percentage"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:group name="EG_ColorTransform">
|
||||||
|
<xsd:choice>
|
||||||
|
<xsd:element name="tint" type="CT_PositiveFixedPercentage"/>
|
||||||
|
<xsd:element name="shade" type="CT_PositiveFixedPercentage"/>
|
||||||
|
<xsd:element name="alpha" type="CT_PositiveFixedPercentage"/>
|
||||||
|
<xsd:element name="hueMod" type="CT_PositivePercentage"/>
|
||||||
|
<xsd:element name="sat" type="CT_Percentage"/>
|
||||||
|
<xsd:element name="satOff" type="CT_Percentage"/>
|
||||||
|
<xsd:element name="satMod" type="CT_Percentage"/>
|
||||||
|
<xsd:element name="lum" type="CT_Percentage"/>
|
||||||
|
<xsd:element name="lumOff" type="CT_Percentage"/>
|
||||||
|
<xsd:element name="lumMod" type="CT_Percentage"/>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:group>
|
||||||
|
<xsd:complexType name="CT_SRgbColor">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="val" type="od06st:ST_HexColorRGB" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_SchemeColor">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:group ref="EG_ColorTransform" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="val" type="ST_SchemeColorVal" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:group name="EG_ColorChoice">
|
||||||
|
<xsd:choice>
|
||||||
|
<xsd:element name="srgbClr" type="CT_SRgbColor"/>
|
||||||
|
<xsd:element name="schemeClr" type="CT_SchemeColor"/>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:group>
|
||||||
|
<xsd:complexType name="CT_Color">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:group ref="EG_ColorChoice"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_GradientStop">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:group ref="EG_ColorChoice"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="pos" type="a:ST_PositiveFixedPercentage" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_GradientStopList">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="gs" type="CT_GradientStop" minOccurs="2" maxOccurs="10"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_LinearShadeProperties">
|
||||||
|
<xsd:attribute name="ang" type="a:ST_PositiveFixedAngle" use="optional"/>
|
||||||
|
<xsd:attribute name="scaled" type="ST_OnOff" use="optional"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_PathShadeProperties">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="fillToRect" type="CT_RelativeRect" minOccurs="0"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="path" type="ST_PathShadeType" use="optional"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:group name="EG_ShadeProperties">
|
||||||
|
<xsd:choice>
|
||||||
|
<xsd:element name="lin" type="CT_LinearShadeProperties"/>
|
||||||
|
<xsd:element name="path" type="CT_PathShadeProperties"/>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:group>
|
||||||
|
<xsd:complexType name="CT_SolidColorFillProperties">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:group ref="EG_ColorChoice" minOccurs="0"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_GradientFillProperties">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="gsLst" type="CT_GradientStopList" minOccurs="0"/>
|
||||||
|
<xsd:group ref="EG_ShadeProperties" minOccurs="0"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:group name="EG_FillProperties">
|
||||||
|
<xsd:choice>
|
||||||
|
<xsd:element name="noFill" type="w06:CT_Empty"/>
|
||||||
|
<xsd:element name="solidFill" type="CT_SolidColorFillProperties"/>
|
||||||
|
<xsd:element name="gradFill" type="CT_GradientFillProperties"/>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:group>
|
||||||
|
<xsd:complexType name="CT_PresetLineDashProperties">
|
||||||
|
<xsd:attribute name="val" type="ST_PresetLineDashVal" use="optional"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:group name="EG_LineDashProperties">
|
||||||
|
<xsd:choice>
|
||||||
|
<xsd:element name="prstDash" type="CT_PresetLineDashProperties"/>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:group>
|
||||||
|
<xsd:complexType name="CT_LineJoinMiterProperties">
|
||||||
|
<xsd:attribute name="lim" type="a:ST_PositivePercentage" use="optional"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:group name="EG_LineJoinProperties">
|
||||||
|
<xsd:choice>
|
||||||
|
<xsd:element name="round" type="w06:CT_Empty"/>
|
||||||
|
<xsd:element name="bevel" type="w06:CT_Empty"/>
|
||||||
|
<xsd:element name="miter" type="CT_LineJoinMiterProperties"/>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:group>
|
||||||
|
<xsd:simpleType name="ST_PresetCameraType">
|
||||||
|
<xsd:restriction base="xsd:token">
|
||||||
|
<xsd:enumeration value="legacyObliqueTopLeft"/>
|
||||||
|
<xsd:enumeration value="legacyObliqueTop"/>
|
||||||
|
<xsd:enumeration value="legacyObliqueTopRight"/>
|
||||||
|
<xsd:enumeration value="legacyObliqueLeft"/>
|
||||||
|
<xsd:enumeration value="legacyObliqueFront"/>
|
||||||
|
<xsd:enumeration value="legacyObliqueRight"/>
|
||||||
|
<xsd:enumeration value="legacyObliqueBottomLeft"/>
|
||||||
|
<xsd:enumeration value="legacyObliqueBottom"/>
|
||||||
|
<xsd:enumeration value="legacyObliqueBottomRight"/>
|
||||||
|
<xsd:enumeration value="legacyPerspectiveTopLeft"/>
|
||||||
|
<xsd:enumeration value="legacyPerspectiveTop"/>
|
||||||
|
<xsd:enumeration value="legacyPerspectiveTopRight"/>
|
||||||
|
<xsd:enumeration value="legacyPerspectiveLeft"/>
|
||||||
|
<xsd:enumeration value="legacyPerspectiveFront"/>
|
||||||
|
<xsd:enumeration value="legacyPerspectiveRight"/>
|
||||||
|
<xsd:enumeration value="legacyPerspectiveBottomLeft"/>
|
||||||
|
<xsd:enumeration value="legacyPerspectiveBottom"/>
|
||||||
|
<xsd:enumeration value="legacyPerspectiveBottomRight"/>
|
||||||
|
<xsd:enumeration value="orthographicFront"/>
|
||||||
|
<xsd:enumeration value="isometricTopUp"/>
|
||||||
|
<xsd:enumeration value="isometricTopDown"/>
|
||||||
|
<xsd:enumeration value="isometricBottomUp"/>
|
||||||
|
<xsd:enumeration value="isometricBottomDown"/>
|
||||||
|
<xsd:enumeration value="isometricLeftUp"/>
|
||||||
|
<xsd:enumeration value="isometricLeftDown"/>
|
||||||
|
<xsd:enumeration value="isometricRightUp"/>
|
||||||
|
<xsd:enumeration value="isometricRightDown"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis1Left"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis1Right"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis1Top"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis2Left"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis2Right"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis2Top"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis3Left"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis3Right"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis3Bottom"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis4Left"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis4Right"/>
|
||||||
|
<xsd:enumeration value="isometricOffAxis4Bottom"/>
|
||||||
|
<xsd:enumeration value="obliqueTopLeft"/>
|
||||||
|
<xsd:enumeration value="obliqueTop"/>
|
||||||
|
<xsd:enumeration value="obliqueTopRight"/>
|
||||||
|
<xsd:enumeration value="obliqueLeft"/>
|
||||||
|
<xsd:enumeration value="obliqueRight"/>
|
||||||
|
<xsd:enumeration value="obliqueBottomLeft"/>
|
||||||
|
<xsd:enumeration value="obliqueBottom"/>
|
||||||
|
<xsd:enumeration value="obliqueBottomRight"/>
|
||||||
|
<xsd:enumeration value="perspectiveFront"/>
|
||||||
|
<xsd:enumeration value="perspectiveLeft"/>
|
||||||
|
<xsd:enumeration value="perspectiveRight"/>
|
||||||
|
<xsd:enumeration value="perspectiveAbove"/>
|
||||||
|
<xsd:enumeration value="perspectiveBelow"/>
|
||||||
|
<xsd:enumeration value="perspectiveAboveLeftFacing"/>
|
||||||
|
<xsd:enumeration value="perspectiveAboveRightFacing"/>
|
||||||
|
<xsd:enumeration value="perspectiveContrastingLeftFacing"/>
|
||||||
|
<xsd:enumeration value="perspectiveContrastingRightFacing"/>
|
||||||
|
<xsd:enumeration value="perspectiveHeroicLeftFacing"/>
|
||||||
|
<xsd:enumeration value="perspectiveHeroicRightFacing"/>
|
||||||
|
<xsd:enumeration value="perspectiveHeroicExtremeLeftFacing"/>
|
||||||
|
<xsd:enumeration value="perspectiveHeroicExtremeRightFacing"/>
|
||||||
|
<xsd:enumeration value="perspectiveRelaxed"/>
|
||||||
|
<xsd:enumeration value="perspectiveRelaxedModerately"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:complexType name="CT_Camera">
|
||||||
|
<xsd:attribute name="prst" use="required" type="ST_PresetCameraType"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_SphereCoords">
|
||||||
|
<xsd:attribute name="lat" type="a:ST_PositiveFixedAngle" use="required"/>
|
||||||
|
<xsd:attribute name="lon" type="a:ST_PositiveFixedAngle" use="required"/>
|
||||||
|
<xsd:attribute name="rev" type="a:ST_PositiveFixedAngle" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:simpleType name="ST_LightRigType">
|
||||||
|
<xsd:restriction base="xsd:token">
|
||||||
|
<xsd:enumeration value="legacyFlat1"/>
|
||||||
|
<xsd:enumeration value="legacyFlat2"/>
|
||||||
|
<xsd:enumeration value="legacyFlat3"/>
|
||||||
|
<xsd:enumeration value="legacyFlat4"/>
|
||||||
|
<xsd:enumeration value="legacyNormal1"/>
|
||||||
|
<xsd:enumeration value="legacyNormal2"/>
|
||||||
|
<xsd:enumeration value="legacyNormal3"/>
|
||||||
|
<xsd:enumeration value="legacyNormal4"/>
|
||||||
|
<xsd:enumeration value="legacyHarsh1"/>
|
||||||
|
<xsd:enumeration value="legacyHarsh2"/>
|
||||||
|
<xsd:enumeration value="legacyHarsh3"/>
|
||||||
|
<xsd:enumeration value="legacyHarsh4"/>
|
||||||
|
<xsd:enumeration value="threePt"/>
|
||||||
|
<xsd:enumeration value="balanced"/>
|
||||||
|
<xsd:enumeration value="soft"/>
|
||||||
|
<xsd:enumeration value="harsh"/>
|
||||||
|
<xsd:enumeration value="flood"/>
|
||||||
|
<xsd:enumeration value="contrasting"/>
|
||||||
|
<xsd:enumeration value="morning"/>
|
||||||
|
<xsd:enumeration value="sunrise"/>
|
||||||
|
<xsd:enumeration value="sunset"/>
|
||||||
|
<xsd:enumeration value="chilly"/>
|
||||||
|
<xsd:enumeration value="freezing"/>
|
||||||
|
<xsd:enumeration value="flat"/>
|
||||||
|
<xsd:enumeration value="twoPt"/>
|
||||||
|
<xsd:enumeration value="glow"/>
|
||||||
|
<xsd:enumeration value="brightRoom"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:simpleType name="ST_LightRigDirection">
|
||||||
|
<xsd:restriction base="xsd:token">
|
||||||
|
<xsd:enumeration value="tl"/>
|
||||||
|
<xsd:enumeration value="t"/>
|
||||||
|
<xsd:enumeration value="tr"/>
|
||||||
|
<xsd:enumeration value="l"/>
|
||||||
|
<xsd:enumeration value="r"/>
|
||||||
|
<xsd:enumeration value="bl"/>
|
||||||
|
<xsd:enumeration value="b"/>
|
||||||
|
<xsd:enumeration value="br"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:complexType name="CT_LightRig">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="rot" type="CT_SphereCoords" minOccurs="0"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="rig" type="ST_LightRigType" use="required"/>
|
||||||
|
<xsd:attribute name="dir" type="ST_LightRigDirection" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:simpleType name="ST_BevelPresetType">
|
||||||
|
<xsd:restriction base="xsd:token">
|
||||||
|
<xsd:enumeration value="relaxedInset"/>
|
||||||
|
<xsd:enumeration value="circle"/>
|
||||||
|
<xsd:enumeration value="slope"/>
|
||||||
|
<xsd:enumeration value="cross"/>
|
||||||
|
<xsd:enumeration value="angle"/>
|
||||||
|
<xsd:enumeration value="softRound"/>
|
||||||
|
<xsd:enumeration value="convex"/>
|
||||||
|
<xsd:enumeration value="coolSlant"/>
|
||||||
|
<xsd:enumeration value="divot"/>
|
||||||
|
<xsd:enumeration value="riblet"/>
|
||||||
|
<xsd:enumeration value="hardEdge"/>
|
||||||
|
<xsd:enumeration value="artDeco"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:complexType name="CT_Bevel">
|
||||||
|
<xsd:attribute name="w" type="a:ST_PositiveCoordinate" use="optional"/>
|
||||||
|
<xsd:attribute name="h" type="a:ST_PositiveCoordinate" use="optional"/>
|
||||||
|
<xsd:attribute name="prst" type="ST_BevelPresetType" use="optional"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:simpleType name="ST_PresetMaterialType">
|
||||||
|
<xsd:restriction base="xsd:token">
|
||||||
|
<xsd:enumeration value="legacyMatte"/>
|
||||||
|
<xsd:enumeration value="legacyPlastic"/>
|
||||||
|
<xsd:enumeration value="legacyMetal"/>
|
||||||
|
<xsd:enumeration value="legacyWireframe"/>
|
||||||
|
<xsd:enumeration value="matte"/>
|
||||||
|
<xsd:enumeration value="plastic"/>
|
||||||
|
<xsd:enumeration value="metal"/>
|
||||||
|
<xsd:enumeration value="warmMatte"/>
|
||||||
|
<xsd:enumeration value="translucentPowder"/>
|
||||||
|
<xsd:enumeration value="powder"/>
|
||||||
|
<xsd:enumeration value="dkEdge"/>
|
||||||
|
<xsd:enumeration value="softEdge"/>
|
||||||
|
<xsd:enumeration value="clear"/>
|
||||||
|
<xsd:enumeration value="flat"/>
|
||||||
|
<xsd:enumeration value="softmetal"/>
|
||||||
|
<xsd:enumeration value="none"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:complexType name="CT_Glow">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:group ref="EG_ColorChoice"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="rad" use="optional" type="a:ST_PositiveCoordinate"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_Shadow">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:group ref="EG_ColorChoice"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="blurRad" use="optional" type="a:ST_PositiveCoordinate"/>
|
||||||
|
<xsd:attribute name="dist" use="optional" type="a:ST_PositiveCoordinate"/>
|
||||||
|
<xsd:attribute name="dir" use="optional" type="a:ST_PositiveFixedAngle"/>
|
||||||
|
<xsd:attribute name="sx" use="optional" type="a:ST_Percentage"/>
|
||||||
|
<xsd:attribute name="sy" use="optional" type="a:ST_Percentage"/>
|
||||||
|
<xsd:attribute name="kx" use="optional" type="a:ST_FixedAngle"/>
|
||||||
|
<xsd:attribute name="ky" use="optional" type="a:ST_FixedAngle"/>
|
||||||
|
<xsd:attribute name="algn" use="optional" type="ST_RectAlignment"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_Reflection">
|
||||||
|
<xsd:attribute name="blurRad" use="optional" type="a:ST_PositiveCoordinate"/>
|
||||||
|
<xsd:attribute name="stA" use="optional" type="a:ST_PositiveFixedPercentage"/>
|
||||||
|
<xsd:attribute name="stPos" use="optional" type="a:ST_PositiveFixedPercentage"/>
|
||||||
|
<xsd:attribute name="endA" use="optional" type="a:ST_PositiveFixedPercentage"/>
|
||||||
|
<xsd:attribute name="endPos" use="optional" type="a:ST_PositiveFixedPercentage"/>
|
||||||
|
<xsd:attribute name="dist" use="optional" type="a:ST_PositiveCoordinate"/>
|
||||||
|
<xsd:attribute name="dir" use="optional" type="a:ST_PositiveFixedAngle"/>
|
||||||
|
<xsd:attribute name="fadeDir" use="optional" type="a:ST_PositiveFixedAngle"/>
|
||||||
|
<xsd:attribute name="sx" use="optional" type="a:ST_Percentage"/>
|
||||||
|
<xsd:attribute name="sy" use="optional" type="a:ST_Percentage"/>
|
||||||
|
<xsd:attribute name="kx" use="optional" type="a:ST_FixedAngle"/>
|
||||||
|
<xsd:attribute name="ky" use="optional" type="a:ST_FixedAngle"/>
|
||||||
|
<xsd:attribute name="algn" use="optional" type="ST_RectAlignment"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_FillTextEffect">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:group ref="EG_FillProperties" minOccurs="0"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_TextOutlineEffect">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:group ref="EG_FillProperties" minOccurs="0"/>
|
||||||
|
<xsd:group ref="EG_LineDashProperties" minOccurs="0"/>
|
||||||
|
<xsd:group ref="EG_LineJoinProperties" minOccurs="0"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="w" use="optional" type="a:ST_LineWidth"/>
|
||||||
|
<xsd:attribute name="cap" use="optional" type="ST_LineCap"/>
|
||||||
|
<xsd:attribute name="cmpd" use="optional" type="ST_CompoundLine"/>
|
||||||
|
<xsd:attribute name="algn" use="optional" type="ST_PenAlignment"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_Scene3D">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="camera" type="CT_Camera"/>
|
||||||
|
<xsd:element name="lightRig" type="CT_LightRig"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_Props3D">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="bevelT" type="CT_Bevel" minOccurs="0"/>
|
||||||
|
<xsd:element name="bevelB" type="CT_Bevel" minOccurs="0"/>
|
||||||
|
<xsd:element name="extrusionClr" type="CT_Color" minOccurs="0"/>
|
||||||
|
<xsd:element name="contourClr" type="CT_Color" minOccurs="0"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="extrusionH" type="a:ST_PositiveCoordinate" use="optional"/>
|
||||||
|
<xsd:attribute name="contourW" type="a:ST_PositiveCoordinate" use="optional"/>
|
||||||
|
<xsd:attribute name="prstMaterial" type="ST_PresetMaterialType" use="optional"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:group name="EG_RPrTextEffects">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="glow" minOccurs="0" type="CT_Glow"/>
|
||||||
|
<xsd:element name="shadow" minOccurs="0" type="CT_Shadow"/>
|
||||||
|
<xsd:element name="reflection" minOccurs="0" type="CT_Reflection"/>
|
||||||
|
<xsd:element name="textOutline" minOccurs="0" type="CT_TextOutlineEffect"/>
|
||||||
|
<xsd:element name="textFill" minOccurs="0" type="CT_FillTextEffect"/>
|
||||||
|
<xsd:element name="scene3d" minOccurs="0" type="CT_Scene3D"/>
|
||||||
|
<xsd:element name="props3d" minOccurs="0" type="CT_Props3D"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:group>
|
||||||
|
<xsd:simpleType name="ST_Ligatures">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="none"/>
|
||||||
|
<xsd:enumeration value="standard"/>
|
||||||
|
<xsd:enumeration value="contextual"/>
|
||||||
|
<xsd:enumeration value="historical"/>
|
||||||
|
<xsd:enumeration value="discretional"/>
|
||||||
|
<xsd:enumeration value="standardContextual"/>
|
||||||
|
<xsd:enumeration value="standardHistorical"/>
|
||||||
|
<xsd:enumeration value="contextualHistorical"/>
|
||||||
|
<xsd:enumeration value="standardDiscretional"/>
|
||||||
|
<xsd:enumeration value="contextualDiscretional"/>
|
||||||
|
<xsd:enumeration value="historicalDiscretional"/>
|
||||||
|
<xsd:enumeration value="standardContextualHistorical"/>
|
||||||
|
<xsd:enumeration value="standardContextualDiscretional"/>
|
||||||
|
<xsd:enumeration value="standardHistoricalDiscretional"/>
|
||||||
|
<xsd:enumeration value="contextualHistoricalDiscretional"/>
|
||||||
|
<xsd:enumeration value="all"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:complexType name="CT_Ligatures">
|
||||||
|
<xsd:attribute name="val" type="ST_Ligatures" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:simpleType name="ST_NumForm">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="default"/>
|
||||||
|
<xsd:enumeration value="lining"/>
|
||||||
|
<xsd:enumeration value="oldStyle"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:complexType name="CT_NumForm">
|
||||||
|
<xsd:attribute name="val" type="ST_NumForm" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:simpleType name="ST_NumSpacing">
|
||||||
|
<xsd:restriction base="xsd:string">
|
||||||
|
<xsd:enumeration value="default"/>
|
||||||
|
<xsd:enumeration value="proportional"/>
|
||||||
|
<xsd:enumeration value="tabular"/>
|
||||||
|
</xsd:restriction>
|
||||||
|
</xsd:simpleType>
|
||||||
|
<xsd:complexType name="CT_NumSpacing">
|
||||||
|
<xsd:attribute name="val" type="ST_NumSpacing" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_StyleSet">
|
||||||
|
<xsd:attribute name="id" type="od06st:ST_UnsignedDecimalNumber" use="required"/>
|
||||||
|
<xsd:attribute name="val" type="ST_OnOff" use="optional"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_StylisticSets">
|
||||||
|
<xsd:sequence minOccurs="0">
|
||||||
|
<xsd:element name="styleSet" minOccurs="0" maxOccurs="unbounded" type="CT_StyleSet"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:group name="EG_RPrOpenType">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="ligatures" minOccurs="0" type="CT_Ligatures"/>
|
||||||
|
<xsd:element name="numForm" minOccurs="0" type="CT_NumForm"/>
|
||||||
|
<xsd:element name="numSpacing" minOccurs="0" type="CT_NumSpacing"/>
|
||||||
|
<xsd:element name="stylisticSets" minOccurs="0" type="CT_StylisticSets"/>
|
||||||
|
<xsd:element name="cntxtAlts" minOccurs="0" type="CT_OnOff"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:group>
|
||||||
|
<xsd:element name="discardImageEditingData" type="CT_OnOff"/>
|
||||||
|
<xsd:element name="defaultImageDpi" type="CT_DefaultImageDpi"/>
|
||||||
|
<xsd:complexType name="CT_DefaultImageDpi">
|
||||||
|
<xsd:attribute name="val" type="w06:ST_DecimalNumber" use="required"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:element name="entityPicker" type="w06:CT_Empty"/>
|
||||||
|
<xsd:complexType name="CT_SdtCheckboxSymbol">
|
||||||
|
<xsd:attribute name="font" type="od06st:ST_String"/>
|
||||||
|
<xsd:attribute name="val" type="w06:ST_ShortHexNumber"/>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:complexType name="CT_SdtCheckbox">
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="checked" type="CT_OnOff" minOccurs="0"/>
|
||||||
|
<xsd:element name="checkedState" type="CT_SdtCheckboxSymbol" minOccurs="0"/>
|
||||||
|
<xsd:element name="uncheckedState" type="CT_SdtCheckboxSymbol" minOccurs="0"/>
|
||||||
|
</xsd:sequence>
|
||||||
|
</xsd:complexType>
|
||||||
|
<xsd:element name="checkbox" type="CT_SdtCheckbox"/>
|
||||||
|
</xsd:schema>
|
||||||
@ -22,8 +22,8 @@ sourceSets {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
api 'net.bytebuddy:byte-buddy:1.14.7'
|
api 'net.bytebuddy:byte-buddy:1.18.5'
|
||||||
api 'net.bytebuddy:byte-buddy-agent:1.14.7'
|
api 'net.bytebuddy:byte-buddy-agent:1.18.5'
|
||||||
api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
|
api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -36,14 +36,14 @@ java {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task compileJava9(type: JavaCompile) {
|
tasks.register('compileJava9', JavaCompile) {
|
||||||
dependsOn 'compileJava'
|
dependsOn 'compileJava'
|
||||||
|
|
||||||
javaCompiler = javaToolchains.compilerFor {
|
javaCompiler = javaToolchains.compilerFor {
|
||||||
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
||||||
}
|
}
|
||||||
sourceCompatibility = 1.9
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 1.9
|
targetCompatibility = 11
|
||||||
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
||||||
source = file(JAVA9_SRC)
|
source = file(JAVA9_SRC)
|
||||||
classpath = files()
|
classpath = files()
|
||||||
@ -56,7 +56,7 @@ task compileJava9(type: JavaCompile) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes (
|
attributes (
|
||||||
|
|||||||
@ -25,7 +25,6 @@ import java.lang.instrument.Instrumentation;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
|
||||||
import java.nio.file.StandardOpenOption;
|
import java.nio.file.StandardOpenOption;
|
||||||
import java.security.ProtectionDomain;
|
import java.security.ProtectionDomain;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@ -78,7 +77,7 @@ public class OOXMLLiteAgent {
|
|||||||
private static final Set<Integer> hashes = new HashSet<>();
|
private static final Set<Integer> hashes = new HashSet<>();
|
||||||
|
|
||||||
static void load(String path) throws IOException {
|
static void load(String path) throws IOException {
|
||||||
logPath = Paths.get(path);
|
logPath = Path.of(path);
|
||||||
if (Files.exists(logPath)) {
|
if (Files.exists(logPath)) {
|
||||||
try (Stream<String> stream = Files.lines(logPath)) {
|
try (Stream<String> stream = Files.lines(logPath)) {
|
||||||
stream.forEach((s) -> hashes.add(s.hashCode()));
|
stream.forEach((s) -> hashes.add(s.hashCode()));
|
||||||
@ -109,7 +108,7 @@ public class OOXMLLiteAgent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void load(String path) throws IOException {
|
void load(String path) throws IOException {
|
||||||
this.logPath = Paths.get(path);
|
this.logPath = Path.of(path);
|
||||||
if (Files.exists(this.logPath)) {
|
if (Files.exists(this.logPath)) {
|
||||||
try (Stream<String> stream = Files.lines(this.logPath)) {
|
try (Stream<String> stream = Files.lines(this.logPath)) {
|
||||||
stream.forEach((s) -> hashes.add(s.hashCode()));
|
stream.forEach((s) -> hashes.add(s.hashCode()));
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
import java.util.regex.Pattern
|
|
||||||
|
|
||||||
/* ====================================================================
|
/* ====================================================================
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
@ -17,8 +15,10 @@ import java.util.regex.Pattern
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
==================================================================== */
|
==================================================================== */
|
||||||
|
|
||||||
final String BEANS_SRC = "${buildDir}/generated-sources"
|
import java.util.regex.Pattern
|
||||||
final String BEANS_RES = "${buildDir}/generated-resources"
|
|
||||||
|
final String BEANS_SRC = layout.buildDirectory.dir('generated-sources').get().asFile.absolutePath
|
||||||
|
final String BEANS_RES = layout.buildDirectory.dir('generated-resources').get().asFile.absolutePath
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
@ -43,7 +43,7 @@ final Pattern MODULE_REGEX = ~'\\.jar$'
|
|||||||
final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
|
final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
|
||||||
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
|
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
|
||||||
|
|
||||||
task generateModuleInfo() {
|
tasks.register('generateModuleInfo') {
|
||||||
File fileIn = file("${OOXML_LITE_REPORT}.clazz")
|
File fileIn = file("${OOXML_LITE_REPORT}.clazz")
|
||||||
File fileOut = file("src/main/java9/module-info.java")
|
File fileOut = file("src/main/java9/module-info.java")
|
||||||
|
|
||||||
@ -65,19 +65,19 @@ task generateModuleInfo() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task compileOoxmlLite(type: Copy) {
|
tasks.register('compileOoxmlLite', Copy) {
|
||||||
dependsOn 'generateModuleInfo', ':poi-ooxml-full:generate_beans', ':poi-ooxml-full:compileJava'
|
dependsOn 'generateModuleInfo', ':poi-ooxml-full:generate_beans', ':poi-ooxml-full:compileJava'
|
||||||
|
|
||||||
// This task is currently always executed, because gradle thinks files with two dollar signs
|
// This task is currently always executed, because gradle thinks files with two dollar signs
|
||||||
// (as in AlternateContentDocument$AlternateContent$Choice.class) are always stale
|
// (as in AlternateContentDocument$AlternateContent$Choice.class) are always stale
|
||||||
|
|
||||||
// copy re-/sources to modules own directory to pacify IntelliJ, which doesn't like the same source dir in multiple modules
|
// copy re-/sources to modules own directory to pacify IntelliJ, which doesn't like the same source dir in multiple modules
|
||||||
from(project(':poi-ooxml-full').buildDir) {
|
from(project(':poi-ooxml-full').layout.buildDirectory.asFile) {
|
||||||
include 'generated-sources/**'
|
include 'generated-sources/**'
|
||||||
include 'generated-resources/**'
|
include 'generated-resources/**'
|
||||||
include 'classes/java/main/**'
|
include 'classes/java/main/**'
|
||||||
}
|
}
|
||||||
into(buildDir)
|
into(layout.buildDirectory.asFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
compileJava {
|
compileJava {
|
||||||
@ -93,8 +93,8 @@ task compileJava9(type: JavaCompile, dependsOn: 'compileJava') {
|
|||||||
javaCompiler = javaToolchains.compilerFor {
|
javaCompiler = javaToolchains.compilerFor {
|
||||||
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
||||||
}
|
}
|
||||||
sourceCompatibility = 1.9
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 1.9
|
targetCompatibility = 11
|
||||||
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
||||||
source = file(JAVA9_SRC)
|
source = file(JAVA9_SRC)
|
||||||
classpath = files()
|
classpath = files()
|
||||||
@ -107,7 +107,7 @@ task compileJava9(type: JavaCompile, dependsOn: 'compileJava') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
File clazzFile = file("${OOXML_LITE_REPORT}.clazz")
|
File clazzFile = file("${OOXML_LITE_REPORT}.clazz")
|
||||||
@ -124,7 +124,7 @@ jar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ignore second module-info.class from poi-ooxml-full
|
// ignore second module-info.class from poi-ooxml-full
|
||||||
// duplicatesStrategy = 'exclude'
|
// duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
includeEmptyDirs = false
|
includeEmptyDirs = false
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
|
|||||||
@ -35,6 +35,7 @@ ctcustomshowlist3419type
|
|||||||
ctcustomxmlblockd3c1type
|
ctcustomxmlblockd3c1type
|
||||||
ctdatarefsb753type
|
ctdatarefsb753type
|
||||||
ctdiagramc1cctype
|
ctdiagramc1cctype
|
||||||
|
ctdocumentbasedf5ctype
|
||||||
cteastasianlayout0841type
|
cteastasianlayout0841type
|
||||||
ctednposd4a3type
|
ctednposd4a3type
|
||||||
cteqarr9667type
|
cteqarr9667type
|
||||||
@ -96,8 +97,10 @@ ctwebpublishobjects30d8type
|
|||||||
ctwrapthrough8b4etype
|
ctwrapthrough8b4etype
|
||||||
ctwraptightae95type
|
ctwraptightae95type
|
||||||
ctwraptopbottom5e13type
|
ctwraptopbottom5e13type
|
||||||
|
fonts7aa2doctype
|
||||||
lockedcanvaselement
|
lockedcanvaselement
|
||||||
polylineelement
|
polylineelement
|
||||||
|
relationships93b3doctype
|
||||||
relidselement
|
relidselement
|
||||||
stalignh768ctype
|
stalignh768ctype
|
||||||
stalignv5abetype
|
stalignv5abetype
|
||||||
@ -125,3 +128,4 @@ ststrokelinestylea509type
|
|||||||
sttargetscreensize4357type
|
sttargetscreensize4357type
|
||||||
stverticalanchor22cctype
|
stverticalanchor22cctype
|
||||||
stwrapside6d02type
|
stwrapside6d02type
|
||||||
|
wsdrd172doctype
|
||||||
@ -28,7 +28,6 @@ configurations {
|
|||||||
exclude group: 'xml-apis', module: 'xml-apis'
|
exclude group: 'xml-apis', module: 'xml-apis'
|
||||||
}
|
}
|
||||||
|
|
||||||
broken
|
|
||||||
tests
|
tests
|
||||||
javadocs
|
javadocs
|
||||||
}
|
}
|
||||||
@ -59,18 +58,23 @@ dependencies {
|
|||||||
api project(':poi-ooxml-full')
|
api project(':poi-ooxml-full')
|
||||||
api project(path: ':poi-ooxml-full', configuration: 'archives')
|
api project(path: ':poi-ooxml-full', configuration: 'archives')
|
||||||
|
|
||||||
|
// Can be very useful in local testing to comment out the 2 poi-ooxml-full lines above
|
||||||
|
// and uncomment the line below to use a pre-built version of poi-ooxml-full.
|
||||||
|
// Try to use the last release version of poi-ooxml-full. You might be unlucky if
|
||||||
|
// recent unreleased changes in poi-ooxml-full are needed.
|
||||||
|
// api "org.apache.poi:poi-ooxml-full:5.5.1"
|
||||||
|
|
||||||
api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
|
api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
|
||||||
api "org.apache.commons:commons-compress:${commonsCompressVersion}"
|
api "org.apache.commons:commons-compress:${commonsCompressVersion}"
|
||||||
api "commons-io:commons-io:${commonsIoVersion}"
|
api "commons-io:commons-io:${commonsIoVersion}"
|
||||||
api 'com.github.virtuald:curvesapi:1.08'
|
api 'com.github.virtuald:curvesapi:1.08'
|
||||||
api "org.apache.logging.log4j:log4j-api:${log4jVersion}"
|
api 'org.apache.commons:commons-collections4:4.5.0'
|
||||||
api 'org.apache.commons:commons-collections4:4.4'
|
|
||||||
|
|
||||||
signingImplementation 'org.apache.santuario:xmlsec:3.0.2'
|
signingImplementation "org.apache.santuario:xmlsec:${xmlSecVersion}"
|
||||||
signingImplementation "org.bouncycastle:bcpkix-jdk18on:${bouncyCastleVersion}"
|
signingImplementation "org.bouncycastle:bcpkix-jdk18on:${bouncyCastleVersion}"
|
||||||
signingImplementation "org.bouncycastle:bcutil-jdk18on:${bouncyCastleVersion}"
|
signingImplementation "org.bouncycastle:bcutil-jdk18on:${bouncyCastleVersion}"
|
||||||
|
|
||||||
rendersignImplementation 'org.apache.santuario:xmlsec:3.0.2'
|
rendersignImplementation "org.apache.santuario:xmlsec:${xmlSecVersion}"
|
||||||
rendersignImplementation "org.bouncycastle:bcpkix-jdk18on:${bouncyCastleVersion}"
|
rendersignImplementation "org.bouncycastle:bcpkix-jdk18on:${bouncyCastleVersion}"
|
||||||
rendersignImplementation "org.bouncycastle:bcutil-jdk18on:${bouncyCastleVersion}"
|
rendersignImplementation "org.bouncycastle:bcutil-jdk18on:${bouncyCastleVersion}"
|
||||||
|
|
||||||
@ -89,6 +93,10 @@ dependencies {
|
|||||||
exclude group: 'xalan', module: 'xalan'
|
exclude group: 'xalan', module: 'xalan'
|
||||||
exclude group: 'xml-apis', module: 'xml-apis'
|
exclude group: 'xml-apis', module: 'xml-apis'
|
||||||
}
|
}
|
||||||
|
renderImplementation("org.apache.xmlgraphics:batik-script:${batikVersion}") {
|
||||||
|
exclude group: 'xalan', module: 'xalan'
|
||||||
|
exclude group: 'xml-apis', module: 'xml-apis'
|
||||||
|
}
|
||||||
|
|
||||||
rendersignImplementation "org.apache.pdfbox:pdfbox:${pdfboxVersion}"
|
rendersignImplementation "org.apache.pdfbox:pdfbox:${pdfboxVersion}"
|
||||||
rendersignImplementation "de.rototor.pdfbox:graphics2d:${graphics2dVersion}"
|
rendersignImplementation "de.rototor.pdfbox:graphics2d:${graphics2dVersion}"
|
||||||
@ -105,7 +113,10 @@ dependencies {
|
|||||||
exclude group: 'xalan', module: 'xalan'
|
exclude group: 'xalan', module: 'xalan'
|
||||||
exclude group: 'xml-apis', module: 'xml-apis'
|
exclude group: 'xml-apis', module: 'xml-apis'
|
||||||
}
|
}
|
||||||
|
rendersignImplementation("org.apache.xmlgraphics:batik-script:${batikVersion}") {
|
||||||
|
exclude group: 'xalan', module: 'xalan'
|
||||||
|
exclude group: 'xml-apis', module: 'xml-apis'
|
||||||
|
}
|
||||||
|
|
||||||
if (!NO_SCRATCHPAD) {
|
if (!NO_SCRATCHPAD) {
|
||||||
testImplementation project(':poi-scratchpad')
|
testImplementation project(':poi-scratchpad')
|
||||||
@ -114,50 +125,40 @@ dependencies {
|
|||||||
testImplementation project(path:':poi', configuration:'tests')
|
testImplementation project(path:':poi', configuration:'tests')
|
||||||
testImplementation project(path:':poi-ooxml-lite-agent', configuration: 'archives')
|
testImplementation project(path:':poi-ooxml-lite-agent', configuration: 'archives')
|
||||||
testRuntimeOnly "org.apiguardian:apiguardian-api:${apiGuardianVersion}"
|
testRuntimeOnly "org.apiguardian:apiguardian-api:${apiGuardianVersion}"
|
||||||
testImplementation 'org.xmlunit:xmlunit-core:2.9.1'
|
testImplementation 'org.xmlunit:xmlunit-core:2.11.0'
|
||||||
testImplementation 'org.reflections:reflections:0.10.2'
|
testImplementation 'org.reflections:reflections:0.10.2'
|
||||||
testImplementation 'org.openjdk.jmh:jmh-core:1.36'
|
testImplementation 'org.openjdk.jmh:jmh-core:1.36'
|
||||||
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.36'
|
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.36'
|
||||||
testImplementation 'com.google.guava:guava:32.1.1-jre'
|
testImplementation 'com.google.guava:guava:33.5.0-jre'
|
||||||
testImplementation 'org.tukaani:xz:1.9'
|
|
||||||
testImplementation 'com.github.rzymek:opczip:1.2.0'
|
testImplementation 'com.github.rzymek:opczip:1.2.0'
|
||||||
|
|
||||||
// prevent slf4j warnings coming from xmlsec -> slf4j-api 1.7.x dependency
|
// prevent slf4j warnings coming from xmlsec -> slf4j-api 1.7.x dependency
|
||||||
// see https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/
|
// see https://logging.apache.org/log4j/2.x/log4j-slf4j-impl/
|
||||||
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
|
testImplementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
|
||||||
testImplementation 'org.slf4j:slf4j-simple:2.0.9'
|
testImplementation 'org.slf4j:slf4j-simple:2.0.17'
|
||||||
|
|
||||||
broken("org.apache.xmlgraphics:batik-script:${batikVersion}"){
|
|
||||||
exclude group: 'xalan', module: 'xalan'
|
|
||||||
exclude group: 'xml-apis', module: 'xml-apis'
|
|
||||||
}
|
|
||||||
|
|
||||||
javadocs project(':poi')
|
javadocs project(':poi')
|
||||||
javadocs project(':poi-scratchpad')
|
javadocs project(':poi-scratchpad')
|
||||||
}
|
}
|
||||||
|
|
||||||
final String MODULE_NAME = 'org.apache.poi.ooxml'
|
final String MODULE_NAME = 'org.apache.poi.ooxml'
|
||||||
final Pattern MODULE_NOT_REGEX = ~'(poi[/\\\\][^/\\\\]+$|batik-script)'
|
final Pattern MODULE_NOT_REGEX = ~'(poi[/\\\\][^/\\\\]+$)'
|
||||||
final Pattern MODULE_REGEX = ~'\\.jar$'
|
final Pattern MODULE_REGEX = ~'\\.jar$'
|
||||||
final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
|
final List MAIN_MODULE_PATH = sourceSets.main.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX }.collect{ it.parent }.unique()
|
||||||
final List TEST_MODULE_PATH = sourceSets.test.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX && !(it.path =~ MODULE_NOT_REGEX) }.collect{ it.parent }.unique() + files("build/brokenJars")
|
final List TEST_MODULE_PATH = sourceSets.test.runtimeClasspath.findAll{ it.path =~ MODULE_REGEX && !(it.path =~ MODULE_NOT_REGEX) }.collect{ it.parent }.unique()
|
||||||
|
|
||||||
final String OOXML_LITE_AGENT = "../build/dist/maven/poi-ooxml-lite-agent/poi-ooxml-lite-agent-${project.version}.jar"
|
final String OOXML_LITE_AGENT = "../build/dist/maven/poi-ooxml-lite-agent/poi-ooxml-lite-agent-${project.version}.jar"
|
||||||
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
|
final String OOXML_LITE_REPORT = '../src/resources/ooxml-lite-report'
|
||||||
final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
|
final String OOXML_LITE_INCLUDES = "^(com/microsoft/schemas|org/(etsi|openxmlformats|w3/)|org/apache/poi/schemas)"
|
||||||
|
|
||||||
compileJava {
|
tasks.register('compileJava9', JavaCompile) {
|
||||||
dependsOn 'fixBatik', 'cleanupBatik'
|
|
||||||
}
|
|
||||||
|
|
||||||
task compileJava9(type: JavaCompile) {
|
|
||||||
dependsOn 'compileJava', ':poi:jar'
|
dependsOn 'compileJava', ':poi:jar'
|
||||||
|
|
||||||
javaCompiler = javaToolchains.compilerFor {
|
javaCompiler = javaToolchains.compilerFor {
|
||||||
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
||||||
}
|
}
|
||||||
sourceCompatibility = 1.9
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 1.9
|
targetCompatibility = 11
|
||||||
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
|
||||||
source = file(JAVA9_SRC)
|
source = file(JAVA9_SRC)
|
||||||
classpath = files()
|
classpath = files()
|
||||||
@ -167,14 +168,14 @@ task compileJava9(type: JavaCompile) {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
task compileTest9(type: JavaCompile) {
|
tasks.register('compileTest9', JavaCompile) {
|
||||||
dependsOn 'compileTestJava', ':poi:testJar'
|
dependsOn 'compileTestJava', ':poi:testJar'
|
||||||
|
|
||||||
javaCompiler = javaToolchains.compilerFor {
|
javaCompiler = javaToolchains.compilerFor {
|
||||||
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
|
||||||
}
|
}
|
||||||
sourceCompatibility = 1.9
|
sourceCompatibility = 11
|
||||||
targetCompatibility = 1.9
|
targetCompatibility = 11
|
||||||
destinationDirectory = file(TEST9_OUT + VERSIONS9)
|
destinationDirectory = file(TEST9_OUT + VERSIONS9)
|
||||||
source = file(TEST9_SRC)
|
source = file(TEST9_SRC)
|
||||||
options.compilerArgs = [
|
options.compilerArgs = [
|
||||||
@ -186,7 +187,7 @@ task compileTest9(type: JavaCompile) {
|
|||||||
|
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
|
||||||
|
|
||||||
manifest {
|
manifest {
|
||||||
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
|
||||||
@ -196,11 +197,11 @@ jar {
|
|||||||
// Create a separate jar for test-code to depend on it in other projects
|
// Create a separate jar for test-code to depend on it in other projects
|
||||||
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
|
||||||
task testJar(type: Jar, dependsOn: testClasses) {
|
task testJar(type: Jar, dependsOn: testClasses) {
|
||||||
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-tests")
|
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-tests")
|
||||||
|
|
||||||
setArchiveClassifier 'tests'
|
setArchiveClassifier 'tests'
|
||||||
// ignore second module-info.class from main
|
// ignore second module-info.class from main
|
||||||
duplicatesStrategy = 'exclude'
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
|
||||||
from sourceSets.test.output + sourceSets.main.output
|
from sourceSets.test.output + sourceSets.main.output
|
||||||
|
|
||||||
@ -209,35 +210,16 @@ task testJar(type: Jar, dependsOn: testClasses) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// based on https://github.com/moditect/moditect-gradle-plugin/issues/12
|
|
||||||
task fixBatik(type: Zip) {
|
|
||||||
ant.mkdir(dir: "${buildDir}/brokenJars")
|
|
||||||
archiveFileName = "batik-script-${batikVersion}.jar"
|
|
||||||
destinationDirectory = file("${buildDir}/brokenJars")
|
|
||||||
from zipTree(configurations.broken.files.find{ f -> f.name.startsWith("batik-script") })
|
|
||||||
filesMatching("**/org.apache.batik.script.InterpreterFactory") {
|
|
||||||
it.filter{ it2 -> it2.contains("Rhino") ? "#" + it2 : it2 }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
task cleanupBatik(type: Delete) {
|
|
||||||
// remove older files to avoid build failures because of duplicate modules
|
|
||||||
delete fileTree("${buildDir}/brokenJars/").matching {
|
|
||||||
include "*.jar"
|
|
||||||
exclude "batik*-${batikVersion}.jar"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
javadoc {
|
javadoc {
|
||||||
failOnError = true
|
failOnError = true
|
||||||
doFirst {
|
doFirst {
|
||||||
options {
|
options {
|
||||||
if (jdkVersion > 8) addBooleanOption('html5', true)
|
addBooleanOption('html5', true)
|
||||||
links 'https://poi.apache.org/apidocs/dev/'
|
links 'https://poi.apache.org/apidocs/dev/'
|
||||||
links 'https://docs.oracle.com/javase/8/docs/api/'
|
if (jdkVersion >= 23) links 'https://docs.oracle.com/en/java/javase/23/docs/api/' else links 'https://docs.oracle.com/en/java/javase/11/docs/api/'
|
||||||
use = true
|
use = true
|
||||||
splitIndex = true
|
splitIndex = true
|
||||||
source = "1.8"
|
source = "11"
|
||||||
classpath += configurations.javadocs.files
|
classpath += configurations.javadocs.files
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -268,9 +250,6 @@ test {
|
|||||||
dependsOn { testJar }
|
dependsOn { testJar }
|
||||||
|
|
||||||
systemProperties['junit.jupiter.execution.parallel.enabled'] = 'true'
|
systemProperties['junit.jupiter.execution.parallel.enabled'] = 'true'
|
||||||
if (jdkVersion == 8) {
|
|
||||||
systemProperties['sun.java2d.renderer'] = 'sun.java2d.marlin.MarlinRenderingEngine'
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NO_SCRATCHPAD) {
|
if (NO_SCRATCHPAD) {
|
||||||
useJUnitPlatform {
|
useJUnitPlatform {
|
||||||
@ -280,17 +259,13 @@ test {
|
|||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
jvmArgs += [
|
jvmArgs += [
|
||||||
"-Xverify:all",
|
'-Xverify:all',
|
||||||
"-XX:ErrorFile=../build/hs_err_pid%p.log",
|
'-XX:ErrorFile=../build/hs_err_pid%p.log',
|
||||||
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}"
|
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
|
||||||
]
|
|
||||||
if (jdkVersion > 8) {
|
|
||||||
jvmArgs += [
|
|
||||||
'--add-modules', MODULE_NAME,
|
'--add-modules', MODULE_NAME,
|
||||||
'--module-path', '../build/dist/maven/poi-ooxml-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
|
'--module-path', '../build/dist/maven/poi-ooxml-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
|
|||||||
@ -14,28 +14,31 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
==================================================================== */
|
==================================================================== */
|
||||||
|
package org.apache.poi.ooxml;
|
||||||
|
|
||||||
package org.apache.poi.ooxml.util;
|
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
|
||||||
|
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
|
||||||
|
|
||||||
import org.apache.poi.util.Removal;
|
|
||||||
import org.apache.poi.util.XMLHelper;
|
|
||||||
import org.xml.sax.SAXException;
|
|
||||||
import org.xml.sax.XMLReader;
|
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides handy methods for working with SAX parsers and readers
|
* Represents a hyperlink relationship.
|
||||||
* @deprecated use {@link XMLHelper}
|
*
|
||||||
|
* @since 5.3.0
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
public class HyperlinkRelationship extends ReferenceRelationship {
|
||||||
@Removal(version = "6.0.0")
|
|
||||||
public final class SAXHelper {
|
|
||||||
/**
|
/**
|
||||||
* Creates a new SAX XMLReader, with sensible defaults
|
* Initializes a new instance of the HyperlinkRelationship.
|
||||||
|
*
|
||||||
|
* @param hyperlinkUri The target uri of the hyperlink relationship.
|
||||||
|
* @param isExternal Is the URI external.
|
||||||
|
* @param id The relationship ID.
|
||||||
*/
|
*/
|
||||||
public static XMLReader newXMLReader() throws SAXException, ParserConfigurationException {
|
protected HyperlinkRelationship(POIXMLDocumentPart container, URI hyperlinkUri, boolean isExternal, String id) {
|
||||||
return XMLHelper.newXMLReader();
|
super(container, hyperlinkUri, isExternal, PackageRelationshipTypes.HYPERLINK_PART, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRelationshipType() {
|
||||||
|
return PackageRelationshipTypes.HYPERLINK_PART;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ public abstract class POIXMLDocument extends POIXMLDocumentPart implements Close
|
|||||||
* @return the document's embedded files
|
* @return the document's embedded files
|
||||||
*
|
*
|
||||||
* @throws OpenXML4JException if the embedded parts can't be determined
|
* @throws OpenXML4JException if the embedded parts can't be determined
|
||||||
* @since POI 4.0.0
|
* @since 4.0.0
|
||||||
*/
|
*/
|
||||||
public abstract List<PackagePart> getAllEmbeddedParts() throws OpenXML4JException;
|
public abstract List<PackagePart> getAllEmbeddedParts() throws OpenXML4JException;
|
||||||
|
|
||||||
|
|||||||
@ -23,10 +23,11 @@ import java.util.Collections;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||||
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
|
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
|
||||||
import org.apache.poi.openxml4j.exceptions.PartAlreadyExistsException;
|
import org.apache.poi.openxml4j.exceptions.PartAlreadyExistsException;
|
||||||
@ -38,13 +39,13 @@ import org.apache.poi.openxml4j.opc.PackageRelationshipCollection;
|
|||||||
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
|
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
|
||||||
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
|
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
|
||||||
import org.apache.poi.openxml4j.opc.TargetMode;
|
import org.apache.poi.openxml4j.opc.TargetMode;
|
||||||
import org.apache.poi.util.IOUtils;
|
|
||||||
import org.apache.poi.util.Internal;
|
import org.apache.poi.util.Internal;
|
||||||
import org.apache.poi.xddf.usermodel.chart.XDDFChart;
|
import org.apache.poi.xddf.usermodel.chart.XDDFChart;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFRelation;
|
import org.apache.poi.xssf.usermodel.XSSFRelation;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFRelation;
|
import org.apache.poi.xwpf.usermodel.XWPFRelation;
|
||||||
|
import org.apache.xmlbeans.XmlException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents an entry of a OOXML package.
|
* Represents an entry of a OOXML package.
|
||||||
@ -53,12 +54,13 @@ import org.apache.poi.xwpf.usermodel.XWPFRelation;
|
|||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public class POIXMLDocumentPart {
|
public class POIXMLDocumentPart {
|
||||||
private static final Logger LOG = LogManager.getLogger(POIXMLDocumentPart.class);
|
private static final Logger LOG = PoiLogManager.getLogger(POIXMLDocumentPart.class);
|
||||||
|
|
||||||
private String coreDocumentRel = PackageRelationshipTypes.CORE_DOCUMENT;
|
private String coreDocumentRel = PackageRelationshipTypes.CORE_DOCUMENT;
|
||||||
private PackagePart packagePart;
|
private PackagePart packagePart;
|
||||||
private POIXMLDocumentPart parent;
|
private POIXMLDocumentPart parent;
|
||||||
private final Map<String, RelationPart> relations = new LinkedHashMap<>();
|
private final Map<String, RelationPart> relations = new LinkedHashMap<>();
|
||||||
|
private final Map<String, ReferenceRelationship> referenceRelationships = new LinkedHashMap<>();
|
||||||
private boolean isCommitted = false;
|
private boolean isCommitted = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -166,7 +168,7 @@ public class POIXMLDocumentPart {
|
|||||||
*
|
*
|
||||||
* @param part - The package part that holds xml data representing this sheet.
|
* @param part - The package part that holds xml data representing this sheet.
|
||||||
* @see #read(POIXMLFactory, Map)
|
* @see #read(POIXMLFactory, Map)
|
||||||
* @since POI 3.14-Beta1
|
* @since 3.14-Beta1
|
||||||
*/
|
*/
|
||||||
public POIXMLDocumentPart(PackagePart part) {
|
public POIXMLDocumentPart(PackagePart part) {
|
||||||
this(null, part);
|
this(null, part);
|
||||||
@ -179,7 +181,7 @@ public class POIXMLDocumentPart {
|
|||||||
* @param parent - Parent part
|
* @param parent - Parent part
|
||||||
* @param part - The package part that holds xml data representing this sheet.
|
* @param part - The package part that holds xml data representing this sheet.
|
||||||
* @see #read(POIXMLFactory, Map)
|
* @see #read(POIXMLFactory, Map)
|
||||||
* @since POI 3.14-Beta1
|
* @since 3.14-Beta1
|
||||||
*/
|
*/
|
||||||
public POIXMLDocumentPart(POIXMLDocumentPart parent, PackagePart part) {
|
public POIXMLDocumentPart(POIXMLDocumentPart parent, PackagePart part) {
|
||||||
this.packagePart = part;
|
this.packagePart = part;
|
||||||
@ -231,9 +233,14 @@ public class POIXMLDocumentPart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of child relations for this POIXMLDocumentPart
|
* Returns the list of child relations for this POIXMLDocumentPart.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Since POI 5.3.0, Reference Relationships are stored separately from other child relations.
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* @return child relations
|
* @return child relations
|
||||||
|
* @see #getReferenceRelationships() for reference relationships (e.g. hyperlinks)
|
||||||
*/
|
*/
|
||||||
public final List<RelationPart> getRelationParts() {
|
public final List<RelationPart> getRelationParts() {
|
||||||
List<RelationPart> l = new ArrayList<>(relations.values());
|
List<RelationPart> l = new ArrayList<>(relations.values());
|
||||||
@ -252,7 +259,7 @@ public class POIXMLDocumentPart {
|
|||||||
*/
|
*/
|
||||||
public final POIXMLDocumentPart getRelationById(String id) {
|
public final POIXMLDocumentPart getRelationById(String id) {
|
||||||
RelationPart rp = getRelationPartById(id);
|
RelationPart rp = getRelationPartById(id);
|
||||||
return (rp == null) ? null : rp.getDocumentPart();
|
return rp == null ? null : rp.getDocumentPart();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -640,6 +647,9 @@ public class POIXMLDocumentPart {
|
|||||||
|
|
||||||
// scan breadth-first, so parent-relations are hopefully the shallowest element
|
// scan breadth-first, so parent-relations are hopefully the shallowest element
|
||||||
for (PackageRelationship rel : rels) {
|
for (PackageRelationship rel : rels) {
|
||||||
|
if (Objects.equals(rel.getRelationshipType(), PackageRelationshipTypes.HYPERLINK_PART)) {
|
||||||
|
referenceRelationships.put(rel.getId(), new HyperlinkRelationship(this, rel.getTargetURI(), rel.getTargetMode() == TargetMode.EXTERNAL, rel.getId()));
|
||||||
|
} else {
|
||||||
if (rel.getTargetMode() == TargetMode.INTERNAL) {
|
if (rel.getTargetMode() == TargetMode.INTERNAL) {
|
||||||
URI uri = rel.getTargetURI();
|
URI uri = rel.getTargetURI();
|
||||||
|
|
||||||
@ -659,8 +669,22 @@ public class POIXMLDocumentPart {
|
|||||||
|
|
||||||
POIXMLDocumentPart childPart = context.get(p);
|
POIXMLDocumentPart childPart = context.get(p);
|
||||||
if (childPart == null) {
|
if (childPart == null) {
|
||||||
|
try {
|
||||||
childPart = factory.createDocumentPart(this, p);
|
childPart = factory.createDocumentPart(this, p);
|
||||||
//here we are checking if part if embedded and excel then set it to chart class
|
} catch (POIXMLException e) {
|
||||||
|
if (e.getCause() instanceof XmlException
|
||||||
|
&& XSSFRelation.CHART.getRelation().equals(rel.getRelationshipType())) {
|
||||||
|
// https://github.com/apache/poi/pull/982
|
||||||
|
// only allow this skipping event for charts
|
||||||
|
// we need to be careful about not catching every exception here because
|
||||||
|
// issues like zip bomb exceptions need to thrown and not ignored
|
||||||
|
LOG.atWarn().log("Skipped unsupported part: {}", e.getMessage());
|
||||||
|
continue;
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//here we are checking if part is embedded and excel then set it to chart class
|
||||||
//so that at the time to writing we can also write updated embedded part
|
//so that at the time to writing we can also write updated embedded part
|
||||||
if (this instanceof XDDFChart && childPart instanceof XSSFWorkbook) {
|
if (this instanceof XDDFChart && childPart instanceof XSSFWorkbook) {
|
||||||
((XDDFChart) this).setWorkbook((XSSFWorkbook) childPart);
|
((XDDFChart) this).setWorkbook((XSSFWorkbook) childPart);
|
||||||
@ -674,6 +698,7 @@ public class POIXMLDocumentPart {
|
|||||||
addRelation(rel, childPart);
|
addRelation(rel, childPart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (POIXMLDocumentPart childPart : readLater) {
|
for (POIXMLDocumentPart childPart : readLater) {
|
||||||
childPart.read(factory, context);
|
childPart.read(factory, context);
|
||||||
@ -734,6 +759,63 @@ public class POIXMLDocumentPart {
|
|||||||
part.onDocumentRead();
|
part.onDocumentRead();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the reference relationship to the specified part in this package.
|
||||||
|
*
|
||||||
|
* @param relId the part which is to be removed
|
||||||
|
* @return true, if the relation was removed
|
||||||
|
* @since 5.3.0
|
||||||
|
*/
|
||||||
|
public final boolean removeReferenceRelationship(String relId) {
|
||||||
|
ReferenceRelationship existing = referenceRelationships.remove(relId);
|
||||||
|
if (existing != null) {
|
||||||
|
packagePart.removeRelationship(relId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the reference relationship with the specified id.
|
||||||
|
*
|
||||||
|
* @param relId the relation id
|
||||||
|
* @return the reference relationship or {@code null} if not found
|
||||||
|
* @since 5.3.0
|
||||||
|
*/
|
||||||
|
public final ReferenceRelationship getReferenceRelationship(String relId) {
|
||||||
|
return referenceRelationships.get(relId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new reference relationship for this POIXMLDocumentPart.
|
||||||
|
*
|
||||||
|
* @param uri the URI of the target part
|
||||||
|
* @param isExternal true, if the target is an external resource
|
||||||
|
* @param relId the relation id
|
||||||
|
* @return the created reference relationship
|
||||||
|
* @since 5.3.0
|
||||||
|
*/
|
||||||
|
public final HyperlinkRelationship createHyperlink(URI uri, boolean isExternal, String relId) {
|
||||||
|
packagePart.addRelationship(uri, isExternal ? TargetMode.EXTERNAL : TargetMode.INTERNAL,
|
||||||
|
PackageRelationshipTypes.HYPERLINK_PART, relId);
|
||||||
|
HyperlinkRelationship hyperlink = new HyperlinkRelationship(this, uri, isExternal, relId);
|
||||||
|
referenceRelationships.put(relId, hyperlink);
|
||||||
|
return hyperlink;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an unmodifiable list of reference relationships for this POIXMLDocumentPart.
|
||||||
|
*
|
||||||
|
* @return reference relationships
|
||||||
|
* @since 5.3.0
|
||||||
|
* @see #getRelationParts() for child relations
|
||||||
|
*/
|
||||||
|
public final List<ReferenceRelationship> getReferenceRelationships() {
|
||||||
|
List<ReferenceRelationship> list = new ArrayList<>(referenceRelationships.values());
|
||||||
|
return Collections.unmodifiableList(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the core document part
|
* Retrieves the core document part
|
||||||
*
|
*
|
||||||
@ -746,7 +828,7 @@ public class POIXMLDocumentPart {
|
|||||||
if (coreRel != null) {
|
if (coreRel != null) {
|
||||||
PackagePart pp = pkg.getPart(coreRel);
|
PackagePart pp = pkg.getPart(coreRel);
|
||||||
if (pp == null) {
|
if (pp == null) {
|
||||||
IOUtils.closeQuietly(pkg);
|
pkg.revert();
|
||||||
throw new POIXMLException("OOXML file structure broken/invalid - core document '" + coreRel.getTargetURI() + "' not found.");
|
throw new POIXMLException("OOXML file structure broken/invalid - core document '" + coreRel.getTargetURI() + "' not found.");
|
||||||
}
|
}
|
||||||
return pp;
|
return pp;
|
||||||
@ -754,16 +836,16 @@ public class POIXMLDocumentPart {
|
|||||||
|
|
||||||
coreRel = pkg.getRelationshipsByType(PackageRelationshipTypes.STRICT_CORE_DOCUMENT).getRelationship(0);
|
coreRel = pkg.getRelationshipsByType(PackageRelationshipTypes.STRICT_CORE_DOCUMENT).getRelationship(0);
|
||||||
if (coreRel != null) {
|
if (coreRel != null) {
|
||||||
IOUtils.closeQuietly(pkg);
|
pkg.revert();
|
||||||
throw new POIXMLException("Strict OOXML isn't currently supported, please see bug #57699");
|
throw new POIXMLException("Strict OOXML isn't currently supported, please see bug #57699");
|
||||||
}
|
}
|
||||||
|
|
||||||
IOUtils.closeQuietly(pkg);
|
pkg.revert();
|
||||||
throw new POIXMLException("OOXML file structure broken/invalid - no core document found!");
|
throw new POIXMLException("OOXML file structure broken/invalid - no core document found!");
|
||||||
} catch (POIXMLException e) {
|
} catch (POIXMLException e) {
|
||||||
throw e;
|
throw e;
|
||||||
} catch (RuntimeException e) {
|
} catch (RuntimeException e) {
|
||||||
IOUtils.closeQuietly(pkg);
|
pkg.revert();
|
||||||
throw new POIXMLException("OOXML file structure broken/invalid", e);
|
throw new POIXMLException("OOXML file structure broken/invalid", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ package org.apache.poi.ooxml;
|
|||||||
/**
|
/**
|
||||||
* Indicates a generic OOXML error.
|
* Indicates a generic OOXML error.
|
||||||
*/
|
*/
|
||||||
public final class POIXMLException extends RuntimeException{
|
public final class POIXMLException extends RuntimeException {
|
||||||
/**
|
/**
|
||||||
* Create a new {@code POIXMLException} with no
|
* Create a new {@code POIXMLException} with no
|
||||||
* detail message.
|
* detail message.
|
||||||
|
|||||||
@ -18,8 +18,8 @@ package org.apache.poi.ooxml;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
import org.apache.poi.ooxml.POIXMLRelation.PackagePartConstructor;
|
import org.apache.poi.ooxml.POIXMLRelation.PackagePartConstructor;
|
||||||
import org.apache.poi.ooxml.POIXMLRelation.ParentPartConstructor;
|
import org.apache.poi.ooxml.POIXMLRelation.ParentPartConstructor;
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||||
@ -31,7 +31,7 @@ import org.apache.xmlbeans.XmlException;
|
|||||||
* Defines a factory API that enables sub-classes to create instances of <code>POIXMLDocumentPart</code>
|
* Defines a factory API that enables sub-classes to create instances of <code>POIXMLDocumentPart</code>
|
||||||
*/
|
*/
|
||||||
public abstract class POIXMLFactory {
|
public abstract class POIXMLFactory {
|
||||||
private static final Logger LOGGER = LogManager.getLogger(POIXMLFactory.class);
|
private static final Logger LOGGER = PoiLogManager.getLogger(POIXMLFactory.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a POIXMLDocumentPart from existing package part and relation. This method is called
|
* Create a POIXMLDocumentPart from existing package part and relation. This method is called
|
||||||
@ -75,7 +75,7 @@ public abstract class POIXMLFactory {
|
|||||||
* @param relationshipType the relationship type of the descriptor
|
* @param relationshipType the relationship type of the descriptor
|
||||||
* @return the descriptor or null if type is unknown
|
* @return the descriptor or null if type is unknown
|
||||||
*
|
*
|
||||||
* @since POI 3.14-Beta1
|
* @since 3.14-Beta1
|
||||||
*/
|
*/
|
||||||
protected abstract POIXMLRelation getDescriptor(String relationshipType);
|
protected abstract POIXMLRelation getDescriptor(String relationshipType);
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ public abstract class POIXMLFactory {
|
|||||||
*
|
*
|
||||||
* @throws POIXMLException if the relations are erroneous or the part is not related
|
* @throws POIXMLException if the relations are erroneous or the part is not related
|
||||||
*
|
*
|
||||||
* @since POI 3.14-Beta1
|
* @since 3.14-Beta1
|
||||||
*/
|
*/
|
||||||
protected PackageRelationship getPackageRelationship(POIXMLDocumentPart parent, PackagePart part) {
|
protected PackageRelationship getPackageRelationship(POIXMLDocumentPart parent, PackagePart part) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -316,11 +316,11 @@ public class POIXMLProperties {
|
|||||||
public void setLastPrinted(String date) throws InvalidFormatException {
|
public void setLastPrinted(String date) throws InvalidFormatException {
|
||||||
part.setLastPrintedProperty(date);
|
part.setLastPrintedProperty(date);
|
||||||
}
|
}
|
||||||
/** @since POI 3.15 beta 3 */
|
/** @since 3.15 beta 3 */
|
||||||
public String getLastModifiedByUser() {
|
public String getLastModifiedByUser() {
|
||||||
return part.getLastModifiedByProperty().orElse(null);
|
return part.getLastModifiedByProperty().orElse(null);
|
||||||
}
|
}
|
||||||
/** @since POI 3.15 beta 3 */
|
/** @since 3.15 beta 3 */
|
||||||
public void setLastModifiedByUser(String user) {
|
public void setLastModifiedByUser(String user) {
|
||||||
part.setLastModifiedByProperty(user);
|
part.setLastModifiedByProperty(user);
|
||||||
}
|
}
|
||||||
@ -349,7 +349,7 @@ public class POIXMLProperties {
|
|||||||
/**
|
/**
|
||||||
* Sets the version property.
|
* Sets the version property.
|
||||||
* @param version property value
|
* @param version property value
|
||||||
* @since POI 5.2.3
|
* @since 5.2.3
|
||||||
*/
|
*/
|
||||||
public void setVersion(String version) {
|
public void setVersion(String version) {
|
||||||
part.setVersionProperty(version);
|
part.setVersionProperty(version);
|
||||||
@ -358,7 +358,7 @@ public class POIXMLProperties {
|
|||||||
/**
|
/**
|
||||||
* Returns the version property value.
|
* Returns the version property value.
|
||||||
* @return version property (can be null)
|
* @return version property (can be null)
|
||||||
* @since POI 5.2.3
|
* @since 5.2.3
|
||||||
*/
|
*/
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return part.getVersionProperty().orElse(null);
|
return part.getVersionProperty().orElse(null);
|
||||||
@ -399,7 +399,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setTemplate(String template) {
|
public void setTemplate(String template) {
|
||||||
props.getProperties().setTemplate(template);
|
props.getProperties().setTemplate(template);
|
||||||
}
|
}
|
||||||
@ -409,7 +409,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setManager(String manager) {
|
public void setManager(String manager) {
|
||||||
props.getProperties().setManager(manager);
|
props.getProperties().setManager(manager);
|
||||||
}
|
}
|
||||||
@ -419,7 +419,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setCompany(String company) {
|
public void setCompany(String company) {
|
||||||
props.getProperties().setCompany(company);
|
props.getProperties().setCompany(company);
|
||||||
}
|
}
|
||||||
@ -429,7 +429,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setPresentationFormat(String presentationFormat) {
|
public void setPresentationFormat(String presentationFormat) {
|
||||||
props.getProperties().setPresentationFormat(presentationFormat);
|
props.getProperties().setPresentationFormat(presentationFormat);
|
||||||
}
|
}
|
||||||
@ -439,7 +439,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setApplication(String application) {
|
public void setApplication(String application) {
|
||||||
props.getProperties().setApplication(application);
|
props.getProperties().setApplication(application);
|
||||||
}
|
}
|
||||||
@ -449,7 +449,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setAppVersion(String appVersion) {
|
public void setAppVersion(String appVersion) {
|
||||||
props.getProperties().setAppVersion(appVersion);
|
props.getProperties().setAppVersion(appVersion);
|
||||||
}
|
}
|
||||||
@ -460,7 +460,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setPages(int pages) {
|
public void setPages(int pages) {
|
||||||
props.getProperties().setPages(pages);
|
props.getProperties().setPages(pages);
|
||||||
}
|
}
|
||||||
@ -470,7 +470,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setWords(int words) {
|
public void setWords(int words) {
|
||||||
props.getProperties().setWords(words);
|
props.getProperties().setWords(words);
|
||||||
}
|
}
|
||||||
@ -480,7 +480,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setCharacters(int characters) {
|
public void setCharacters(int characters) {
|
||||||
props.getProperties().setCharacters(characters);
|
props.getProperties().setCharacters(characters);
|
||||||
}
|
}
|
||||||
@ -490,7 +490,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setCharactersWithSpaces(int charactersWithSpaces) {
|
public void setCharactersWithSpaces(int charactersWithSpaces) {
|
||||||
props.getProperties().setCharactersWithSpaces(charactersWithSpaces);
|
props.getProperties().setCharactersWithSpaces(charactersWithSpaces);
|
||||||
}
|
}
|
||||||
@ -500,7 +500,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setLines(int lines) {
|
public void setLines(int lines) {
|
||||||
props.getProperties().setLines(lines);
|
props.getProperties().setLines(lines);
|
||||||
}
|
}
|
||||||
@ -510,7 +510,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setParagraphs(int paragraphs) {
|
public void setParagraphs(int paragraphs) {
|
||||||
props.getProperties().setParagraphs(paragraphs);
|
props.getProperties().setParagraphs(paragraphs);
|
||||||
}
|
}
|
||||||
@ -520,7 +520,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setSlides(int slides) {
|
public void setSlides(int slides) {
|
||||||
props.getProperties().setSlides(slides);
|
props.getProperties().setSlides(slides);
|
||||||
}
|
}
|
||||||
@ -530,7 +530,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setNotes(int notes) {
|
public void setNotes(int notes) {
|
||||||
props.getProperties().setNotes(notes);
|
props.getProperties().setNotes(notes);
|
||||||
}
|
}
|
||||||
@ -540,7 +540,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setTotalTime(int totalTime) {
|
public void setTotalTime(int totalTime) {
|
||||||
props.getProperties().setTotalTime(totalTime);
|
props.getProperties().setTotalTime(totalTime);
|
||||||
}
|
}
|
||||||
@ -550,7 +550,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setHiddenSlides(int hiddenSlides) {
|
public void setHiddenSlides(int hiddenSlides) {
|
||||||
props.getProperties().setHiddenSlides(hiddenSlides);
|
props.getProperties().setHiddenSlides(hiddenSlides);
|
||||||
}
|
}
|
||||||
@ -560,7 +560,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setMMClips(int mmClips) {
|
public void setMMClips(int mmClips) {
|
||||||
props.getProperties().setMMClips(mmClips);
|
props.getProperties().setMMClips(mmClips);
|
||||||
}
|
}
|
||||||
@ -571,7 +571,7 @@ public class POIXMLProperties {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
/** @since POI 4.1.1 */
|
/** @since 4.1.1 */
|
||||||
public void setHyperlinkBase(String hyperlinkBase) {
|
public void setHyperlinkBase(String hyperlinkBase) {
|
||||||
props.getProperties().setHyperlinkBase(hyperlinkBase);
|
props.getProperties().setHyperlinkBase(hyperlinkBase);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,8 +20,8 @@ import java.io.IOException;
|
|||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||||
import org.apache.poi.openxml4j.opc.PackagePart;
|
import org.apache.poi.openxml4j.opc.PackagePart;
|
||||||
import org.apache.poi.openxml4j.opc.PackagePartName;
|
import org.apache.poi.openxml4j.opc.PackagePartName;
|
||||||
@ -51,7 +51,7 @@ public abstract class POIXMLRelation {
|
|||||||
POIXMLDocumentPart init(POIXMLDocumentPart parent, PackagePart part) throws IOException, XmlException;
|
POIXMLDocumentPart init(POIXMLDocumentPart parent, PackagePart part) throws IOException, XmlException;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Logger LOGGER = LogManager.getLogger(POIXMLRelation.class);
|
private static final Logger LOGGER = PoiLogManager.getLogger(POIXMLRelation.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes the content stored in a part.
|
* Describes the content stored in a part.
|
||||||
|
|||||||
@ -43,6 +43,9 @@ public class POIXMLTypeLoader {
|
|||||||
DEFAULT_XML_OPTIONS.setCharacterEncoding("UTF-8");
|
DEFAULT_XML_OPTIONS.setCharacterEncoding("UTF-8");
|
||||||
DEFAULT_XML_OPTIONS.setDisallowDocTypeDeclaration(true);
|
DEFAULT_XML_OPTIONS.setDisallowDocTypeDeclaration(true);
|
||||||
DEFAULT_XML_OPTIONS.setEntityExpansionLimit(1);
|
DEFAULT_XML_OPTIONS.setEntityExpansionLimit(1);
|
||||||
|
DEFAULT_XML_OPTIONS.setLoadStripProcinsts(true);
|
||||||
|
DEFAULT_XML_OPTIONS.setLoadStripComments(true);
|
||||||
|
|
||||||
// JAXP is used for parsing
|
// JAXP is used for parsing
|
||||||
// so only user code using XmlObject/XmlToken.Factory.parse
|
// so only user code using XmlObject/XmlToken.Factory.parse
|
||||||
// directly can bypass the entity check, which is probably unlikely (... and not within our responsibility :))
|
// directly can bypass the entity check, which is probably unlikely (... and not within our responsibility :))
|
||||||
@ -68,6 +71,8 @@ public class POIXMLTypeLoader {
|
|||||||
map.put(MS_EXCEL_URN, "x");
|
map.put(MS_EXCEL_URN, "x");
|
||||||
map.put(MS_WORD_URN, "w10");
|
map.put(MS_WORD_URN, "w10");
|
||||||
map.put(MS_VML_URN, "v");
|
map.put(MS_VML_URN, "v");
|
||||||
|
map.put("http://schemas.microsoft.com/office/word/2010/wordml", "w14");
|
||||||
|
map.put("http://schemas.microsoft.com/office/word/2012/wordml", "w15");
|
||||||
map.put("http://schemas.microsoft.com/office/drawing/2012/chart", "c15");
|
map.put("http://schemas.microsoft.com/office/drawing/2012/chart", "c15");
|
||||||
DEFAULT_XML_OPTIONS.setSaveSuggestedPrefixes(Collections.unmodifiableMap(map));
|
DEFAULT_XML_OPTIONS.setSaveSuggestedPrefixes(Collections.unmodifiableMap(map));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,79 @@
|
|||||||
|
/* ====================================================================
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
this work for additional information regarding copyright ownership.
|
||||||
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
(the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
==================================================================== */
|
||||||
|
package org.apache.poi.ooxml;
|
||||||
|
|
||||||
|
import org.apache.poi.openxml4j.opc.PackageRelationship;
|
||||||
|
import org.apache.poi.openxml4j.opc.TargetMode;
|
||||||
|
|
||||||
|
import java.net.URI;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines a reference relationship. A reference relationship can be internal or external.
|
||||||
|
*
|
||||||
|
* @since 5.3.0
|
||||||
|
*/
|
||||||
|
public abstract class ReferenceRelationship {
|
||||||
|
private POIXMLDocumentPart container;
|
||||||
|
private final String relationshipType;
|
||||||
|
private final boolean external;
|
||||||
|
private final String id;
|
||||||
|
private final URI uri;
|
||||||
|
|
||||||
|
protected ReferenceRelationship(POIXMLDocumentPart container, PackageRelationship packageRelationship) {
|
||||||
|
if (packageRelationship == null) {
|
||||||
|
throw new IllegalArgumentException("packageRelationship");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.container = container;
|
||||||
|
this.relationshipType = packageRelationship.getRelationshipType();
|
||||||
|
this.uri = packageRelationship.getTargetURI();
|
||||||
|
this.external = packageRelationship.getTargetMode() == TargetMode.EXTERNAL;
|
||||||
|
this.id = packageRelationship.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ReferenceRelationship(POIXMLDocumentPart container, URI targetUri, boolean isExternal, String relationshipType, String id) {
|
||||||
|
if (targetUri == null) {
|
||||||
|
throw new NullPointerException("targetUri cannot be null");
|
||||||
|
}
|
||||||
|
|
||||||
|
this.container = container;
|
||||||
|
this.relationshipType = relationshipType;
|
||||||
|
this.uri = targetUri;
|
||||||
|
this.id = id;
|
||||||
|
this.external = isExternal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public POIXMLDocumentPart getContainer() {
|
||||||
|
return container;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRelationshipType() {
|
||||||
|
return relationshipType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isExternal() {
|
||||||
|
return external;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public URI getUri() {
|
||||||
|
return uri;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -119,7 +119,7 @@ public final class POIXMLExtractorFactory implements ExtractorProvider {
|
|||||||
* Clears the setting for this thread made by {@link #setThreadPrefersEventExtractors(boolean) }
|
* Clears the setting for this thread made by {@link #setThreadPrefersEventExtractors(boolean) }
|
||||||
*
|
*
|
||||||
* @see #setThreadPrefersEventExtractors(boolean)
|
* @see #setThreadPrefersEventExtractors(boolean)
|
||||||
* @since POI 5.2.4
|
* @since 5.2.4
|
||||||
*/
|
*/
|
||||||
public static void removeThreadPrefersEventExtractorsSetting() {
|
public static void removeThreadPrefersEventExtractorsSetting() {
|
||||||
ExtractorFactory.removeThreadPrefersEventExtractorsSetting();
|
ExtractorFactory.removeThreadPrefersEventExtractorsSetting();
|
||||||
|
|||||||
@ -73,14 +73,14 @@ public class POIXMLPropertiesTextExtractor implements POIXMLTextExtractor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void appendDateIfPresent(StringBuilder text, String thing, Optional<Date> value) {
|
private void appendDateIfPresent(StringBuilder text, String thing, Optional<Date> value) {
|
||||||
if (!value.isPresent()) {
|
if (value.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
appendIfPresent(text, thing, dateFormat.format(value.get()));
|
appendIfPresent(text, thing, dateFormat.format(value.get()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void appendIfPresent(StringBuilder text, String thing, Optional<String> value) {
|
private void appendIfPresent(StringBuilder text, String thing, Optional<String> value) {
|
||||||
if (!value.isPresent()) {
|
if (value.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
appendIfPresent(text, thing, value.get());
|
appendIfPresent(text, thing, value.get());
|
||||||
|
|||||||
@ -0,0 +1,49 @@
|
|||||||
|
/* ====================================================================
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
this work for additional information regarding copyright ownership.
|
||||||
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
(the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
==================================================================== */
|
||||||
|
|
||||||
|
package org.apache.poi.ooxml.util;
|
||||||
|
|
||||||
|
import org.apache.poi.util.Internal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper class for number related operations.
|
||||||
|
* <p>Note: This class is for internal POI usage only.</p>
|
||||||
|
*
|
||||||
|
* @since 5.5.0
|
||||||
|
*/
|
||||||
|
@Internal
|
||||||
|
public class NumberHelper {
|
||||||
|
private NumberHelper() {
|
||||||
|
// no instances of this class
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param number the number to convert
|
||||||
|
* @return the double representation of the number
|
||||||
|
* @throws IllegalArgumentException if the number cannot be converted
|
||||||
|
*/
|
||||||
|
public static double toDouble(Object number) {
|
||||||
|
if (number instanceof Number) {
|
||||||
|
return ((Number) number).doubleValue();
|
||||||
|
} else if (number instanceof String) {
|
||||||
|
return Double.parseDouble((String) number);
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Cannot convert of class" + number.getClass().getName() +
|
||||||
|
" to double");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -32,32 +32,42 @@ import org.apache.poi.openxml4j.opc.PackagePartName;
|
|||||||
import org.apache.poi.openxml4j.opc.PackageProperties;
|
import org.apache.poi.openxml4j.opc.PackageProperties;
|
||||||
import org.apache.poi.openxml4j.opc.PackageRelationship;
|
import org.apache.poi.openxml4j.opc.PackageRelationship;
|
||||||
import org.apache.poi.openxml4j.opc.PackageRelationshipCollection;
|
import org.apache.poi.openxml4j.opc.PackageRelationshipCollection;
|
||||||
import org.apache.poi.openxml4j.opc.PackageRelationshipTypes;
|
|
||||||
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
|
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
|
||||||
import org.apache.poi.openxml4j.opc.TargetMode;
|
import org.apache.poi.openxml4j.opc.TargetMode;
|
||||||
|
import org.apache.poi.openxml4j.opc.internal.InvalidZipException;
|
||||||
import org.apache.poi.util.IOUtils;
|
import org.apache.poi.util.IOUtils;
|
||||||
import org.apache.poi.util.Removal;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides handy methods to work with OOXML packages
|
* Provides handy methods to work with OOXML packages
|
||||||
*/
|
*/
|
||||||
public final class PackageHelper {
|
public final class PackageHelper {
|
||||||
|
|
||||||
public static OPCPackage open(InputStream is) throws IOException {
|
/**
|
||||||
return open(is, false);
|
* @param stream The InputStream to read from - which is closed when it is read
|
||||||
|
* @return OPCPackage
|
||||||
|
* @throws IOException If reading data from the stream fails
|
||||||
|
* @throws POIXMLException If the stream is not a valid OPC package
|
||||||
|
*/
|
||||||
|
public static OPCPackage open(InputStream stream) throws IOException {
|
||||||
|
return open(stream, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param stream The InputStream to read from
|
* @param stream The InputStream to read from
|
||||||
* @param closeStream whether to close the stream (default is false)
|
* @param closeStream whether to close the stream
|
||||||
* @since POI 5.2.0
|
|
||||||
* @return OPCPackage
|
* @return OPCPackage
|
||||||
* @throws IOException If reading data from the stream fails
|
* @throws IOException If reading data from the stream fails
|
||||||
|
* @throws POIXMLException If the stream is not a valid OPC package
|
||||||
|
* @since 5.2.0
|
||||||
*/
|
*/
|
||||||
public static OPCPackage open(InputStream stream, boolean closeStream) throws IOException {
|
public static OPCPackage open(InputStream stream, boolean closeStream) throws IOException {
|
||||||
try {
|
try {
|
||||||
return OPCPackage.open(stream);
|
return OPCPackage.open(stream, closeStream);
|
||||||
} catch (InvalidFormatException e){
|
} catch (InvalidFormatException e) {
|
||||||
|
final Throwable cause = e.getCause();
|
||||||
|
if (cause instanceof InvalidZipException) {
|
||||||
|
throw (InvalidZipException) cause;
|
||||||
|
}
|
||||||
throw new POIXMLException(e);
|
throw new POIXMLException(e);
|
||||||
} finally {
|
} finally {
|
||||||
if (closeStream) {
|
if (closeStream) {
|
||||||
@ -66,50 +76,6 @@ public final class PackageHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Clone the specified package.
|
|
||||||
*
|
|
||||||
* @param pkg the package to clone
|
|
||||||
* @param file the destination file
|
|
||||||
* @return the cloned package
|
|
||||||
* @deprecated this method is not used internally and creates temp files that are not well handled
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@Removal(version = "6.0.0")
|
|
||||||
public static OPCPackage clone(OPCPackage pkg, File file) throws OpenXML4JException, IOException {
|
|
||||||
|
|
||||||
String path = file.getAbsolutePath();
|
|
||||||
|
|
||||||
try (OPCPackage dest = OPCPackage.create(path)) {
|
|
||||||
PackageRelationshipCollection rels = pkg.getRelationships();
|
|
||||||
for (PackageRelationship rel : rels) {
|
|
||||||
PackagePart part = pkg.getPart(rel);
|
|
||||||
PackagePart part_tgt;
|
|
||||||
if (rel.getRelationshipType().equals(PackageRelationshipTypes.CORE_PROPERTIES)) {
|
|
||||||
copyProperties(pkg.getPackageProperties(), dest.getPackageProperties());
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
dest.addRelationship(part.getPartName(), rel.getTargetMode(), rel.getRelationshipType());
|
|
||||||
part_tgt = dest.createPart(part.getPartName(), part.getContentType());
|
|
||||||
|
|
||||||
try (
|
|
||||||
InputStream in = part.getInputStream();
|
|
||||||
OutputStream out = part_tgt.getOutputStream()
|
|
||||||
) {
|
|
||||||
IOUtils.copy(in, out);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (part.hasRelationships()) {
|
|
||||||
copy(pkg, part, dest, part_tgt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//the temp file will be deleted when JVM terminates
|
|
||||||
new File(path).deleteOnExit();
|
|
||||||
return OPCPackage.open(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively copy package parts to the destination package
|
* Recursively copy package parts to the destination package
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -24,8 +24,8 @@ import javax.xml.namespace.QName;
|
|||||||
import javax.xml.xpath.XPathFactory;
|
import javax.xml.xpath.XPathFactory;
|
||||||
|
|
||||||
import com.microsoft.schemas.compatibility.AlternateContentDocument;
|
import com.microsoft.schemas.compatibility.AlternateContentDocument;
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
import org.apache.poi.util.Internal;
|
import org.apache.poi.util.Internal;
|
||||||
import org.apache.poi.xslf.usermodel.XSLFShape;
|
import org.apache.poi.xslf.usermodel.XSLFShape;
|
||||||
import org.apache.xmlbeans.XmlCursor;
|
import org.apache.xmlbeans.XmlCursor;
|
||||||
@ -34,7 +34,7 @@ import org.apache.xmlbeans.XmlObject;
|
|||||||
import org.apache.xmlbeans.impl.values.XmlAnyTypeImpl;
|
import org.apache.xmlbeans.impl.values.XmlAnyTypeImpl;
|
||||||
|
|
||||||
public final class XPathHelper {
|
public final class XPathHelper {
|
||||||
private static final Logger LOG = LogManager.getLogger(XPathHelper.class);
|
private static final Logger LOG = PoiLogManager.getLogger(XPathHelper.class);
|
||||||
|
|
||||||
private static final String OSGI_ERROR =
|
private static final String OSGI_ERROR =
|
||||||
"Schemas (*.xsb) for <CLASS> can't be loaded - usually this happens when OSGI " +
|
"Schemas (*.xsb) for <CLASS> can't be loaded - usually this happens when OSGI " +
|
||||||
@ -80,8 +80,8 @@ public final class XPathHelper {
|
|||||||
* It returns the first element found - the search order is:
|
* It returns the first element found - the search order is:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>searching for a direct child</li>
|
* <li>searching for a direct child</li>
|
||||||
* <li>searching for a AlternateContent.Choice child</li>
|
* <li>searching for an AlternateContent.Choice child</li>
|
||||||
* <li>searching for a AlternateContent.Fallback child</li>
|
* <li>searching for an AlternateContent.Fallback child</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
* The factory flag is
|
* The factory flag is
|
||||||
* a workaround to process files based on a later edition. But it comes with the drawback:
|
* a workaround to process files based on a later edition. But it comes with the drawback:
|
||||||
@ -102,7 +102,7 @@ public final class XPathHelper {
|
|||||||
* thrown if the AlternateContent is not allowed by the surrounding element or if the
|
* thrown if the AlternateContent is not allowed by the surrounding element or if the
|
||||||
* extracted object is of the generic type XmlAnyTypeImpl.
|
* extracted object is of the generic type XmlAnyTypeImpl.
|
||||||
*
|
*
|
||||||
* @since POI 4.1.2
|
* @since 4.1.2
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Internal
|
@Internal
|
||||||
|
|||||||
@ -0,0 +1,118 @@
|
|||||||
|
/* ====================================================================
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
this work for additional information regarding copyright ownership.
|
||||||
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
(the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
==================================================================== */
|
||||||
|
|
||||||
|
package org.apache.poi.openxml4j.opc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows disabling specific OPC compliance rules.
|
||||||
|
* By default, rules M4.2, M4.3, M4.4, and M4.5 are all enforced which will prevent
|
||||||
|
* non-compliant documents from being parsed.
|
||||||
|
*
|
||||||
|
* Consumers may disable these compliance checks individually or as a whole at their
|
||||||
|
* own discretion to allow certain non-compliant documents to be parsed.
|
||||||
|
* @since 5.4.1
|
||||||
|
*/
|
||||||
|
public class OPCComplianceFlags {
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Rule M4.2: A format consumer shall consider the use of the Markup
|
||||||
|
* Compatibility namespace to be an error.
|
||||||
|
*/
|
||||||
|
protected boolean ENFORCE_M4_2_FORBID_MARKUP_COMPATIBILITY_NAMESPACE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule M4.3: Producers shall not create a document element that contains
|
||||||
|
* refinements to the Dublin Core elements, except for the two specified in
|
||||||
|
* the schema: <dcterms:created> and <dcterms:modified> Consumers shall
|
||||||
|
* consider a document element that violates this constraint to be an error.
|
||||||
|
*/
|
||||||
|
protected boolean ENFORCE_M4_3_FORBID_REFINING_DUBLIN_CORE_ELEMENTS;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rule M4.4: Producers shall not create a document element that contains
|
||||||
|
* the xml:lang attribute. Consumers shall consider a document element that
|
||||||
|
* violates this constraint to be an error.
|
||||||
|
*/
|
||||||
|
protected boolean ENFORCE_M4_4_FORBID_XML_LANG_ATTRIBUTE;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Rule M4.5: Producers shall not create a document element that contains
|
||||||
|
* the xsi:type attribute, except for a <dcterms:created> or
|
||||||
|
* <dcterms:modified> element where the xsi:type attribute shall be present
|
||||||
|
* and shall hold the value dcterms:W3CDTF, where dcterms is the namespace
|
||||||
|
* prefix of the Dublin Core namespace. Consumers shall consider a document
|
||||||
|
* element that violates this constraint to be an error.
|
||||||
|
*/
|
||||||
|
protected boolean ENFORCE_M4_5_RESTRICT_XSI_TYPE_ATTRIBUTE;
|
||||||
|
|
||||||
|
private OPCComplianceFlags(
|
||||||
|
boolean forbidMarkupCompatibilityNamespace,
|
||||||
|
boolean forbidRefiningDublinCoreElements,
|
||||||
|
boolean forbidXmlLangAttribute,
|
||||||
|
boolean restrictXsiTypeAttribute
|
||||||
|
) {
|
||||||
|
this.ENFORCE_M4_2_FORBID_MARKUP_COMPATIBILITY_NAMESPACE = forbidMarkupCompatibilityNamespace;
|
||||||
|
this.ENFORCE_M4_3_FORBID_REFINING_DUBLIN_CORE_ELEMENTS = forbidRefiningDublinCoreElements;
|
||||||
|
this.ENFORCE_M4_4_FORBID_XML_LANG_ATTRIBUTE = forbidXmlLangAttribute;
|
||||||
|
this.ENFORCE_M4_5_RESTRICT_XSI_TYPE_ATTRIBUTE = restrictXsiTypeAttribute;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OPCComplianceFlags enforceAll() {
|
||||||
|
return new OPCComplianceFlags(true, true, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static OPCComplianceFlags disableAll() {
|
||||||
|
return new OPCComplianceFlags(false, false, false, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public OPCComplianceFlags setForbidMarkupCompatibilityNamespace(boolean flag) {
|
||||||
|
ENFORCE_M4_2_FORBID_MARKUP_COMPATIBILITY_NAMESPACE = flag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OPCComplianceFlags setForbidRefiningDublinCoreElements(boolean flag) {
|
||||||
|
ENFORCE_M4_3_FORBID_REFINING_DUBLIN_CORE_ELEMENTS = flag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OPCComplianceFlags setForbidXmlLangAttribute(boolean flag) {
|
||||||
|
ENFORCE_M4_4_FORBID_XML_LANG_ATTRIBUTE = flag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public OPCComplianceFlags setRestrictXsiTypeAttribute(boolean flag) {
|
||||||
|
ENFORCE_M4_5_RESTRICT_XSI_TYPE_ATTRIBUTE = flag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getForbidMarkupCompatibilityNamespace() {
|
||||||
|
return ENFORCE_M4_2_FORBID_MARKUP_COMPATIBILITY_NAMESPACE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getForbidRefiningDublinCoreElements() {
|
||||||
|
return ENFORCE_M4_3_FORBID_REFINING_DUBLIN_CORE_ELEMENTS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getForbidXmlLangAttributes() {
|
||||||
|
return ENFORCE_M4_4_FORBID_XML_LANG_ATTRIBUTE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean getRestrictXsiTypeAttribute() {
|
||||||
|
return ENFORCE_M4_5_RESTRICT_XSI_TYPE_ATTRIBUTE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -31,7 +31,7 @@ import java.io.OutputStream;
|
|||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Path;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@ -42,14 +42,15 @@ import java.util.Optional;
|
|||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
|
import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
|
||||||
import org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException;
|
import org.apache.poi.openxml4j.exceptions.OpenXML4JRuntimeException;
|
||||||
import org.apache.poi.openxml4j.exceptions.PartAlreadyExistsException;
|
import org.apache.poi.openxml4j.exceptions.PartAlreadyExistsException;
|
||||||
import org.apache.poi.openxml4j.opc.internal.ContentType;
|
import org.apache.poi.openxml4j.opc.internal.ContentType;
|
||||||
import org.apache.poi.openxml4j.opc.internal.ContentTypeManager;
|
import org.apache.poi.openxml4j.opc.internal.ContentTypeManager;
|
||||||
|
import org.apache.poi.openxml4j.opc.internal.InvalidZipException;
|
||||||
import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart;
|
import org.apache.poi.openxml4j.opc.internal.PackagePropertiesPart;
|
||||||
import org.apache.poi.openxml4j.opc.internal.PartMarshaller;
|
import org.apache.poi.openxml4j.opc.internal.PartMarshaller;
|
||||||
import org.apache.poi.openxml4j.opc.internal.PartUnmarshaller;
|
import org.apache.poi.openxml4j.opc.internal.PartUnmarshaller;
|
||||||
@ -71,7 +72,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
/**
|
/**
|
||||||
* Logger.
|
* Logger.
|
||||||
*/
|
*/
|
||||||
private static final Logger LOG = LogManager.getLogger(OPCPackage.class);
|
private static final Logger LOG = PoiLogManager.getLogger(OPCPackage.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default package access.
|
* Default package access.
|
||||||
@ -140,6 +141,19 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
* @throws OpenXML4JRuntimeException if there are issues creating properties part
|
* @throws OpenXML4JRuntimeException if there are issues creating properties part
|
||||||
*/
|
*/
|
||||||
OPCPackage(PackageAccess access) {
|
OPCPackage(PackageAccess access) {
|
||||||
|
this(access, OPCComplianceFlags.enforceAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @param access Package access.
|
||||||
|
* @param opcComplianceFlags Enable or disable specific OPC compliance flags.
|
||||||
|
* This is useful to allow parsing of certain non-compliant documents.
|
||||||
|
* @throws OpenXML4JRuntimeException if there are issues creating properties part
|
||||||
|
* @since 5.4.1
|
||||||
|
*/
|
||||||
|
OPCPackage(PackageAccess access, OPCComplianceFlags opcComplianceFlags) {
|
||||||
if (getClass() != ZipPackage.class) {
|
if (getClass() != ZipPackage.class) {
|
||||||
throw new IllegalArgumentException("PackageBase may not be subclassed");
|
throw new IllegalArgumentException("PackageBase may not be subclassed");
|
||||||
}
|
}
|
||||||
@ -147,7 +161,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
|
|
||||||
final ContentType contentType = newCorePropertiesPart();
|
final ContentType contentType = newCorePropertiesPart();
|
||||||
// TODO Delocalize specialized marshallers
|
// TODO Delocalize specialized marshallers
|
||||||
this.partUnmarshallers.put(contentType, new PackagePropertiesUnmarshaller());
|
this.partUnmarshallers.put(contentType, new PackagePropertiesUnmarshaller(opcComplianceFlags));
|
||||||
this.partMarshallers.put(contentType, new ZipPackagePropertiesMarshaller());
|
this.partMarshallers.put(contentType, new ZipPackagePropertiesMarshaller());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +189,24 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
* occur.
|
* occur.
|
||||||
*/
|
*/
|
||||||
public static OPCPackage open(String path) throws InvalidFormatException {
|
public static OPCPackage open(String path) throws InvalidFormatException {
|
||||||
return open(path, defaultPackageAccess);
|
return open(path, defaultPackageAccess, OPCComplianceFlags.enforceAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a package with read/write permission.
|
||||||
|
*
|
||||||
|
* @param path
|
||||||
|
* The document path.
|
||||||
|
* @param opcComplianceFlags
|
||||||
|
* The level of OPC compliance to enforce when reading the package
|
||||||
|
* @return A Package object, else <b>null</b>.
|
||||||
|
* @throws InvalidFormatException
|
||||||
|
* If the specified file doesn't exist, and a parsing error
|
||||||
|
* occur.
|
||||||
|
* @since 5.4.1
|
||||||
|
*/
|
||||||
|
public static OPCPackage open(String path, OPCComplianceFlags opcComplianceFlags) throws InvalidFormatException {
|
||||||
|
return open(path, defaultPackageAccess, opcComplianceFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -193,7 +224,24 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Open an user provided {@link ZipEntrySource} with read-only permission.
|
* Open a package with read/write permission.
|
||||||
|
*
|
||||||
|
* @param file
|
||||||
|
* The file to open.
|
||||||
|
* @param opcComplianceFlags
|
||||||
|
* The level of OPC compliance to enforce when reading the package
|
||||||
|
* @return A Package object, else <b>null</b>.
|
||||||
|
* @throws InvalidFormatException
|
||||||
|
* If the specified file doesn't exist, and a parsing error
|
||||||
|
* occur.
|
||||||
|
* @since 5.4.1
|
||||||
|
*/
|
||||||
|
public static OPCPackage open(File file, OPCComplianceFlags opcComplianceFlags) throws InvalidFormatException {
|
||||||
|
return open(file, defaultPackageAccess, opcComplianceFlags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a user provided {@link ZipEntrySource} with read-only permission.
|
||||||
* This method can be used to stream data into POI.
|
* This method can be used to stream data into POI.
|
||||||
* Opposed to other open variants, the data is read as-is, e.g. there aren't
|
* Opposed to other open variants, the data is read as-is, e.g. there aren't
|
||||||
* any zip-bomb protection put in place.
|
* any zip-bomb protection put in place.
|
||||||
@ -202,9 +250,25 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
* @return A Package object
|
* @return A Package object
|
||||||
* @throws InvalidFormatException if a parsing error occur.
|
* @throws InvalidFormatException if a parsing error occur.
|
||||||
*/
|
*/
|
||||||
public static OPCPackage open(ZipEntrySource zipEntry)
|
public static OPCPackage open(ZipEntrySource zipEntry) throws InvalidFormatException {
|
||||||
throws InvalidFormatException {
|
return open(zipEntry, OPCComplianceFlags.enforceAll());
|
||||||
OPCPackage pack = new ZipPackage(zipEntry, PackageAccess.READ);
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a user provided {@link ZipEntrySource} with read-only permission.
|
||||||
|
* This method can be used to stream data into POI.
|
||||||
|
* Opposed to other open variants, the data is read as-is, e.g. there aren't
|
||||||
|
* any zip-bomb protection put in place.
|
||||||
|
*
|
||||||
|
* @param zipEntry the custom source
|
||||||
|
* @param opcComplianceFlags
|
||||||
|
* The level of OPC compliance to enforce when reading the package
|
||||||
|
* @return A Package object
|
||||||
|
* @throws InvalidFormatException if a parsing error occur.
|
||||||
|
* @since 5.4.1
|
||||||
|
*/
|
||||||
|
public static OPCPackage open(ZipEntrySource zipEntry, OPCComplianceFlags opcComplianceFlags) throws InvalidFormatException {
|
||||||
|
OPCPackage pack = new ZipPackage(zipEntry, PackageAccess.READ, opcComplianceFlags);
|
||||||
try {
|
try {
|
||||||
if (pack.partList == null) {
|
if (pack.partList == null) {
|
||||||
pack.getParts();
|
pack.getParts();
|
||||||
@ -235,6 +299,28 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
*/
|
*/
|
||||||
public static OPCPackage open(String path, PackageAccess access)
|
public static OPCPackage open(String path, PackageAccess access)
|
||||||
throws InvalidFormatException, InvalidOperationException {
|
throws InvalidFormatException, InvalidOperationException {
|
||||||
|
return open(path, access, OPCComplianceFlags.enforceAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a package.
|
||||||
|
*
|
||||||
|
* @param path
|
||||||
|
* The document path.
|
||||||
|
* @param access
|
||||||
|
* PackageBase access.
|
||||||
|
* @param opcComplianceFlags
|
||||||
|
* The level of OPC compliance to enforce when reading the package
|
||||||
|
* @return A PackageBase object, else <b>null</b>.
|
||||||
|
* @throws InvalidFormatException
|
||||||
|
* If the specified file doesn't exist, and a parsing error
|
||||||
|
* occur.
|
||||||
|
* @throws InvalidOperationException If the zip file cannot be opened.
|
||||||
|
* @throws InvalidFormatException if the package is not valid.
|
||||||
|
* @since 5.4.1
|
||||||
|
*/
|
||||||
|
public static OPCPackage open(String path, PackageAccess access, OPCComplianceFlags opcComplianceFlags)
|
||||||
|
throws InvalidFormatException, InvalidOperationException {
|
||||||
if (StringUtil.isBlank(path)) {
|
if (StringUtil.isBlank(path)) {
|
||||||
throw new IllegalArgumentException("'path' must be given");
|
throw new IllegalArgumentException("'path' must be given");
|
||||||
}
|
}
|
||||||
@ -244,7 +330,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
throw new IllegalArgumentException("path must not be a directory");
|
throw new IllegalArgumentException("path must not be a directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
OPCPackage pack = new ZipPackage(path, access); // NOSONAR
|
OPCPackage pack = new ZipPackage(path, access, opcComplianceFlags); // NOSONAR
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
if (pack.partList == null && access != PackageAccess.WRITE) {
|
if (pack.partList == null && access != PackageAccess.WRITE) {
|
||||||
try {
|
try {
|
||||||
@ -275,6 +361,27 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
*/
|
*/
|
||||||
public static OPCPackage open(File file, PackageAccess access)
|
public static OPCPackage open(File file, PackageAccess access)
|
||||||
throws InvalidFormatException {
|
throws InvalidFormatException {
|
||||||
|
return open(file, access, OPCComplianceFlags.enforceAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a package.
|
||||||
|
*
|
||||||
|
* @param file
|
||||||
|
* The file to open.
|
||||||
|
* @param access
|
||||||
|
* PackageBase access.
|
||||||
|
* @param opcComplianceFlags
|
||||||
|
* The level of OPC compliance to enforce when reading the package
|
||||||
|
* @return A PackageBase object, else <b>null</b>.
|
||||||
|
* @throws IllegalArgumentException
|
||||||
|
* If the specified file doesn't exist or is a directory.
|
||||||
|
* @throws InvalidFormatException
|
||||||
|
* If a parsing error occurs.
|
||||||
|
* @since 5.4.1
|
||||||
|
*/
|
||||||
|
public static OPCPackage open(File file, PackageAccess access, OPCComplianceFlags opcComplianceFlags)
|
||||||
|
throws InvalidFormatException {
|
||||||
if (file == null) {
|
if (file == null) {
|
||||||
throw new IllegalArgumentException("'file' must be given");
|
throw new IllegalArgumentException("'file' must be given");
|
||||||
}
|
}
|
||||||
@ -282,7 +389,12 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
throw new IllegalArgumentException("file must not be a directory");
|
throw new IllegalArgumentException("file must not be a directory");
|
||||||
}
|
}
|
||||||
|
|
||||||
OPCPackage pack = new ZipPackage(file, access); //NOSONAR
|
final OPCPackage pack;
|
||||||
|
try {
|
||||||
|
pack = new ZipPackage(file, access, opcComplianceFlags); //NOSONAR
|
||||||
|
} catch (InvalidOperationException e) {
|
||||||
|
throw new InvalidFormatException(e.getMessage(), e);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (pack.partList == null && access != PackageAccess.WRITE) {
|
if (pack.partList == null && access != PackageAccess.WRITE) {
|
||||||
pack.getParts();
|
pack.getParts();
|
||||||
@ -307,7 +419,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
* of native methods
|
* of native methods
|
||||||
*
|
*
|
||||||
* @param in
|
* @param in
|
||||||
* The InputStream to read the package from
|
* The InputStream to read the package from. The stream is closed.
|
||||||
* @return A PackageBase object
|
* @return A PackageBase object
|
||||||
*
|
*
|
||||||
* @throws InvalidFormatException
|
* @throws InvalidFormatException
|
||||||
@ -316,7 +428,97 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
*/
|
*/
|
||||||
public static OPCPackage open(InputStream in) throws InvalidFormatException,
|
public static OPCPackage open(InputStream in) throws InvalidFormatException,
|
||||||
IOException {
|
IOException {
|
||||||
OPCPackage pack = new ZipPackage(in, PackageAccess.READ_WRITE);
|
return open(in, OPCComplianceFlags.enforceAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a package.
|
||||||
|
*
|
||||||
|
* Note - uses quite a bit more memory than {@link #open(String)}, which
|
||||||
|
* doesn't need to hold the whole zip file in memory, and can take advantage
|
||||||
|
* of native methods
|
||||||
|
*
|
||||||
|
* @param in
|
||||||
|
* The InputStream to read the package from. The stream is closed.
|
||||||
|
* @param opcComplianceFlags
|
||||||
|
* The level of OPC compliance to enforce when reading the package
|
||||||
|
* @return A PackageBase object
|
||||||
|
*
|
||||||
|
* @throws InvalidFormatException
|
||||||
|
* Throws if the specified file exist and is not valid.
|
||||||
|
* @throws IOException If reading the stream fails
|
||||||
|
* @since 5.4.1
|
||||||
|
*/
|
||||||
|
public static OPCPackage open(InputStream in, OPCComplianceFlags opcComplianceFlags) throws InvalidFormatException,
|
||||||
|
IOException {
|
||||||
|
final OPCPackage pack;
|
||||||
|
try {
|
||||||
|
pack = new ZipPackage(in, PackageAccess.READ_WRITE, opcComplianceFlags);
|
||||||
|
} catch (InvalidZipException e) {
|
||||||
|
throw new InvalidFormatException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (pack.partList == null) {
|
||||||
|
pack.getParts();
|
||||||
|
}
|
||||||
|
} catch (InvalidFormatException | RuntimeException e) {
|
||||||
|
IOUtils.closeQuietly(pack);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
return pack;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a package.
|
||||||
|
*
|
||||||
|
* Note - uses quite a bit more memory than {@link #open(String)}, which
|
||||||
|
* doesn't need to hold the whole zip file in memory, and can take advantage
|
||||||
|
* of native methods
|
||||||
|
*
|
||||||
|
* @param in
|
||||||
|
* The InputStream to read the package from.
|
||||||
|
* @param closeStream
|
||||||
|
* Whether to close the input stream.
|
||||||
|
* @return A PackageBase object
|
||||||
|
*
|
||||||
|
* @throws InvalidFormatException
|
||||||
|
* Throws if the specified file exist and is not valid.
|
||||||
|
* @throws IOException If reading the stream fails
|
||||||
|
* @since 5.2.5
|
||||||
|
*/
|
||||||
|
public static OPCPackage open(InputStream in, boolean closeStream) throws InvalidFormatException,
|
||||||
|
IOException {
|
||||||
|
return open(in, closeStream, OPCComplianceFlags.enforceAll());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Open a package.
|
||||||
|
*
|
||||||
|
* Note - uses quite a bit more memory than {@link #open(String)}, which
|
||||||
|
* doesn't need to hold the whole zip file in memory, and can take advantage
|
||||||
|
* of native methods
|
||||||
|
*
|
||||||
|
* @param in
|
||||||
|
* The InputStream to read the package from.
|
||||||
|
* @param closeStream
|
||||||
|
* Whether to close the input stream.
|
||||||
|
* @param opcComplianceFlags
|
||||||
|
* The level of OPC compliance to enforce when reading the package
|
||||||
|
* @return A PackageBase object
|
||||||
|
*
|
||||||
|
* @throws InvalidFormatException
|
||||||
|
* Throws if the specified file exist and is not valid.
|
||||||
|
* @throws IOException If reading the stream fails
|
||||||
|
* @since 5.4.1
|
||||||
|
*/
|
||||||
|
public static OPCPackage open(InputStream in, boolean closeStream, OPCComplianceFlags opcComplianceFlags) throws InvalidFormatException,
|
||||||
|
IOException {
|
||||||
|
final OPCPackage pack;
|
||||||
|
try {
|
||||||
|
pack = new ZipPackage(in, PackageAccess.READ_WRITE, closeStream, opcComplianceFlags);
|
||||||
|
} catch (InvalidZipException e) {
|
||||||
|
throw new InvalidFormatException(e.getMessage(), e);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (pack.partList == null) {
|
if (pack.partList == null) {
|
||||||
pack.getParts();
|
pack.getParts();
|
||||||
@ -480,6 +682,9 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
// ensure all held resources are freed
|
// ensure all held resources are freed
|
||||||
revert();
|
revert();
|
||||||
|
|
||||||
|
// ensure resources associated with package parts are closed
|
||||||
|
closeParts();
|
||||||
|
|
||||||
// Clear
|
// Clear
|
||||||
this.contentTypeManager.clearAll();
|
this.contentTypeManager.clearAll();
|
||||||
}
|
}
|
||||||
@ -506,7 +711,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
}
|
}
|
||||||
String name = path.substring(path.lastIndexOf(File.separatorChar) + 1);
|
String name = path.substring(path.lastIndexOf(File.separatorChar) + 1);
|
||||||
|
|
||||||
try (InputStream is = Files.newInputStream(Paths.get(path))) {
|
try (InputStream is = Files.newInputStream(Path.of(path))) {
|
||||||
addThumbnail(name, is);
|
addThumbnail(name, is);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -993,7 +1198,6 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
if (this.partList.containsKey(partName)) {
|
if (this.partList.containsKey(partName)) {
|
||||||
this.partList.get(partName).setDeleted(true);
|
this.partList.get(partName).setDeleted(true);
|
||||||
this.removePartImpl(partName);
|
this.removePartImpl(partName);
|
||||||
this.partList.remove(partName);
|
|
||||||
} else {
|
} else {
|
||||||
this.removePartImpl(partName);
|
this.removePartImpl(partName);
|
||||||
}
|
}
|
||||||
@ -1519,8 +1723,16 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
*
|
*
|
||||||
* @param partName
|
* @param partName
|
||||||
* The URI of the part to delete.
|
* The URI of the part to delete.
|
||||||
|
* @throws IllegalArgumentException if the partName is null.
|
||||||
|
* @throws InvalidOperationException if the package is in read-only mode.
|
||||||
*/
|
*/
|
||||||
protected abstract void removePartImpl(PackagePartName partName);
|
protected void removePartImpl(PackagePartName partName) {
|
||||||
|
if (partName == null) {
|
||||||
|
throw new IllegalArgumentException("partName cannot be null");
|
||||||
|
}
|
||||||
|
throwExceptionIfReadOnly();
|
||||||
|
this.partList.remove(partName);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flush the package but not save.
|
* Flush the package but not save.
|
||||||
@ -1584,7 +1796,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
* @param oldContentType the content type to be replaced
|
* @param oldContentType the content type to be replaced
|
||||||
* @param newContentType the replacement
|
* @param newContentType the replacement
|
||||||
* @return whether replacement was successful
|
* @return whether replacement was successful
|
||||||
* @since POI-3.8
|
* @since -3.8
|
||||||
*/
|
*/
|
||||||
public boolean replaceContentType(String oldContentType, String newContentType){
|
public boolean replaceContentType(String oldContentType, String newContentType){
|
||||||
boolean success = false;
|
boolean success = false;
|
||||||
@ -1649,7 +1861,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the package is in Strict OOXML format
|
* @return true if the package is in Strict OOXML format
|
||||||
* @since POI 5.1.0
|
* @since 5.1.0
|
||||||
*/
|
*/
|
||||||
public boolean isStrictOoxmlFormat() {
|
public boolean isStrictOoxmlFormat() {
|
||||||
PackageRelationshipCollection coreDocRelationships = getRelationshipsByType(
|
PackageRelationshipCollection coreDocRelationships = getRelationshipsByType(
|
||||||
@ -1662,6 +1874,13 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
|||||||
*/
|
*/
|
||||||
public abstract boolean isClosed();
|
public abstract boolean isClosed();
|
||||||
|
|
||||||
|
protected void closeParts() {
|
||||||
|
// might not be initialized fully yet
|
||||||
|
if (partList != null) {
|
||||||
|
partList.closeParts();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "OPCPackage{" +
|
return "OPCPackage{" +
|
||||||
|
|||||||
@ -112,8 +112,6 @@ public final class PackagePartCollection implements Serializable {
|
|||||||
return packagePartLookup.size();
|
return packagePartLookup.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an unused part index based on the namePattern, which doesn't exist yet
|
* Get an unused part index based on the namePattern, which doesn't exist yet
|
||||||
* and has the lowest positive index
|
* and has the lowest positive index
|
||||||
@ -141,4 +139,11 @@ public final class PackagePartCollection implements Serializable {
|
|||||||
.mapToInt(indexFromName)
|
.mapToInt(indexFromName)
|
||||||
.collect(SparseBitSet::new, SparseBitSet::set, (s1,s2) -> s1.or(s2)).nextClearBit(1);
|
.collect(SparseBitSet::new, SparseBitSet::set, (s1,s2) -> s1.or(s2)).nextClearBit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// used to ensure resources are closed when they are no longer needed
|
||||||
|
void closeParts() {
|
||||||
|
for (PackagePart part : packagePartLookup.values()) {
|
||||||
|
part.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,7 +139,8 @@ public final class PackagePartName implements Comparable<PackagePartName> {
|
|||||||
throw new IllegalArgumentException("partUri");
|
throw new IllegalArgumentException("partUri");
|
||||||
}
|
}
|
||||||
|
|
||||||
return partUri.getPath().matches(
|
final String uriPath = partUri.getPath();
|
||||||
|
return uriPath != null && uriPath.matches(
|
||||||
"^.*/" + PackagingURIHelper.RELATIONSHIP_PART_SEGMENT_NAME + "/.*\\"
|
"^.*/" + PackagingURIHelper.RELATIONSHIP_PART_SEGMENT_NAME + "/.*\\"
|
||||||
+ PackagingURIHelper.RELATIONSHIP_PART_EXTENSION_NAME
|
+ PackagingURIHelper.RELATIONSHIP_PART_EXTENSION_NAME
|
||||||
+ "$");
|
+ "$");
|
||||||
@ -355,7 +356,7 @@ public final class PackagePartName implements Comparable<PackagePartName> {
|
|||||||
private static void throwExceptionIfPartNameNotStartsWithForwardSlashChar(
|
private static void throwExceptionIfPartNameNotStartsWithForwardSlashChar(
|
||||||
URI partUri) throws InvalidFormatException {
|
URI partUri) throws InvalidFormatException {
|
||||||
String uriPath = partUri.getPath();
|
String uriPath = partUri.getPath();
|
||||||
if (uriPath.length() > 0
|
if (!uriPath.isEmpty()
|
||||||
&& uriPath.charAt(0) != PackagingURIHelper.FORWARD_SLASH_CHAR) {
|
&& uriPath.charAt(0) != PackagingURIHelper.FORWARD_SLASH_CHAR) {
|
||||||
throw new InvalidFormatException(
|
throw new InvalidFormatException(
|
||||||
"A part name shall start with a forward slash ('/') character [M1.4]: "
|
"A part name shall start with a forward slash ('/') character [M1.4]: "
|
||||||
@ -376,7 +377,7 @@ public final class PackagePartName implements Comparable<PackagePartName> {
|
|||||||
private static void throwExceptionIfPartNameEndsWithForwardSlashChar(
|
private static void throwExceptionIfPartNameEndsWithForwardSlashChar(
|
||||||
URI partUri) throws InvalidFormatException {
|
URI partUri) throws InvalidFormatException {
|
||||||
String uriPath = partUri.getPath();
|
String uriPath = partUri.getPath();
|
||||||
if (uriPath.length() > 0
|
if (!uriPath.isEmpty()
|
||||||
&& uriPath.charAt(uriPath.length() - 1) == PackagingURIHelper.FORWARD_SLASH_CHAR) {
|
&& uriPath.charAt(uriPath.length() - 1) == PackagingURIHelper.FORWARD_SLASH_CHAR) {
|
||||||
throw new InvalidFormatException(
|
throw new InvalidFormatException(
|
||||||
"A part name shall not have a forward slash as the last character [M1.5]: "
|
"A part name shall not have a forward slash as the last character [M1.5]: "
|
||||||
@ -421,7 +422,7 @@ public final class PackagePartName implements Comparable<PackagePartName> {
|
|||||||
*/
|
*/
|
||||||
public String getExtension() {
|
public String getExtension() {
|
||||||
String fragment = this.partNameURI.getPath();
|
String fragment = this.partNameURI.getPath();
|
||||||
if (fragment.length() > 0) {
|
if (!fragment.isEmpty()) {
|
||||||
int i = fragment.lastIndexOf('.');
|
int i = fragment.lastIndexOf('.');
|
||||||
if (i > -1) {
|
if (i > -1) {
|
||||||
return fragment.substring(i + 1);
|
return fragment.substring(i + 1);
|
||||||
|
|||||||
@ -85,18 +85,20 @@ public final class PackageRelationship {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
*
|
||||||
|
* @throws NullPointerException if inputs are null
|
||||||
*/
|
*/
|
||||||
public PackageRelationship(OPCPackage pkg, PackagePart sourcePart,
|
public PackageRelationship(OPCPackage pkg, PackagePart sourcePart,
|
||||||
URI targetUri, TargetMode targetMode, String relationshipType,
|
URI targetUri, TargetMode targetMode, String relationshipType,
|
||||||
String id) {
|
String id) {
|
||||||
if (pkg == null)
|
if (pkg == null)
|
||||||
throw new IllegalArgumentException("pkg");
|
throw new NullPointerException("pkg cannot be null");
|
||||||
if (targetUri == null)
|
if (targetUri == null)
|
||||||
throw new IllegalArgumentException("targetUri");
|
throw new NullPointerException("targetUri cannot be null");
|
||||||
if (relationshipType == null)
|
if (relationshipType == null)
|
||||||
throw new IllegalArgumentException("relationshipType");
|
throw new NullPointerException("relationshipType cannot be null");
|
||||||
if (id == null)
|
if (id == null)
|
||||||
throw new IllegalArgumentException("id");
|
throw new NullPointerException("id cannot be null");
|
||||||
|
|
||||||
this.container = pkg;
|
this.container = pkg;
|
||||||
this.source = sourcePart;
|
this.source = sourcePart;
|
||||||
@ -186,6 +188,12 @@ public final class PackageRelationship {
|
|||||||
return targetUri;
|
return targetUri;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If it's an internal hyperlink target, we don't
|
||||||
|
// need to apply our normal validation rules
|
||||||
|
if (PackageRelationshipTypes.HYPERLINK_PART.equals(relationshipType)) {
|
||||||
|
return targetUri;
|
||||||
|
}
|
||||||
|
|
||||||
// Internal target
|
// Internal target
|
||||||
// If it isn't absolute, resolve it relative
|
// If it isn't absolute, resolve it relative
|
||||||
// to ourselves
|
// to ourselves
|
||||||
|
|||||||
@ -21,8 +21,8 @@ import java.net.URI;
|
|||||||
import java.net.URISyntaxException;
|
import java.net.URISyntaxException;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
|
import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
|
||||||
import org.apache.poi.ooxml.util.DocumentHelper;
|
import org.apache.poi.ooxml.util.DocumentHelper;
|
||||||
@ -37,7 +37,7 @@ import org.w3c.dom.NodeList;
|
|||||||
*/
|
*/
|
||||||
public final class PackageRelationshipCollection implements Iterable<PackageRelationship> {
|
public final class PackageRelationshipCollection implements Iterable<PackageRelationship> {
|
||||||
|
|
||||||
private static final Logger LOG = LogManager.getLogger(PackageRelationshipCollection.class);
|
private static final Logger LOG = PoiLogManager.getLogger(PackageRelationshipCollection.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Package relationships ordered by ID.
|
* Package relationships ordered by ID.
|
||||||
@ -287,7 +287,7 @@ public final class PackageRelationshipCollection implements Iterable<PackageRela
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Is this collection empty?
|
* Is this collection empty?
|
||||||
* @since POI 5.2.0
|
* @since 5.2.0
|
||||||
*/
|
*/
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return relationshipsByID.isEmpty();
|
return relationshipsByID.isEmpty();
|
||||||
@ -386,7 +386,7 @@ public final class PackageRelationshipCollection implements Iterable<PackageRela
|
|||||||
/**
|
/**
|
||||||
* Get this collection's spliterator.
|
* Get this collection's spliterator.
|
||||||
*
|
*
|
||||||
* @since POI 5.2.0
|
* @since 5.2.0
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Spliterator<PackageRelationship> spliterator() {
|
public Spliterator<PackageRelationship> spliterator() {
|
||||||
|
|||||||
@ -23,8 +23,8 @@ import java.nio.ByteBuffer;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.apache.poi.logging.PoiLogManager;
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
|
||||||
import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
|
import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ public final class PackagingURIHelper {
|
|||||||
// FIXME: this class implements a lot of path joining and splitting logic that
|
// FIXME: this class implements a lot of path joining and splitting logic that
|
||||||
// is already implemented in java.nio.file.Path.
|
// is already implemented in java.nio.file.Path.
|
||||||
// This class should heavily leverage Java library code to reduce the number of lines of code that POI has to maintain and test
|
// This class should heavily leverage Java library code to reduce the number of lines of code that POI has to maintain and test
|
||||||
private static final Logger LOG = LogManager.getLogger(PackagingURIHelper.class);
|
private static final Logger LOG = PoiLogManager.getLogger(PackagingURIHelper.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Package root URI.
|
* Package root URI.
|
||||||
@ -165,7 +165,9 @@ public final class PackagingURIHelper {
|
|||||||
if (partUri == null)
|
if (partUri == null)
|
||||||
throw new IllegalArgumentException("partUri");
|
throw new IllegalArgumentException("partUri");
|
||||||
|
|
||||||
return partUri.getPath().matches(
|
final String path = partUri.getPath();
|
||||||
|
|
||||||
|
return path != null && path.matches(
|
||||||
".*" + RELATIONSHIP_PART_SEGMENT_NAME + ".*"
|
".*" + RELATIONSHIP_PART_SEGMENT_NAME + ".*"
|
||||||
+ RELATIONSHIP_PART_EXTENSION_NAME + "$");
|
+ RELATIONSHIP_PART_EXTENSION_NAME + "$");
|
||||||
}
|
}
|
||||||
@ -285,7 +287,7 @@ public final class PackagingURIHelper {
|
|||||||
// form must actually be an absolute URI
|
// form must actually be an absolute URI
|
||||||
if(sourceURI.toString().equals("/")) {
|
if(sourceURI.toString().equals("/")) {
|
||||||
String path = targetURI.getPath();
|
String path = targetURI.getPath();
|
||||||
if(msCompatible && path.length() > 0 && path.charAt(0) == '/') {
|
if(msCompatible && !path.isEmpty() && path.charAt(0) == '/') {
|
||||||
try {
|
try {
|
||||||
targetURI = new URI(path.substring(1));
|
targetURI = new URI(path.substring(1));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@ -699,7 +701,7 @@ public final class PackagingURIHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// trailing white spaces must be url-encoded, see Bugzilla 53282
|
// trailing white spaces must be url-encoded, see Bugzilla 53282
|
||||||
if(value.length() > 0 ){
|
if(!value.isEmpty()){
|
||||||
StringBuilder b = new StringBuilder();
|
StringBuilder b = new StringBuilder();
|
||||||
int idx = value.length() - 1;
|
int idx = value.length() - 1;
|
||||||
for(; idx >= 0; idx--){
|
for(; idx >= 0; idx--){
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user