Compare commits

...

192 Commits

Author SHA1 Message Date
PJ Fanning
cfb713df29 use javadocs.dev 2026-02-22 23:53:35 +01:00
Dominik Stadler
44598bd030 Avoid OOM with incorrect property sizes
Add allocation check to verify size >= 0 and < 1mio
Also reformat code to match general coding style

Fixes https://issues.oss-fuzz.com/issues/485091380
2026-02-21 15:39:55 +01:00
Dominik Stadler
23369586da Avoid assertion when handling slightly corrupted emf-file
Also remove methods which are identical to the ones in the super-class

Fixes https://issues.oss-fuzz.com/issues/486039135
2026-02-21 15:39:54 +01:00
Dominik Stadler
9d9865c9b8 Avoid NPE when handling diagrams in pptx
Fixes https://issues.oss-fuzz.com/issues/484589690
2026-02-21 15:39:54 +01:00
Dominik Stadler
e9e9612a1f Avoid ClassCastException when reading headers of EMF files 2026-02-21 15:39:54 +01:00
Dominik Stadler
1594baf696 Avoid NPE when updating cell-anchors 2026-02-21 15:39:54 +01:00
Dominik Stadler
839ce4a0f4 Avoid NPE in HSSFShapeGroup.setShapeId() 2026-02-21 15:39:54 +01:00
Dominik Stadler
260b22fb09 Handle slightly broken file with empty BlipFill properly 2026-02-21 15:39:54 +01:00
PJ Fanning
ac4e3c199e more HSSFEventFactory changes 2026-02-20 20:19:10 +01:00
PJ Fanning
a1f6f2786f Update RecordFactoryInputStream.java 2026-02-20 19:55:49 +01:00
PJ Fanning
b923655b43 update tests 2026-02-20 19:48:56 +01:00
PJ Fanning
6b72a2dff3 Update DocumentInputStream.java 2026-02-20 19:46:56 +01:00
PJ Fanning
c7976440c3 Update TestRecordFactoryInputStream.java 2026-02-20 15:10:26 +01:00
PJ Fanning
811eb4a4a8
support reading HSSFWorkbook with password passed as param (#1016)
* support reading HSSFWorkbook with password passed as param

Update HSSFWorkbook.java

* npe issue

* remove one use of Biff8EncryptionKey

* extractor api

* support changing passwords
2026-02-20 15:06:33 +01:00
PJ Fanning
6ba4a1b050 Update TestDocumentEncryption.java 2026-02-20 14:52:28 +01:00
PJ Fanning
4efa2b7162 Update OldExcelExtractor.java 2026-02-20 13:47:36 +01:00
PJ Fanning
139321c5e9 Update HSSFWorkbook.java 2026-02-20 12:28:29 +01:00
PJ Fanning
6a9224385e deprecate unnecessary constructor 2026-02-20 12:25:18 +01:00
PJ Fanning
df5604a1d7
check input stream read params (#1012) 2026-02-17 09:20:28 +01:00
PJ Fanning
eafd6c04b8 Update security.xml 2026-02-16 19:59:54 +01:00
dependabot[bot]
e340f313bc
Bump net.bytebuddy:byte-buddy-agent from 1.18.4 to 1.18.5 (#1009)
Bumps [net.bytebuddy:byte-buddy-agent](https://github.com/raphw/byte-buddy) from 1.18.4 to 1.18.5.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.18.4...byte-buddy-1.18.5)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy-agent
  dependency-version: 1.18.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-16 16:33:31 +01:00
Dominik Stadler
bc02ef0703 Avoid NPE with malformed wmf headers 2026-02-14 21:26:00 +01:00
Dominik Stadler
692caf0f36 Avoid NPE with malformed master-style 2026-02-14 21:26:00 +01:00
Dominik Stadler
e96c9e17c0 Avoid NPE with malformed EscherAggregate 2026-02-14 21:26:00 +01:00
Dominik Stadler
55c1608a2d Avoid NPE with malformed anchors in slideshow files 2026-02-14 21:26:00 +01:00
Dominik Stadler
5338b17a8f Avoid NPE with malformed Visio diagram
Fixes https://issues.oss-fuzz.com/issues/477312394
2026-02-14 21:26:00 +01:00
Dominik Stadler
c92c533d7a Prevent large allocations when writing PPDrawing items
Add an allocation check which can be disabled if necessary.

Fixes https://issues.oss-fuzz.com/issues/477289649 and https://issues.oss-fuzz.com/issues/479564936
2026-02-14 21:26:00 +01:00
Yongho Hwang
8d53613bcf
Bug 69935: Add short-based column setters to ClientAnchor (#1006)
* Bug 69935: Add short-based column setters to ClientAnchor

Introduce short-based column setters on ClientAnchor to complement the existing int-based setters and improve Kotlin property support.

- Add default short setters setCol1(short) and setCol2(short) that delegate to the existing int-based setters.
- Add TestClientAnchorShortSetter to verify both the new short-based setters and the existing int-based setters.

Tests:
- ./gradlew :poi:test --tests 'org.apache.poi.ss.usermodel.TestClientAnchorShortSetter'

* Replace @since TBD with 6.0.0

* Add license header to TestClieAdd ASF license header to TestClientAnchorShortSetterntAnchorShortSetter.java

Added license header to TestClientAnchorShortSetter.java
2026-02-14 09:50:52 +01:00
Dominik Stadler
62ae400993 Do not call getColumn() twice
It always iterates over the array of columns, so we
should reuse the result here.
2026-02-02 18:15:11 +01:00
Dominik Stadler
ae3ed57baa Prevent a file-handle leak
File-handles could leak when an exception occurs during
class initialization when loading an broken workbook-file
2026-02-02 18:15:10 +01:00
dependabot[bot]
8f149f51d0
Bump commons-codec:commons-codec from 1.20.0 to 1.21.0 (#1004)
Bumps [commons-codec:commons-codec](https://github.com/apache/commons-codec) from 1.20.0 to 1.21.0.
- [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt)
- [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.20.0...rel/commons-codec-1.21.0)

---
updated-dependencies:
- dependency-name: commons-codec:commons-codec
  dependency-version: 1.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-30 18:10:06 +01:00
Dominik Stadler
ab196a7441 Use log instead of assert when parsing emf-files
Assert effectively hides problem in provided input files.
2026-01-24 14:47:30 +01:00
Dominik Stadler
da3d64d9e3 Add an NPE check when retrieving fonts for bullet-items 2026-01-24 14:47:30 +01:00
Dominik Stadler
04f4c1fa74 Avoid NPE when retrieving sheets by name with invalid name 2026-01-24 14:47:30 +01:00
Dominik Stadler
513a805c25 Describe where to get the latest spotbugs 2026-01-24 14:47:26 +01:00
Dominik Stadler
0ae15edb2c Perform an allocation-check for .emf files 2026-01-24 14:45:16 +01:00
Dominik Stadler
5eba199642 Fix tests for no-scratchpad 2026-01-18 20:53:44 +01:00
Dominik Stadler
0de8ecd6a0 Recent tests add one more file to ooxml-lite 2026-01-18 20:53:44 +01:00
Dominik Stadler
d1f3f9489f Add check for too large allocation in SharedFormulaGroup
A malformed spreadsheet could trigger a very large allocation.

Can be overruled by users via IOUtils.setByteArrayMaxOverride().

Fixes https://issues.oss-fuzz.com/issues/476431391
2026-01-18 18:28:36 +01:00
Dominik Stadler
d1f0a88ea1 Avoid NPE in XSLFDiagram
Throw IllegalStateException instead

Fixes https://issues.oss-fuzz.com/issues/476184825
2026-01-18 18:28:36 +01:00
Dominik Stadler
beab88fb0e Remove obsolete if-condition
All branches perform the same action now anyway
2026-01-18 18:28:36 +01:00
Dominik Stadler
66109187d1 Only allocate the required size for EscherComplexProperty
Otherwise a malformed document can cause OOM by reserving
large chunks of memory, but only using little of it.

This fixes https://issues.oss-fuzz.com/issues/476184826
2026-01-18 18:28:36 +01:00
Dominik Stadler
c9b37678cc Introduce getComplexSize()
To not materialize the array only to get its size
2026-01-18 18:28:35 +01:00
Dominik Stadler
e54ba888e2 Log instead of an assertion
Issues which can be triggered by malformed documents
should not use "assert"
2026-01-18 18:27:05 +01:00
Dominik Stadler
8df367310c Avoid some more NPEs on slightly broken documents 2026-01-18 18:27:05 +01:00
PJ Fanning
58ac8d05f0
throw exception if getAlpha returns very large value (that is too big for int) (#1000) 2026-01-17 15:09:06 +01:00
Jacobo Aragunde Pérez
372388b7ed
Support rendering transparent bitmaps in presentations. (#990)
* Support rendering transparent bitmaps in presentations.

Add PictureShape.getAlpha() method and implementations for HSLF and
XSLF. Then make use of it in DrawPictureShape to apply the right alpha
value to the picture being drawn.

Fixed a bug in BitmapImageRenderer that considered alpha value 0 as
"fully opaque", when it means "fully transparent" instead.

Finally, added a test for this feature in TestDrawPictureShape for XSLF.
A test for HSLF could not be created because it was not possible to
generate a test file with today's tools; MS Office removes the
bitmap transparency effect when saving as .ppt, and LibreOffice blends
it into the bitmap.

* Address reviewer comments.

* Add comment about default alpha value.

* Prevent NPE in XSLFPictureShape.getAlpha().

* Change wording in comments to avoid the word "percentage".

* Use static vars for extreme alpha values.
2026-01-17 13:47:09 +01:00
PJ Fanning
e3e04a641f
Fix missing newline at end of TestXSLFTextShape.java
Add missing newline at the end of the file.
2026-01-17 13:46:01 +01:00
Dominik Stadler
d72e3a608c Add a file-handler for .emf files
These can be embedded in slideshows and POI supports
some handling of them.

Also Tika uses this code to extract some textual information
from such images.
2026-01-16 18:49:27 +01:00
Dominik Stadler
1910fff53e Add a file-handler for .wmf files
These can be embedded in slideshows and POI supports
some handling of them.

Also Tika uses this code to extract some textual information
from such images.
2026-01-16 18:49:27 +01:00
Dominik Stadler
22531fe638 Prevent invalid height/width in wmf-images exhausting memory
Introduce an adjustable limit of maximum number of pixels
for when drawing the image
2026-01-16 18:49:27 +01:00
Dominik Stadler
9c2f487c98 Bug 69927: Avoid NPE when parsing wmf-file
headerBitCount can be null if the header contains an
invalid flag
2026-01-16 18:49:27 +01:00
Dominik Stadler
b09bf904d7 Fix running integration-tests without scratchpad-libraries 2026-01-16 18:49:27 +01:00
Dominik Stadler
2acb5cf66a Avoid several NPEs
When retrieving picture data
When retrieving text in slides
When handling XSLFTableStyles
In EmbeddedExtractor if ShapeName is not set
In HSSF with invalid EscherSpRecord
In HSSF with invalid RecordStreams
When drawing arcs for shapes in slides
In HSSFPicture.getPictureIndex
Adjust "opens" for tests in poi-ooxml

Either handle it gracefully or throw
IllegalStateException instead for broken files
2026-01-16 18:49:27 +01:00
dependabot[bot]
d60edd21a3
Bump net.bytebuddy:byte-buddy from 1.18.3 to 1.18.4 (#998)
Bumps [net.bytebuddy:byte-buddy](https://github.com/raphw/byte-buddy) from 1.18.3 to 1.18.4.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.18.3...byte-buddy-1.18.4)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy
  dependency-version: 1.18.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-01-16 17:44:32 +01:00
PJ Fanning
fd4d143d44
XSSFReader: tolerate missing comments file (#996) 2026-01-14 21:06:26 +01:00
PJ Fanning
df2d5d62d9
rename param in ColumnHelper
see #993
2026-01-13 10:59:09 +01:00
Dominik Stadler
8cdcda2873 Avoid NPE when handling color-highlighting in text-runs 2026-01-12 06:48:24 +01:00
Dominik Stadler
18ef01295d Avoid some NPEs when handling LinkTables 2026-01-12 06:48:24 +01:00
Dominik Stadler
ac4295deac Avoid NPE when a row in a workbook was deleted and thus getRow() returns null 2026-01-12 06:48:23 +01:00
Dominik Stadler
d93a29ae67 Optimize handling of large XSSFTables
The current implementation calls updateHeaders() very often
causing cloning a sheet to take very long with high CPU.

We can optimize a number of things here:
* Use getTableColumnArray() as the List-based methods
have very costly implementations of hasNext()/next()
* Avoid some duplicated calls to updateHeaders()

There are likely more aggressive optimizations like
only calling updateHeaders() once after cloning,
but this would require more invasive changes in this
rarely used code-area.
2026-01-12 06:48:23 +01:00
Dominik Stadler
1fc4f9e3b7 Avoid ClastCastException when handling a broken ppt file 2026-01-12 06:48:23 +01:00
Dominik Stadler
b401b92aea Avoid NPE when reading a broken pptx file 2026-01-12 06:48:23 +01:00
Dominik Stadler
a5f5f4294e Avoid NPE when reading a broken xlsb file
Throw a more useful exception instead
2026-01-12 06:48:23 +01:00
PJ Fanning
ba04c61188 format methods 2026-01-11 10:34:54 +01:00
Dominik Stadler
f8a8189230 Use the proper add-method to perform the check for max number of children
If adding is done without check it can trigger OOM when fuzzing.

This should fix https://issues.oss-fuzz.com/issues/391709145
2026-01-10 13:14:34 +01:00
Dominik Stadler
95b2a1cf1d Avoid NPE with broken files when reading xls file 2026-01-10 13:14:34 +01:00
Dominik Stadler
017ff5f8f8 Implement lazy allocation of data for complex escher properties
This may reduce memory usage if the content is never used
or not populated for some reason.

This should fix https://issues.oss-fuzz.com/issues/42528528
2026-01-10 13:14:34 +01:00
PJ Fanning
cc8b6d7591 Update XWPFTheme.java 2026-01-09 14:35:59 +01:00
Jacobo Aragunde Pérez
6670c48c30
Add getter for body elements in XWPFSDTContent. (#991)
* Add getter for body elements in XWPFSDTContent.

This getter allows to navigate the POI objects stored inside a
XWPFSDTContent object without resorting to navigating XML.

* Address comments in review.
2026-01-09 13:28:30 +01:00
Etienne Gautier
aead782eb2
XWPF Themes: allow public access of theme and add helpers for theme fonts (#986)
* allow public access of theme and add helpers for theme fonts

* nit:naming

* add javadoc and tests

* Fix formatting of getMajorFontForScript method

* Refactor font retrieval methods for null checks

* Update XWPFTheme.java

---------

Co-authored-by: PJ Fanning <pjfanning@users.noreply.github.com>
2026-01-09 13:09:12 +01:00
Dominik Stadler
c94e795f35 Avoid NPE with broken files when writing endnotes for Word documents
https://issues.oss-fuzz.com/issues/391728757
2026-01-09 08:45:03 +01:00
Dominik Stadler
e9b33c0b08 Avoid NPE with broken files when writing endnotes for Word documents
Fixes https://issues.oss-fuzz.com/issues/392690733
2026-01-09 08:45:03 +01:00
Dominik Stadler
befc941dcf Avoid NPE with broken files when handling paint-style for fill 2026-01-09 08:45:03 +01:00
Dominik Stadler
ac989335d7 Avoid NPE with broken files when handling text-shapes 2026-01-09 08:45:03 +01:00
Dominik Stadler
0ec4434f59 Avoid NPE with broken file 2026-01-09 08:45:03 +01:00
Dominik Stadler
c28aec61d4 Avoid an NPE when reading broken SlideShow-files 2026-01-09 08:45:03 +01:00
Dominik Stadler
b195a3b9ed Avoid an NPE when OPCPackage is closed without being fully initialized 2026-01-06 22:47:00 +01:00
Dominik Stadler
ddf71d0984 Avoid two NPEs which were currently "expected" in tests
When things go wrong, we always want to give an
explanation via an exception instead of an NPE.
2026-01-06 22:47:00 +01:00
Dominik Stadler
fb75600872 Don't throw RuntimeException in integration-tests
This prepares us to include the FileHandlers in fuzz-testing
via oss-fuzz while keeping to not expect any direct
RuntimeException being caught.
2026-01-06 22:47:00 +01:00
PJ Fanning
4dadb9d6cc
Update copyright year in NOTICE file 2026-01-03 14:38:23 +01:00
PJ Fanning
e7515ba5e6 log4j 2.25.3 2025-12-29 13:29:43 +01:00
dependabot[bot]
c1fac56998
Bump log4jVersion from 2.24.3 to 2.25.3 (#975)
Bumps `log4jVersion` from 2.24.3 to 2.25.3.

Updates `org.apache.logging.log4j:log4j-bom` from 2.24.3 to 2.25.3
- [Release notes](https://github.com/apache/logging-log4j2/releases)
- [Changelog](https://github.com/apache/logging-log4j2/blob/2.x/RELEASE-NOTES.adoc)
- [Commits](https://github.com/apache/logging-log4j2/compare/rel/2.24.3...rel/2.25.3)

Updates `org.apache.logging.log4j:log4j-slf4j2-impl` from 2.24.3 to 2.25.3

---
updated-dependencies:
- dependency-name: org.apache.logging.log4j:log4j-bom
  dependency-version: 2.25.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.apache.logging.log4j:log4j-slf4j2-impl
  dependency-version: 2.25.3
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-29 13:27:00 +01:00
PJ Fanning
3a56bbd73b Update TestDetectAsOOXML.java 2025-12-25 11:17:12 +01:00
dependabot[bot]
6d42ff955a
Bump net.bytebuddy:byte-buddy from 1.18.2 to 1.18.3 (#984)
Bumps [net.bytebuddy:byte-buddy](https://github.com/raphw/byte-buddy) from 1.18.2 to 1.18.3.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.18.2...byte-buddy-1.18.3)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy
  dependency-version: 1.18.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-22 16:10:05 +01:00
emmanueldufour
528591ba11
Allow to load a word document with chartex chart (#982)
* Allow to load a word document with chartex chart

ChartEx (new charts introduced in Office 2016) will raise exceptions in underlying XML parsing, we catch them here in order to still be able to load the document

* spacing

some extra spaces were unbearable and could have prevented the pull request

* add test

* Update POIXMLDocumentPart.java

* Update POIXMLDocumentPart.java

* Update POIXMLDocumentPart.java

* reduce risk of swallowing zip bomb exceptions

* Update POIXMLDocumentPart.java

---------

Co-authored-by: PJ Fanning <pjfanning@users.noreply.github.com>
2025-12-19 20:10:25 +01:00
PJ Fanning
c703d00300 Update build.gradle 2025-12-19 17:31:40 +01:00
Dominik Stadler
9e1afbbab1 Fix some more Gradle deprecation-warnings in preparation for Gradle 9
Only signing-handling in poi-ooxml is still remaining, but
this deprecation seems to have been moved to Gradle 10 anyway.

Gradle 9 will require JDK 17, though, so we can only upgrade
when the min. supported JDK is bumped once more.
2025-12-19 16:15:21 +01:00
dependabot[bot]
3ac160b57d
Bump org.sonarqube from 7.2.1.6560 to 7.2.2.6593 (#983)
Bumps org.sonarqube from 7.2.1.6560 to 7.2.2.6593.

---
updated-dependencies:
- dependency-name: org.sonarqube
  dependency-version: 7.2.2.6593
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-19 16:09:48 +01:00
PJ Fanning
f2c52141c7
remove pre-existing inline strings when updating value (#962)
* remove pre-existing inline strings when updating value

* Update TestXSSFCell.java
2025-12-18 19:45:50 +01:00
Dominik Stadler
fd66689944 Improve message if test fails 2025-12-17 22:12:41 +01:00
Dominik Stadler
97a97bd75c JavaDoc: Don't link to classes from "poi-ooxml" in module "poi"
Otherwise building javadoc in CI fails sometimes, maybe if
the repository is cleaned before building.

And add some missing javadoc
2025-12-17 22:12:41 +01:00
Dominik Stadler
338882ac88 Convert some files to unix newlines
Otherwise these can cause issues when checking out
sources on Windows
2025-12-17 22:11:29 +01:00
Dominik Stadler
2dd124eb42 Fix some Gradle deprecation warnings
A number of warnings still remain,
they seem a bit more complicated to fix.
2025-12-17 22:11:29 +01:00
PJ Fanning
fe3359bd79
refactor recurse check (#979) 2025-12-17 22:08:23 +01:00
PJ Fanning
6762b5a9fb Revert "Update XSSFCell.java"
This reverts commit 037a001719d3beb8f31cb4022dd34cd28a318c61.
2025-12-17 21:49:08 +01:00
PJ Fanning
037a001719 Update XSSFCell.java 2025-12-17 21:31:06 +01:00
PJ Fanning
3a69605f4c
[bz-69905] check cell before recursing (#978) 2025-12-17 21:29:03 +01:00
dependabot[bot]
08e9bb00d4
Bump org.sonarqube from 7.2.0.6526 to 7.2.1.6560 (#976)
Bumps org.sonarqube from 7.2.0.6526 to 7.2.1.6560.

---
updated-dependencies:
- dependency-name: org.sonarqube
  dependency-version: 7.2.1.6560
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-17 21:24:32 +01:00
Jacobo Aragunde Pérez
4fb34ebeae
Fix rules for table style application in XSLFTables. (#969)
* Fix rules for table style application in XSLFTables.

Table styles contain rules for first and last rows/columns, even and
odd rows/columns... When one of these rules is empty, we are supposed
to fall back to the "whole table" rules. The fallback must also be
applied for the format that's not explicitly specified in the specific
rules.

when the corresponding specific rule is missing some info.

Fallback must also be applied when the corresponding specific rule is
missing some info. A couple of examples from the reproducer/test file
included:

The included reproducer/test file contained a few problems related to
table style application:
* The second style for horizontal/vertical banding (band2H, band2V) was
  never applied.
* In the table with horizontal banding enabled, the style band1H did
  not set a font color, POI returned a null font color instead of the
  color from wholeTable.
* In the table with horizontal banding enabled, the style band2H did
  not set a background color, POI returned null instead of the color
  specified in wholeTable.

This patches fixes the behaviors mentioned above, making POI behavior
match the one from MS Office and LibreOffice.

* Replace uses of java.util.list.getFirst().
2025-12-16 18:03:45 +01:00
dependabot[bot]
f476c64179
Bump com.github.spotbugs from 6.4.7 to 6.4.8 (#972)
Bumps com.github.spotbugs from 6.4.7 to 6.4.8.

---
updated-dependencies:
- dependency-name: com.github.spotbugs
  dependency-version: 6.4.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-16 15:44:28 +01:00
dependabot[bot]
a9bc28a4bb
Bump org.mockito:mockito-core from 5.20.0 to 5.21.0 (#970)
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.20.0 to 5.21.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v5.20.0...v5.21.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-version: 5.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 20:43:46 +01:00
dependabot[bot]
0eb7135f2b
Bump org.sonarqube from 7.1.0.6387 to 7.2.0.6526 (#960)
Bumps org.sonarqube from 7.1.0.6387 to 7.2.0.6526.

---
updated-dependencies:
- dependency-name: org.sonarqube
  dependency-version: 7.2.0.6526
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-13 13:06:56 +01:00
hyun1024
4b3c688d51
Add methods to manage first slide number(firstSlideNum) (#968)
* Add methods to manage first slide number(firstSlideNum)

Adds methods to manage the custom starting slide number in XSLF (PowerPoint) presentations. This property is stored as the 'firstSlideNum' attribute in ppt/presentation.xml.

The following methods are added to XMLSlideShow:
- getFirstSlideNumber(): Retrieves the current starting slide number (default is 1).
- setFirstSlideNumber(int num): Sets the custom starting slide number.
- unsetFirstSlideNumber(): Removes the 'firstSlideNum' attribute, reverting to the default (1).

Constraints:
The 'set' method enforces the bounds [0, 9999] as defined by Microsoft's implementation specifications (MS-OI29500, Part 1, Section 19.2.1.26) to ensure the creation of valid PowerPoint files.

Also includes TestXSLFSlideShow updates to cover the new functionality, persistence, and validation checks.

* Review: Apply review feedback to firstSlideNumber feature

- Add @since 6.0.0 Javadoc tag to getFirstSlideNumber(), setFirstSlideNumber(), and unsetFirstSlideNumber() methods in XMLSlideShow.
- Refactor TestXSLFSlideShow to use explicit static JUnit imports (e.g., assertEquals, assertThrows) instead of wildcard imports, adhering to project coding style guidelines.

* whitespace

---------

Co-authored-by: PJ Fanning <pjfanning@users.noreply.github.com>
2025-12-13 13:06:04 +01:00
PJ Fanning
e4e4582689
add cell tests (#965) 2025-12-08 20:56:38 +01:00
PJ Fanning
027927bfad
[bz-69897] Fix null check for LineDash properties (#964) 2025-12-08 15:47:50 +01:00
PJ Fanning
2098df7467 broken javadoc 2025-12-08 14:04:45 +01:00
PJ Fanning
40ca9bd085 commercial support page 2025-12-08 11:33:53 +01:00
PJ Fanning
88836e1614 add versioning support section 2025-12-08 10:44:42 +01:00
PJ Fanning
e7620b7ce7 set up default impls of new(-ish) methods 2025-12-05 10:58:48 +01:00
PJ Fanning
6d6089eee5
nullSafeFormatProperties (#961) 2025-12-05 10:51:57 +01:00
Dominik Stadler
57ffd3aa12 Remove unused list of pivot-caches and update deprecations
Seems the list is currently never accessed any more.
2025-12-03 21:35:02 +01:00
Dominik Stadler
2428265d35 Update Gradle Wrapper 2025-12-03 21:35:02 +01:00
Dominik Stadler
3d9c243943 Ant-target "javadoc" requires compiled sources 2025-12-03 21:35:02 +01:00
Dominik Stadler
236784371b Update JavaDoc-references to JDK 11 2025-12-03 21:35:02 +01:00
Dominik Stadler
47d0e956b8 Add missing Mockito which is needed for module-based execution of tests
This seems to only fail in Ant-based test-execution for some reason
2025-12-02 20:33:42 +01:00
Dominik Stadler
74bdee9c0d Avoid usage of package org.mockito.internal
Otherwise JUnit tests fail in CI now when
the module-system is used.
2025-12-02 20:33:42 +01:00
Dominik Stadler
e5336586a9 Add missing @Deprecated 2025-12-02 20:33:42 +01:00
Dominik Stadler
2805093da6 Add missing Mockito which is needed for module-based execution of tests
This seems to only fail in Ant-based test-execution
2025-12-02 19:47:08 +01:00
Dominik Stadler
2a2e4f095e Adjust source-rebuild-test for version 6 2025-12-02 19:22:05 +01:00
dependabot[bot]
5d8d3e77bf
Bump com.github.spotbugs from 6.4.6 to 6.4.7 (#959)
Bumps com.github.spotbugs from 6.4.6 to 6.4.7.

---
updated-dependencies:
- dependency-name: com.github.spotbugs
  dependency-version: 6.4.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-02 15:53:44 +01:00
vo0ff
006e49765c
Bugzilla 69303: Fix RangeCopier's copyMergedRanges when copying withing the same sheet (#958)
* Bugzilla 69303: added failing test for case with same sheet RangeCopier for merged regions

* Bugzilla 69303: fixed same sheet issue when enabling copy of merged ranges

* Bugzilla 69303: added @since 6.0.0 to new public methods

---------

Co-authored-by: Viktor Ozerov <vik.ozerov+git@gmail.com>
2025-12-01 22:38:04 +01:00
Gili Tzabari
c953a8ff22
Add XSSFOptimiser - XSSF equivalent of HSSFOptimiser (#952)
* Add XSSFOptimiser - XSSF equivalent of HSSFOptimiser

Adds optimization methods for XSSF workbooks to address style explosion
issues. HSSFOptimiser exists for HSSF but no equivalent existed for XSSF.

Methods added:
- optimiseCellStyles(XSSFWorkbook): Remaps cells using duplicate styles
  to canonical (first) occurrence
- optimiseFonts(XSSFWorkbook): Updates style font references to canonical
  fonts

Implementation uses a safe remapping approach rather than removing entries
from XML, which avoids XmlValueDisconnectedException issues caused by
StylesTable's internal list becoming disconnected from CTStylesheet.

Includes comprehensive test coverage in TestXSSFOptimiser.

Closes #951

* Address PR review comments

- Add "since 6.0.0" javadoc tag to XSSFOptimiser class
- Use Locale.ROOT in String.format() to comply with forbidden-apis check
2025-12-01 19:30:27 +01:00
PJ Fanning
f44ece137f adjust 'since' values to remove POI 2025-12-01 19:28:56 +01:00
PJ Fanning
97cef0a3e3 Update RELEASE-NOTES.txt 2025-12-01 09:53:09 +01:00
PJ Fanning
73d1fc53f5 Update download.xml 2025-11-30 20:34:14 +01:00
PJ Fanning
614d7c7002 Update release-guide.txt 2025-11-30 20:16:34 +01:00
PJ Fanning
c51dadf703 release 5.5.1 2025-11-30 20:11:35 +01:00
dependabot[bot]
c5c2540abb
Bump com.github.spotbugs from 6.4.5 to 6.4.6 (#957)
Bumps com.github.spotbugs from 6.4.5 to 6.4.6.

---
updated-dependencies:
- dependency-name: com.github.spotbugs
  dependency-version: 6.4.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-28 16:19:53 +01:00
dependabot[bot]
97ea97b5a2
Bump net.bytebuddy:byte-buddy-agent from 1.18.1 to 1.18.2 (#955)
Bumps [net.bytebuddy:byte-buddy-agent](https://github.com/raphw/byte-buddy) from 1.18.1 to 1.18.2.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.18.1...byte-buddy-1.18.2)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy-agent
  dependency-version: 1.18.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-27 15:57:48 +01:00
PJ Fanning
6b6735a3c4 Update changes.xml 2025-11-26 22:05:00 +01:00
PJ Fanning
1dbfba9225 Update changes.xml 2025-11-26 20:54:08 +01:00
dependabot[bot]
c4e0cde59c
Bump bouncyCastleVersion from 1.82 to 1.83 (#953)
Bumps `bouncyCastleVersion` from 1.82 to 1.83.

Updates `org.bouncycastle:bcpkix-jdk18on` from 1.82 to 1.83
- [Changelog](https://github.com/bcgit/bc-java/blob/main/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

Updates `org.bouncycastle:bcutil-jdk18on` from 1.82 to 1.83
- [Changelog](https://github.com/bcgit/bc-java/blob/main/docs/releasenotes.html)
- [Commits](https://github.com/bcgit/bc-java/commits)

---
updated-dependencies:
- dependency-name: org.bouncycastle:bcpkix-jdk18on
  dependency-version: '1.83'
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: org.bouncycastle:bcutil-jdk18on
  dependency-version: '1.83'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-26 15:42:57 +01:00
PJ Fanning
32d7a45b50 license headers 2025-11-26 13:39:37 +01:00
PJ Fanning
528b72d347 Update versioning.xml 2025-11-26 12:13:24 +01:00
PJ Fanning
ccacd1540c version support 2025-11-26 12:07:09 +01:00
dependabot[bot]
22ff9e34b6
Bump actions/checkout from 5 to 6 (#949)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 20:45:50 +01:00
Jacobo Aragunde Pérez
775da74dee
Fix NPE in XWPFParagraph.getCTSpacing(). (#950)
We recently changed the getters so they don't create the PPr object if
it doesn't exist, but we missed adding one null check for the new
situation.

Add a test to exercise all the getters in a case where there isn't a PPr
object.
2025-11-24 20:44:02 +01:00
PJ Fanning
b4326363d6 Update news.xml 2025-11-23 21:04:37 +01:00
PJ Fanning
ed156e63c6 update trademark text 2025-11-23 20:25:00 +01:00
dependabot[bot]
5a7cd39393
Bump org.sonarqube from 7.0.1.6134 to 7.1.0.6387 (#948)
Bumps org.sonarqube from 7.0.1.6134 to 7.1.0.6387.

---
updated-dependencies:
- dependency-name: org.sonarqube
  dependency-version: 7.1.0.6387
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-21 20:08:49 +01:00
PJ Fanning
8f1cfa2eb3
Upgrade commons-codec dependency to 1.20.0 2025-11-20 15:31:22 +01:00
dependabot[bot]
2cb8c4020e
Bump commons-codec:commons-codec from 1.19.0 to 1.20.0 (#946)
Bumps [commons-codec:commons-codec](https://github.com/apache/commons-codec) from 1.19.0 to 1.20.0.
- [Changelog](https://github.com/apache/commons-codec/blob/master/RELEASE-NOTES.txt)
- [Commits](https://github.com/apache/commons-codec/compare/rel/commons-codec-1.19.0...rel/commons-codec-1.20.0)

---
updated-dependencies:
- dependency-name: commons-codec:commons-codec
  dependency-version: 1.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-20 15:28:12 +01:00
dependabot[bot]
4b38ab5401
Bump com.github.spotbugs from 6.4.4 to 6.4.5 (#944)
Bumps com.github.spotbugs from 6.4.4 to 6.4.5.

---
updated-dependencies:
- dependency-name: com.github.spotbugs
  dependency-version: 6.4.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-19 17:45:37 +01:00
dependabot[bot]
e7c0389865
Bump de.thetaphi.forbiddenapis from 3.9 to 3.10 (#945)
Bumps de.thetaphi.forbiddenapis from 3.9 to 3.10.

---
updated-dependencies:
- dependency-name: de.thetaphi.forbiddenapis
  dependency-version: '3.10'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-19 15:40:28 +01:00
PJ Fanning
d83039cca7 Update README.md 2025-11-19 14:27:44 +01:00
PJ Fanning
62e12fdb1b Update README.md 2025-11-19 14:25:00 +01:00
PJ Fanning
53ceff13b2 jar details 2025-11-19 14:22:16 +01:00
PJ Fanning
fa95a3e522
reduce use of setCellType (#943) 2025-11-19 14:20:56 +01:00
PJ Fanning
031793ddaf
remove deprecated AddDimensionedImage (#942) 2025-11-19 14:10:23 +01:00
PJ Fanning
e73c419a37 switch to README.md 2025-11-19 14:09:08 +01:00
PJ Fanning
540f0e5617
remove deprecated hasOOXMLHeader method (#941) 2025-11-19 13:58:41 +01:00
PJ Fanning
9fb2c4b03e
make getCachedResultType return enum (#939) 2025-11-19 13:58:18 +01:00
PJ Fanning
cb520e8046
remove deprecated getCodepoints method (#940) 2025-11-19 13:58:03 +01:00
PJ Fanning
ae0a17765e remove deprecated isStartAtOverriden 2025-11-19 13:44:59 +01:00
PJ Fanning
71b4b62a6d remove deprecated shortArrayToByteArray 2025-11-19 13:43:55 +01:00
PJ Fanning
a2ed8fda3a protect asf-site branch 2025-11-19 00:39:02 +01:00
PJ Fanning
2f5ec43601 Update versioning.xml 2025-11-19 00:15:14 +01:00
PJ Fanning
b45b7095c0 Update index.xml 2025-11-19 00:09:16 +01:00
PJ Fanning
9b7938bf81 update docs 2025-11-18 23:55:40 +01:00
dependabot[bot]
789fcc29bb
Bump org.apache.pdfbox:pdfbox from 3.0.5 to 3.0.6 (#938)
Bumps org.apache.pdfbox:pdfbox from 3.0.5 to 3.0.6.

---
updated-dependencies:
- dependency-name: org.apache.pdfbox:pdfbox
  dependency-version: 3.0.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 17:26:01 +01:00
dependabot[bot]
1c4f68f262
Bump commons-io:commons-io from 2.20.0 to 2.21.0 (#937)
Bumps [commons-io:commons-io](https://github.com/apache/commons-io) from 2.20.0 to 2.21.0.
- [Changelog](https://github.com/apache/commons-io/blob/master/RELEASE-NOTES.txt)
- [Commits](https://github.com/apache/commons-io/compare/rel/commons-io-2.20.0...rel/commons-io-2.21.0)

---
updated-dependencies:
- dependency-name: commons-io:commons-io
  dependency-version: 2.21.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-18 15:56:39 +01:00
PJ Fanning
7ec1fc01d4 Update changes.xml 2025-11-17 17:50:45 +01:00
dependabot[bot]
ad925ac0d1
Bump net.bytebuddy:byte-buddy-agent from 1.17.7 to 1.18.1 (#935)
Bumps [net.bytebuddy:byte-buddy-agent](https://github.com/raphw/byte-buddy) from 1.17.7 to 1.18.1.
- [Release notes](https://github.com/raphw/byte-buddy/releases)
- [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md)
- [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.17.7...byte-buddy-1.18.1)

---
updated-dependencies:
- dependency-name: net.bytebuddy:byte-buddy-agent
  dependency-version: 1.18.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-17 15:26:02 +01:00
dependabot[bot]
7a36dfe031
Bump org.xmlunit:xmlunit-core from 2.10.4 to 2.11.0 (#934)
Bumps [org.xmlunit:xmlunit-core](https://github.com/xmlunit/xmlunit) from 2.10.4 to 2.11.0.
- [Release notes](https://github.com/xmlunit/xmlunit/releases)
- [Changelog](https://github.com/xmlunit/xmlunit/blob/main/RELEASE_NOTES.md)
- [Commits](https://github.com/xmlunit/xmlunit/compare/v2.10.4...v2.11.0)

---
updated-dependencies:
- dependency-name: org.xmlunit:xmlunit-core
  dependency-version: 2.11.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-17 15:25:32 +01:00
PJ Fanning
a5d43073a6 Update create_jobs.groovy 2025-11-17 15:16:36 +01:00
PJ Fanning
c840e660b7
Update GitHub description and homepage URL 2025-11-17 14:57:42 +01:00
PJ Fanning
f258b2b26d
Add protected branch for version 5.5.x 2025-11-17 14:54:32 +01:00
PJ Fanning
90e5d5d998 Update test-gradle.yml 2025-11-17 14:53:33 +01:00
PJ Fanning
7631eae9b2 try to fix issue with missing module-info classes 2025-11-17 14:17:51 +01:00
Dominik Stadler
3116668737 Remove identical overriding method 2025-11-16 22:34:18 +01:00
Dominik Stadler
b770a35aba Add missing @Deprecated and @Removal 2025-11-16 22:34:18 +01:00
Dominik Stadler
59e595b844 Remove some of the deprecated methods with @Removal("6.0.0")
We announced their removal for 6.0.0, so
we can remove them now as we plan a 6.0.0 release
next.

Some were not yet removed as they have still internal
usage or seem to need more work to finally remove.
2025-11-16 22:34:18 +01:00
Dominik Stadler
c6a621edc6 Remove deprecated methods with @Removal("5...")
We announced their removal already for 5.0.0 or 5.3.0, so
we can safely remove them now as we plan a 6.0.0 release
next.

Cell.setCellType() needs a closer look later as
it is not a simple deletion of code.
2025-11-16 22:34:18 +01:00
Dominik Stadler
f774a638cb Switch to JDK 11 some more
This should fix building with Ant with JDK > 11,
hopefully IBM JDK in CI as well.
2025-11-16 22:34:17 +01:00
Dominik Stadler
73b904f16d Remove workarounds for IBM JDK and JDK patchlevel 21.0.1
IBM JDK 11 seems to be fixed and we do not expect to run
tests with JDK 21.0.1 anymore
2025-11-16 14:18:06 +01:00
Dominik Stadler
cd22293975 Newer Mockito prevents using code from org.mockito.internal.matchers
At least locally tests fail now for me, so let's get rid of using
internal code here.
2025-11-16 14:18:06 +01:00
Dominik Stadler
d486e50822 Use OpenRewrite to update code to make use of Java 11 2025-11-16 14:18:06 +01:00
Dominik Stadler
89fa331beb Sync third-party-library-versions in build.xml 2025-11-16 14:18:06 +01:00
PJ Fanning
1604c410d1 java 11 2025-11-15 12:33:21 +01:00
PJ Fanning
61203972a5 Update create_jobs.groovy 2025-11-15 12:33:21 +01:00
dependabot[bot]
709bfd4305
Bump org.sonarqube from 4.0.0.2929 to 7.0.1.6134 (#923)
Bumps org.sonarqube from 4.0.0.2929 to 7.0.1.6134.

---
updated-dependencies:
- dependency-name: org.sonarqube
  dependency-version: 7.0.1.6134
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-15 12:09:02 +01:00
PJ Fanning
3b69442907 Update index.xml 2025-11-15 12:02:39 +01:00
PJ Fanning
1d4f5d34bd 5.5.0 release notes 2025-11-15 11:54:49 +01:00
PJ Fanning
bc2b1b0422 Update changes.xml 2025-11-15 11:40:44 +01:00
dependabot[bot]
7b5fe9c42b
Bump org.mockito:mockito-core from 4.11.0 to 5.20.0 (#906)
Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 4.11.0 to 5.20.0.
- [Release notes](https://github.com/mockito/mockito/releases)
- [Commits](https://github.com/mockito/mockito/compare/v4.11.0...v5.20.0)

---
updated-dependencies:
- dependency-name: org.mockito:mockito-core
  dependency-version: 5.20.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-15 11:39:14 +01:00
dependabot[bot]
dd0d6deb81
Bump com.github.spotbugs from 6.1.13 to 6.4.4 (#922)
Bumps com.github.spotbugs from 6.1.13 to 6.4.4.

---
updated-dependencies:
- dependency-name: com.github.spotbugs
  dependency-version: 6.4.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-15 11:38:48 +01:00
PJ Fanning
16ecbc7d48 build issues 2025-11-15 11:34:52 +01:00
PJ Fanning
323b5c8c6b start move to require java 11 min 2025-11-15 11:26:19 +01:00
PJ Fanning
41f4570c8f Update create_jobs.groovy 2025-11-15 11:20:36 +01:00
PJ Fanning
58ee3f732b Update create_jobs.groovy 2025-11-15 11:07:04 +01:00
PJ Fanning
7ec830f892 set version to 6.0.0-SNAPSHOT 2025-11-15 10:52:57 +01:00
614 changed files with 6963 additions and 6273 deletions

View File

@ -1,4 +1,4 @@
# https://cwiki.apache.org/confluence/display/INFRA/Git+-+.asf.yaml+features
# https://github.com/apache/infrastructure-asfyaml/blob/main/README.md
github:
description: "Mirror of Apache POI gitbox. The Java API for Microsoft Documents."
@ -34,6 +34,8 @@ github:
protected_branches:
trunk: {}
5.5.x: {}
asf-site: {}
notifications:
commits: commits@poi.apache.org

View File

@ -5,9 +5,9 @@ name: Java CI with Gradle
on:
push:
branches: [ trunk ]
branches: [ trunk, 5.5.x ]
pull_request:
branches: [ trunk ]
branches: [ trunk, 5.5.x ]
permissions: {}
@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5

View File

@ -1,6 +1,4 @@
Apache POI™
======================
# Apache POI™
A Java library for reading and writing Microsoft Office binary and OOXML file formats.
@ -35,32 +33,43 @@ And lower-level, supporting components:
| 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.
Getting started
------------------
# Getting started
Website: https://poi.apache.org/
`Mailing lists`_:
[Mailing lists](https://poi.apache.org/mailinglists.html):
* `Developers`_
* `Users`_
* `General`_ (release announcements)
* [Developers](https://lists.apache.org/list.html?dev@poi.apache.org)
* [Users](https://lists.apache.org/list.html?user@poi.apache.org) Including Announcements
* [General](https://lists.apache.org/list.html?general@poi.apache.org)
Bug tracker:
## Bug trackers
* `Bugzilla`_
* `GitHub pull requests`_
* [Bugzilla](https://bz.apache.org/bugzilla/buglist.cgi?product=POI)
* [GitHub](https://github.com/apache/poi/issues)
Source code:
## Source code
* Official `Apache Git repo`_ at apache.org
* https://github.com/apache/poi
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 git, Java JDK 1.8+, and Apache Ant 1.8+ or Gradle
## Jars
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
@ -80,23 +89,12 @@ Contributing
* Scratchpad (Binary formats): poi-scratchpad/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::
./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 Git repo: https://github.com/apache/poi
.. _How To Build page: http://poi.apache.org/devel/

View File

@ -34,9 +34,16 @@ plugins {
id 'com.dorongold.task-tree' version '4.0.1'
id 'org.nosphere.apache.rat' version '0.8.1'
id 'distribution'
id 'com.github.spotbugs' version '6.1.13' // 6.2.0+ requires JDK 11
id 'de.thetaphi.forbiddenapis' version '3.9'
id 'org.sonarqube' version '4.0.0.2929'
// 6.2.0+ requires JDK 11
// this is the version of the Gradle plugin, it usually includes a
// different version of spotbugs itself
// 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'
}
@ -89,7 +96,7 @@ allprojects {
// apply plugin: 'eclipse'
apply plugin: 'idea'
version = '5.5.0'
version = '6.0.0-SNAPSHOT'
}
/**
@ -107,24 +114,24 @@ subprojects {
apply plugin: 'com.adarshr.test-logger'
ext {
bouncyCastleVersion = '1.82'
commonsCodecVersion = '1.19.0'
bouncyCastleVersion = '1.83'
commonsCodecVersion = '1.21.0'
commonsCompressVersion = '1.28.0'
commonsIoVersion = '2.20.0'
commonsIoVersion = '2.21.0'
commonsMathVersion = '3.6.1'
junitVersion = '5.13.4'
log4jVersion = '2.24.3'
mockitoVersion = '4.11.0'
log4jVersion = '2.25.3'
mockitoVersion = '5.21.0'
hamcrestVersion = '3.0'
xmlbeansVersion = '5.3.0'
batikVersion = '1.19'
graphics2dVersion = '3.0.5'
pdfboxVersion = '3.0.5'
pdfboxVersion = '3.0.6'
saxonVersion = '12.9'
xmlSecVersion = '3.0.6'
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
jdkVendor = (project.properties['jdkVendor'] ?: '') as String
@ -132,7 +139,7 @@ subprojects {
JAVA9_OUT = layout.buildDirectory.dir('classes/java9/main/').get().asFile.absolutePath
TEST9_SRC = 'src/test/java9'
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")
SAXON_TEST = (findProperty("saxon.test") == "true")
@ -205,15 +212,15 @@ subprojects {
doFirst {
options {
if (jdkVersion > 8) addBooleanOption('html5', true)
addBooleanOption('html5', true)
addBooleanOption('Xdoclint:all,-missing', true)
links 'https://poi.apache.org/apidocs/dev/'
if (jdkVersion >= 23) links 'https://docs.oracle.com/en/java/javase/23/docs/api/' else 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://commons.apache.org/proper/commons-compress/apidocs/'
links 'https://www.javadocs.dev/org.apache.commons/commons-compress/1.28.0/'
use = true
splitIndex = true
source = "1.8"
source = "11"
}
}
}
@ -227,14 +234,14 @@ subprojects {
tasks.withType(Jar).configureEach {
duplicatesStrategy = DuplicatesStrategy.FAIL
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
doLast {
// make sure we do not have distribution jar-files with different versions
// 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/${project.archivesBaseName}", erroronmissingdir: false) {
fileset(dir: "../build/dist/maven/${base.archivesName.get()}", erroronmissingdir: false) {
include(name: '*.jar')
exclude(name: "*${version}.jar")
exclude(name: "*${version}-sources.jar")
@ -260,7 +267,7 @@ subprojects {
}
// 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/${project.archivesBaseName}-javadoc", erroronmissingdir: false) {
fileset(dir: "../build/dist/maven/${base.archivesName.get()}-javadoc", erroronmissingdir: false) {
include(name: '*-javadoc.jar')
exclude(name: "*${version}-javadoc.jar")
@ -275,7 +282,7 @@ subprojects {
}
}
ant.delete(failOnError: false, verbose: true) {
fileset(dir: "../build/dist/maven/${project.archivesBaseName}-tests", erroronmissingdir: false) {
fileset(dir: "../build/dist/maven/${base.archivesName.get()}-tests", erroronmissingdir: false) {
include(name: '*-tests.jar')
exclude(name: "*${version}-tests.jar")
@ -290,8 +297,8 @@ subprojects {
}
}
ant.checksum(file: it.archivePath, algorithm: 'SHA-256', fileext: '.sha256', format: 'MD5SUM')
ant.checksum(file: it.archivePath, algorithm: 'SHA-512', fileext: '.sha512', format: 'MD5SUM')
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')
}
}
@ -319,11 +326,11 @@ subprojects {
javadocJar {
// if javadocs and binaries are in the same directory, JPMS complaints about duplicated modules
// in the module-path
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}-javadoc")
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}-javadoc")
}
sourcesJar {
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
exclude 'META-INF/services/**'
}
@ -414,27 +421,25 @@ subprojects {
systemProperties['java.locale.providers'] = 'JRE,CLDR'
doFirst {
if (jdkVersion > 8) {
// some options were removed in JDK 18
if (jdkVersion < 18) {
jvmArgs += [
'--illegal-access=warn',
]
}
// some options were removed in JDK 18
if (jdkVersion < 18) {
jvmArgs += [
// 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
// 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
'--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.logging=ALL-UNNAMED',
'-Dsun.reflect.debugModuleAccessChecks=true',
'-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
'--illegal-access=warn',
]
}
jvmArgs += [
// 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
// 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
'--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.logging=ALL-UNNAMED',
'-Dsun.reflect.debugModuleAccessChecks=true',
'-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
]
}
jacoco {
@ -505,8 +510,8 @@ subprojects {
publishing {
publications {
POI(MavenPublication) {
groupId 'org.apache.poi'
artifactId project.archivesBaseName
groupId = 'org.apache.poi'
artifactId = base.archivesName.get()
from components.java
@ -587,7 +592,7 @@ 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).configureEach {
enabled = false

View File

@ -26,7 +26,7 @@ under the License.
To build the documentation you will need to install forrest and set
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
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>
<property name="version.id" value="5.5.0"/>
<property name="version.id" value="6.0.0-SNAPSHOT"/>
<property name="release.rc" value=""/>
<property environment="env"/>
@ -60,8 +60,8 @@ under the License.
<!-- compiler options -->
<property name="jdk.version.source" value="1.8" 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.source" value="11" description="JDK version of source code"/>
<property name="jdk.version.class" value="11" description="JDK version of generated class files"/>
<property name="compile.debug" value="true"/>
<condition property="isIBMVM">
@ -69,7 +69,7 @@ under the License.
</condition>
<condition property="isJava8" else="false">
<equals arg1="${ant.java.version}" arg2="1.8"/>
<equals arg1="${ant.java.version}" arg2="11"/>
</condition>
<!-- add addOpens parameter for Java 9 and higher -->
@ -268,7 +268,7 @@ under the License.
<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.20.0" 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.24.3" 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.13.4" usage="main-tests"/>
<dependency prefix="main.junit-jengine" artifact="org.junit.jupiter:junit-jupiter-engine:5.13.4" usage="main-tests"/>
@ -284,11 +284,11 @@ under the License.
<dependency prefix="main.jmhAnnotation" artifact="org.openjdk.jmh:jmh-generator-annprocess:1.35" 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.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.17.5" 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.log4j-core" artifact="org.apache.logging.log4j:log4j-core:2.24.3" 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.ant" artifact="org.apache.ant:ant:1.10.15" usage="excelant"/>
@ -296,11 +296,11 @@ under the License.
<!-- xml signature libs - not part of the distribution -->
<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.81" usage="ooxml-provided"/>
<dependency prefix="dsig.bouncycastle-pkix" artifact="org.bouncycastle:bcpkix-jdk18on:1.81" usage="ooxml-provided"/>
<dependency prefix="dsig.bouncycastle-util" artifact="org.bouncycastle:bcutil-jdk18on:1.81" 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.82" 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 -->
<dependency prefix="dsig.bouncycastle-bcpg" artifact="org.bouncycastle:bcpg-jdk18on:1.81" 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"/>
<!-- svg/batik/pdf libs - not part of the distribution - move batik to its own directory because of JPMS module-path issues -->
@ -670,11 +670,7 @@ under the License.
<fileset dir="${basedir}/lib/main-tests">
<include name="byte-buddy-*1.12*.jar"/>
<include name="mockito-core-3*.jar"/>
<include name="mockito-core-4.0*.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="mockito-core-4*.jar"/>
<include name="hamcrest-core*"/>
<include name="junit-4*.jar"/>
<include name="*slf4j*.jar"/>
@ -987,7 +983,7 @@ under the License.
</classpath>
</javac>
<javac release="9"
<javac release="11"
srcdir="${basedir}/poi-ooxml-full/src/main/java9"
destdir="${basedir}/poi-ooxml-full/src/main/java9"
includeantruntime="false"
@ -1087,7 +1083,7 @@ under the License.
<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 -->
<javac release="9"
<javac release="11"
srcdir="${basedir}/@{module}/src/main/java9"
destdir="${basedir}/@{module}/src/main/java9"
includeantruntime="false"
@ -1126,7 +1122,7 @@ under the License.
</jar>
<!-- compile the tests -->
<javac release="8"
<javac release="11"
target="${jdk.version.class}"
source="${jdk.version.source}"
destdir="@{test-classes}"
@ -1148,7 +1144,7 @@ under the License.
<path location="@{test-classes}"/>
</pathconvert>
<javac release="9"
<javac release="11"
srcdir="${basedir}/@{module}/src/test/java9"
destdir="${basedir}/@{module}/src/test/java9"
includeantruntime="false"
@ -1276,7 +1272,7 @@ under the License.
<!-- create ooxml-lite-agent jar -->
<mkdir dir="${ooxml.lite.output.dir}"/>
<javac release="8"
<javac release="11"
srcdir="${basedir}/poi-ooxml-lite-agent/src/main/java"
destdir="${ooxml.lite.output.dir}"
includeantruntime="false"
@ -1287,7 +1283,7 @@ under the License.
</classpath>
</javac>
<javac release="9"
<javac release="11"
srcdir="${basedir}/poi-ooxml-lite-agent/src/main/java9"
destdir="${basedir}/poi-ooxml-lite-agent/src/main/java9"
includeantruntime="false"
@ -1495,7 +1491,7 @@ under the License.
</target>
<target name="compile-integration" depends="compile-scratchpad, compile-main, compile-ooxml, compile-examples">
<javac release="8"
<javac release="11"
target="${jdk.version.class}"
source="${jdk.version.source}"
destdir="${integration.output.test.dir}"
@ -1522,7 +1518,7 @@ under the License.
<mkdir dir="${integration.output.test.dir}/META-INF/versions/9"/>
<javac release="9"
<javac release="11"
srcdir="${basedir}/poi-integration/src/test/java9"
destdir="${integration.output.test.dir}/META-INF/versions/9"
includeantruntime="false"
@ -1896,7 +1892,7 @@ under the License.
<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"
destdir="${basedir}/poi-ooxml-lite/src/main/java9"
includeantruntime="false"
@ -2101,6 +2097,7 @@ under the License.
<!-- Generates the latest/development API documentation. -->
<target name="javadocs"
depends="compile-ooxml"
description="Generates the API documentation">
<echo message="Generating latest Javadocs in ${javadocs.report.dir}"/>
<javadoc verbose="false" author="true" destdir="${javadocs.report.dir}"
@ -2249,7 +2246,7 @@ under the License.
<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"
destdir="@{src}/META-INF/versions/9"
includeantruntime="false"
@ -2576,29 +2573,30 @@ under the License.
<!-- 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 -->
<dependency prefix="spotbugs" artifact="com.github.spotbugs:spotbugs:4.8.6" usage="${spotbugs.lib}" target="spotbugs.jar"/>
<dependency prefix="spotbugs-ant" artifact="com.github.spotbugs:spotbugs-ant:4.8.6" usage="${spotbugs.lib}" target="spotbugs-ant.jar"/>
<dependency prefix="spotbugs-anno" artifact="com.github.spotbugs:spotbugs-annotations:4.8.6" usage="${spotbugs.lib}" target="spotbugs-annotations.jar"/>
<dependency prefix="spotbugs.asm" artifact="org.ow2.asm:asm:9.7" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-analysis" artifact="org.ow2.asm:asm-analysis:9.7" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-commons" artifact="org.ow2.asm:asm-commons:9.7" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-tree" artifact="org.ow2.asm:asm-tree:9.7" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.asm-util" artifact="org.ow2.asm:asm-util:9.7" usage="${spotbugs.lib}"/>
<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.9.8" usage="${spotbugs.lib}" target="spotbugs-ant.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.9" 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.9" 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.9" 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.4" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.dom4j" artifact="org.dom4j:dom4j:2.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.9.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.17" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.commons-lang" artifact="org.apache.commons:commons-lang3:3.14.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-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.14.0" 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.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.log4j-api" artifact="org.apache.logging.log4j:log4j-api:2.24.3" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.log4j-core" artifact="org.apache.logging.log4j:log4j-core:2.24.3" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.log4j-slf4j18-impl" artifact="org.apache.logging.log4j:log4j-slf4j2-impl:2.24.3" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.saxon" artifact="net.sf.saxon:Saxon-HE:12.4" 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.25.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:12.9" usage="${spotbugs.lib}"/>
<dependency prefix="spotbugs.xmlresolver" artifact="org.xmlresolver:xmlresolver:5.2.2" usage="${spotbugs.lib}"/>
<mkdir dir="${basedir}${spotbugs.lib}/config"/>
@ -2613,6 +2611,7 @@ under the License.
<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-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.jcip-annotations.url}" dest="${spotbugs.jcip-annotations.jar}"/>
<downloadfile src="${spotbugs.jsr305.url}" dest="${spotbugs.jsr305.jar}"/>

View File

@ -35,6 +35,20 @@
<programming-language>Java</programming-language>
<category rdf:resource="https://projects.apache.org/category/content" />
<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>

Binary file not shown.

9
gradlew vendored
View File

@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || 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.
MAX_FD=maximum
@ -115,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
@ -214,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.

188
gradlew.bat vendored
View File

@ -1,94 +1,94 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
set CLASSPATH=
@rem Execute Gradle
"%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
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -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
// Apache POI uses on the public Jenkins instance at https://ci-builds.apache.org/job/POI/
//
@ -14,15 +31,17 @@ def xercesUrl = 'https://repo1.maven.org/maven2/xerces/xercesImpl/2.6.1/xercesIm
def xercesLib = './xercesImpl-2.6.1.jar'
def poijobs = [
[ name: 'POI-DSL-1.8', trigger: 'H */12 * * *', jenkinsLite: true
],
[ name: 'POI-DSL-OpenJDK', jdk: 'OpenJDK 1.8', trigger: 'H */12 * * *',
// only a limited set of nodes still have OpenJDK 8 (on Ubuntu) installed
slaves: 'ubuntu',
skipcigame: 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-1.8-branch-5.5.x',
jdk: '1.8',
branch: '5.5.x',
trigger: 'H */12 * * *',
jenkinsLite: true,
// OpenJDK 1.8 is not available on the Apache CI any more
disabled: true
],
[ name: 'POI-DSL-1.11', jdk: '1.11', trigger: triggerSundays, skipcigame: true
],
@ -30,10 +49,6 @@ def poijobs = [
],
[ name: 'POI-DSL-1.21', jdk: '1.21', trigger: 'H */12 * * *', skipcigame: true
],
[ name: 'POI-DSL-1.23', jdk: '1.23', trigger: triggerSundays, skipcigame: true,
// let's save some CPU cycles here, 23 is not an LTS and JDK 24 is out
disabled: true
],
[ name: 'POI-DSL-1.24', jdk: '1.24', trigger: triggerSundays, skipcigame: true,
],
[ name: 'POI-DSL-1.25', jdk: '1.25', trigger: triggerSundays, skipcigame: true, skipSpotbugs: true,
@ -51,17 +66,11 @@ def poijobs = [
// the property triggers using Xerces as XML Parser and previously showed some exception that can occur
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
],
// 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-Gradle', trigger: triggerSundays, email: 'centic@apache.org'
// ],
[ name: 'POI-DSL-no-scratchpad', trigger: triggerSundays, noScratchpad: true
],
[ name: 'POI-DSL-saxon-test', trigger: triggerSundays, saxonTest: true
@ -73,7 +82,12 @@ def poijobs = [
// ],
[ 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',
jenkinsLite: true
@ -82,10 +96,6 @@ def poijobs = [
],
[ name: 'POI-DSL-Windows-1.21', jdk: '1.21', trigger: 'H */12 * * *', windows: true, slaves: 'Windows', skipcigame: true
],
[ name: 'POI-DSL-Windows-1.23', jdk: '1.23', trigger: triggerSundays, windows: true, slaves: 'Windows', skipcigame: true,
// let's save some CPU cycles here, 23 is not an LTS and JDK 24 is out
disabled: 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,
@ -108,10 +118,8 @@ def xmlbeansjobs = [
],
[ name: 'POI-XMLBeans-DSL-1.21', jdk: '1.21', trigger: 'H */12 * * *', skipcigame: true,
],
[ name: 'POI-XMLBeans-DSL-1.23', jdk: '1.23', trigger: triggerSundays, skipcigame: true,
disabled: true
],
[ name: 'POI-XMLBeans-DSL-1.24', jdk: '1.24', trigger: triggerSundays, skipcigame: true,
disabled: true
],
[ name: 'POI-XMLBeans-DSL-1.25', jdk: '1.25', trigger: triggerSundays, skipcigame: true,
],
@ -123,7 +131,8 @@ def xmlbeansjobs = [
def gitBase = 'https://github.com/apache/poi.git'
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 defaultEmail = 'dev@poi.apache.org'
def defaultAnt = 'ant_1.10_latest'
@ -137,11 +146,10 @@ def jdkMapping = [
'1.11': [ jenkinsJdk: 'jdk_11_latest', jdkVersion: 11, jdkVendor: '' ],
'1.17': [ jenkinsJdk: 'jdk_17_latest', jdkVersion: 17, jdkVendor: '' ],
'1.21': [ jenkinsJdk: 'jdk_21_latest', jdkVersion: 21, jdkVendor: '' ],
'1.23': [ jenkinsJdk: 'jdk_23_latest', jdkVersion: 23, jdkVendor: '' ],
'1.24': [ jenkinsJdk: 'jdk_24_latest', jdkVersion: 24, jdkVendor: '' ],
'1.25': [ jenkinsJdk: 'jdk_25_latest', jdkVersion: 25, jdkVendor: '' ],
'OpenJDK 1.8': [ jenkinsJdk: 'adoptopenjdk_hotspot_8u282', jdkVersion: 8, jdkVendor: 'adoptopenjdk' ],
'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) {
@ -244,6 +252,7 @@ poijobs.each { poijob ->
def email = poijob.email ?: defaultEmail
def slaves = poijob.slaves ?: defaultSlaves + (poijob.slaveAdd ?: '')
def antRT = poijob.windows ? defaultAntWindows : defaultAnt
def checkoutBranch = poijob.branch ?: defaultBranch
job('POI/' + poijob.name) {
if (poijob.disabled) {
@ -292,7 +301,7 @@ poijobs.each { poijob ->
remote {
url(gitBase)
}
branch('*/trunk')
branch("*/${checkoutBranch}")
}
}
checkoutRetryCount(3)
@ -602,7 +611,7 @@ Unfortunately we often see builds break because of changes/new machines...''')
}
axes {
jdk(
'jdk_1.8_latest',
'jdk_8_latest',
'jdk_11_latest',
'jdk_17_latest',
'jdk_21_latest',
@ -610,8 +619,7 @@ Unfortunately we often see builds break because of changes/new machines...''')
'jdk_24_latest',
'jdk_25_latest',
'jdk_26_latest',
'adoptopenjdk_hotspot_8u282',
'ibmjdk_1.8.0_261'
'ibm_semeru_21.0.2_13'
)
// 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',

View File

@ -1,5 +1,5 @@
Apache POI
Copyright 2003-2025 The Apache Software Foundation
Copyright 2003-2026 The Apache Software Foundation
This product includes software developed at
The Apache Software Foundation (https://www.apache.org/).

View File

@ -29,7 +29,7 @@ These are required to sign or validate signed Office documents. The OSGi bundles
- 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.81, https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on/1.81
- 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
Required to render to PDF documents.
The required jars can be downloaded from:

View File

@ -24,12 +24,12 @@
<groupId>org.apache.poi</groupId>
<artifactId>poi-bundle</artifactId>
<packaging>bundle</packaging>
<version>5.5.0</version>
<version>6.0.0-SNAPSHOT</version>
<name>Apache POI OSGi bundle</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<poi.version>5.5.0</poi.version>
<poi.version>6.0.0-SNAPSHOT</poi.version>
<pax.exam.version>4.14.0</pax.exam.version>
</properties>
@ -39,8 +39,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
@ -231,7 +231,7 @@
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.24.3</version>
<version>2.25.3</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -53,8 +53,8 @@ tasks.register('compileJava9', JavaCompile) {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceCompatibility = 11
targetCompatibility = 11
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
@ -67,7 +67,7 @@ tasks.register('compileJava9', JavaCompile) {
jar {
dependsOn compileJava9
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
manifest {
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')

View File

@ -21,7 +21,7 @@ package org.apache.poi.examples.crypt;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.security.GeneralSecurityException;
import java.util.Optional;
import java.util.function.Predicate;
@ -72,7 +72,7 @@ public final class OOXMLPasswordsTry {
};
// 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();
System.out.println(found.map(s -> "Password found: " + s).orElse("Error - No password matched"));
}

View File

@ -1,30 +0,0 @@
/* ====================================================================
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.usermodel;
import org.apache.poi.util.Removal;
/**
* Placeholder Class - this is now handled in the Common SS example
* @deprecated in 5.1.0 - use {@link org.apache.poi.examples.ss.AddDimensionedImage}
*/
@Removal(version="6.0.0")
@Deprecated
public class AddDimensionedImage extends org.apache.poi.examples.ss.AddDimensionedImage {
}

View File

@ -22,7 +22,7 @@ package org.apache.poi.examples.ss;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@ -95,7 +95,7 @@ public final class ConditionalFormats {
if (wb instanceof XSSFWorkbook) {
file += "x";
}
try (OutputStream out = Files.newOutputStream(Paths.get(file))) {
try (OutputStream out = Files.newOutputStream(Path.of(file))) {
wb.write(out);
}
System.out.println("Generated: " + file);

View File

@ -23,7 +23,7 @@ import org.apache.poi.util.DefaultTempFileCreationStrategy;
import org.apache.poi.util.TempFile;
import java.io.File;
import java.nio.file.Paths;
import java.nio.file.Path;
public final class TempFileUtils {
private TempFileUtils() {
@ -31,7 +31,7 @@ public final class TempFileUtils {
@SuppressWarnings("java:S106")
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()) {
String[] tempFiles = tempDir.list();
if(tempFiles != null && tempFiles.length > 0) {

View File

@ -1,251 +1,251 @@
/*
* ====================================================================
* 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.xslf.usermodel;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.text.DecimalFormat;
import javax.imageio.ImageIO;
import javax.xml.namespace.QName;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackagePartName;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.sl.usermodel.PictureData.PictureType;
import org.apache.xmlbeans.XmlCursor;
import org.openxmlformats.schemas.drawingml.x2006.main.CTHyperlink;
import org.openxmlformats.schemas.officeDocument.x2006.relationships.STRelationshipId;
import org.openxmlformats.schemas.presentationml.x2006.main.CTApplicationNonVisualDrawingProps;
import org.openxmlformats.schemas.presentationml.x2006.main.CTExtension;
import org.openxmlformats.schemas.presentationml.x2006.main.CTPicture;
import org.openxmlformats.schemas.presentationml.x2006.main.CTSlide;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTLCommonMediaNodeData;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTLCommonTimeNodeData;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTimeNodeList;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeIndefinite;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeFillType;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeRestartType;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeType;
import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.MediaListenerAdapter;
import com.xuggle.mediatool.ToolFactory;
import com.xuggle.mediatool.event.IVideoPictureEvent;
import com.xuggle.xuggler.Global;
import com.xuggle.xuggler.IContainer;
import com.xuggle.xuggler.io.InputOutputStreamHandler;
/**
* Adding multiple videos to a slide
*
* need the Xuggler 5.4 jars:
* &lt;repositories&gt;
* &lt;repository&gt;
* &lt;id&gt;xuggle repo&lt;/id&gt;
* &lt;url&gt;http://xuggle.googlecode.com/svn/trunk/repo/share/java/&lt;/url&gt;
* &lt;/repository&gt;
* &lt;/repositories&gt;
* ...
* &lt;dependency&gt;
* &lt;groupId&gt;xuggle&lt;/groupId&gt;
* &lt;artifactId&gt;xuggle-xuggler&lt;/artifactId&gt;
* &lt;version&gt;5.4&lt;/version&gt;
* &lt;/dependency&gt;
*
* @see <a href="http://stackoverflow.com/questions/15197300/apache-poi-xslf-adding-movie-to-the-slide">Apache POI XSLF Adding movie to the slide</a>
* @see <a href="http://apache-poi.1045710.n5.nabble.com/Question-about-embedded-video-in-PPTX-files-tt5718461.html">Question about embedded video in PPTX files</a>
*/
public class AddVideoToPptx {
static DecimalFormat df_time = new DecimalFormat("0.####");
public static void main(String[] args) throws Exception {
URL video = new URL("http://archive.org/download/test-mpeg/test-mpeg.mpg");
// URL video = new URL("file:test-mpeg.mpg");
XMLSlideShow pptx = new XMLSlideShow();
// add video file
String videoFileName = video.getPath().substring(video.getPath().lastIndexOf('/')+1);
PackagePartName partName = PackagingURIHelper.createPartName("/ppt/media/"+videoFileName);
PackagePart part = pptx.getPackage().createPart(partName, "video/mpeg");
OutputStream partOs = part.getOutputStream();
InputStream fis = video.openStream();
byte buf[] = new byte[1024];
for (int readBytes; (readBytes = fis.read(buf)) != -1; partOs.write(buf, 0, readBytes));
fis.close();
partOs.close();
XSLFSlide slide1 = pptx.createSlide();
XSLFPictureShape pv1 = addPreview(pptx, slide1, part, 5, 50, 50);
addVideo(pptx, slide1, part, pv1, 5);
addTimingInfo(slide1, pv1);
XSLFPictureShape pv2 = addPreview(pptx, slide1, part, 9, 50, 250);
addVideo(pptx, slide1, part, pv2, 9);
addTimingInfo(slide1, pv2);
FileOutputStream fos = new FileOutputStream("pptx-with-video.pptx");
pptx.write(fos);
fos.close();
pptx.close();
}
static XSLFPictureShape addPreview(XMLSlideShow pptx, XSLFSlide slide1, PackagePart videoPart, double seconds, int x, int y) throws IOException {
// get preview after 5 sec.
IContainer ic = IContainer.make();
InputOutputStreamHandler iosh = new InputOutputStreamHandler(videoPart.getInputStream());
if (ic.open(iosh, IContainer.Type.READ, null) < 0) return null;
IMediaReader mediaReader = ToolFactory.makeReader(ic);
// stipulate that we want BufferedImages created in BGR 24bit color space
mediaReader.setBufferedImageTypeToGenerate(BufferedImage.TYPE_3BYTE_BGR);
ImageSnapListener isl = new ImageSnapListener(seconds);
mediaReader.addListener(isl);
// read out the contents of the media file and
// dispatch events to the attached listener
while (!isl.hasFired && mediaReader.readPacket() == null) ;
mediaReader.close();
ic.close();
// add snapshot
BufferedImage image1 = isl.image;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ImageIO.write(image1, "jpeg", bos);
XSLFPictureData snap = pptx.addPicture(bos.toByteArray(), PictureType.JPEG);
XSLFPictureShape pic1 = slide1.createPicture(snap);
pic1.setAnchor(new Rectangle(x, y, image1.getWidth(), image1.getHeight()));
return pic1;
}
static void addVideo(XMLSlideShow pptx, XSLFSlide slide1, PackagePart videoPart, XSLFPictureShape pic1, double seconds) throws IOException {
// add video shape
PackagePartName partName = videoPart.getPartName();
PackageRelationship prsEmbed1 = slide1.getPackagePart().addRelationship(partName, TargetMode.INTERNAL, "http://schemas.microsoft.com/office/2007/relationships/media");
PackageRelationship prsExec1 = slide1.getPackagePart().addRelationship(partName, TargetMode.INTERNAL, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/video");
CTPicture xpic1 = (CTPicture)pic1.getXmlObject();
CTHyperlink link1 = xpic1.getNvPicPr().getCNvPr().addNewHlinkClick();
link1.setId("");
link1.setAction("ppaction://media");
// add video relation
CTApplicationNonVisualDrawingProps nvPr = xpic1.getNvPicPr().getNvPr();
nvPr.addNewVideoFile().setLink(prsExec1.getId());
CTExtension ext = nvPr.addNewExtLst().addNewExt();
// see http://msdn.microsoft.com/en-us/library/dd950140(v=office.12).aspx
ext.setUri("{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}");
String p14Ns = "http://schemas.microsoft.com/office/powerpoint/2010/main";
try (XmlCursor cur = ext.newCursor()) {
cur.toEndToken();
cur.beginElement(new QName(p14Ns, "media", "p14"));
cur.insertNamespace("p14", p14Ns);
cur.insertAttributeWithValue(new QName(STRelationshipId.type.getName().getNamespaceURI(), "embed"), prsEmbed1.getId());
cur.beginElement(new QName(p14Ns, "trim", "p14"));
cur.insertAttributeWithValue("st", df_time.format(seconds*1000.0));
}
}
static void addTimingInfo(XSLFSlide slide1, XSLFPictureShape pic1) {
// add slide timing information, so video can be controlled
CTSlide xslide = slide1.getXmlObject();
CTTimeNodeList ctnl;
if (!xslide.isSetTiming()) {
CTTLCommonTimeNodeData ctn = xslide.addNewTiming().addNewTnLst().addNewPar().addNewCTn();
ctn.setDur(STTLTimeIndefinite.INDEFINITE);
ctn.setRestart(STTLTimeNodeRestartType.NEVER);
ctn.setNodeType(STTLTimeNodeType.TM_ROOT);
ctnl = ctn.addNewChildTnLst();
} else {
ctnl = xslide.getTiming().getTnLst().getParArray(0).getCTn().getChildTnLst();
}
CTTLCommonMediaNodeData cmedia = ctnl.addNewVideo().addNewCMediaNode();
cmedia.setVol(80000);
CTTLCommonTimeNodeData ctn = cmedia.addNewCTn();
ctn.setFill(STTLTimeNodeFillType.HOLD);
ctn.setDisplay(false);
ctn.addNewStCondLst().addNewCond().setDelay(STTLTimeIndefinite.INDEFINITE);
cmedia.addNewTgtEl().addNewSpTgt().setSpid(""+pic1.getShapeId());
}
static class ImageSnapListener extends MediaListenerAdapter {
final double SECONDS_BETWEEN_FRAMES;
final long MICRO_SECONDS_BETWEEN_FRAMES;
boolean hasFired = false;
BufferedImage image = null;
// The video stream index, used to ensure we display frames from one and
// only one video stream from the media container.
int mVideoStreamIndex = -1;
// Time of last frame write
long mLastPtsWrite = Global.NO_PTS;
public ImageSnapListener(double seconds) {
SECONDS_BETWEEN_FRAMES = seconds;
MICRO_SECONDS_BETWEEN_FRAMES =
(long)(Global.DEFAULT_PTS_PER_SECOND * SECONDS_BETWEEN_FRAMES);
}
@Override
public void onVideoPicture(IVideoPictureEvent event) {
if (event.getStreamIndex() != mVideoStreamIndex) {
// if the selected video stream id is not yet set, go ahead an
// select this lucky video stream
if (mVideoStreamIndex != -1) return;
mVideoStreamIndex = event.getStreamIndex();
}
long evtTS = event.getTimeStamp();
// if uninitialized, back date mLastPtsWrite to get the very first frame
if (mLastPtsWrite == Global.NO_PTS)
mLastPtsWrite = Math.max(0, evtTS - MICRO_SECONDS_BETWEEN_FRAMES);
// if its time to write the next frame
if (evtTS - mLastPtsWrite >= MICRO_SECONDS_BETWEEN_FRAMES) {
if (!hasFired) {
image = event.getImage();
hasFired = true;
}
// update last write time
mLastPtsWrite += MICRO_SECONDS_BETWEEN_FRAMES;
}
}
}
}
/*
* ====================================================================
* 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.xslf.usermodel;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URL;
import java.text.DecimalFormat;
import javax.imageio.ImageIO;
import javax.xml.namespace.QName;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.PackagePartName;
import org.apache.poi.openxml4j.opc.PackageRelationship;
import org.apache.poi.openxml4j.opc.PackagingURIHelper;
import org.apache.poi.openxml4j.opc.TargetMode;
import org.apache.poi.sl.usermodel.PictureData.PictureType;
import org.apache.xmlbeans.XmlCursor;
import org.openxmlformats.schemas.drawingml.x2006.main.CTHyperlink;
import org.openxmlformats.schemas.officeDocument.x2006.relationships.STRelationshipId;
import org.openxmlformats.schemas.presentationml.x2006.main.CTApplicationNonVisualDrawingProps;
import org.openxmlformats.schemas.presentationml.x2006.main.CTExtension;
import org.openxmlformats.schemas.presentationml.x2006.main.CTPicture;
import org.openxmlformats.schemas.presentationml.x2006.main.CTSlide;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTLCommonMediaNodeData;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTLCommonTimeNodeData;
import org.openxmlformats.schemas.presentationml.x2006.main.CTTimeNodeList;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeIndefinite;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeFillType;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeRestartType;
import org.openxmlformats.schemas.presentationml.x2006.main.STTLTimeNodeType;
import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.MediaListenerAdapter;
import com.xuggle.mediatool.ToolFactory;
import com.xuggle.mediatool.event.IVideoPictureEvent;
import com.xuggle.xuggler.Global;
import com.xuggle.xuggler.IContainer;
import com.xuggle.xuggler.io.InputOutputStreamHandler;
/**
* Adding multiple videos to a slide
*
* need the Xuggler 5.4 jars:
* &lt;repositories&gt;
* &lt;repository&gt;
* &lt;id&gt;xuggle repo&lt;/id&gt;
* &lt;url&gt;http://xuggle.googlecode.com/svn/trunk/repo/share/java/&lt;/url&gt;
* &lt;/repository&gt;
* &lt;/repositories&gt;
* ...
* &lt;dependency&gt;
* &lt;groupId&gt;xuggle&lt;/groupId&gt;
* &lt;artifactId&gt;xuggle-xuggler&lt;/artifactId&gt;
* &lt;version&gt;5.4&lt;/version&gt;
* &lt;/dependency&gt;
*
* @see <a href="http://stackoverflow.com/questions/15197300/apache-poi-xslf-adding-movie-to-the-slide">Apache POI XSLF Adding movie to the slide</a>
* @see <a href="http://apache-poi.1045710.n5.nabble.com/Question-about-embedded-video-in-PPTX-files-tt5718461.html">Question about embedded video in PPTX files</a>
*/
public class AddVideoToPptx {
static DecimalFormat df_time = new DecimalFormat("0.####");
public static void main(String[] args) throws Exception {
URL video = new URL("http://archive.org/download/test-mpeg/test-mpeg.mpg");
// URL video = new URL("file:test-mpeg.mpg");
XMLSlideShow pptx = new XMLSlideShow();
// add video file
String videoFileName = video.getPath().substring(video.getPath().lastIndexOf('/')+1);
PackagePartName partName = PackagingURIHelper.createPartName("/ppt/media/"+videoFileName);
PackagePart part = pptx.getPackage().createPart(partName, "video/mpeg");
OutputStream partOs = part.getOutputStream();
InputStream fis = video.openStream();
byte buf[] = new byte[1024];
for (int readBytes; (readBytes = fis.read(buf)) != -1; partOs.write(buf, 0, readBytes));
fis.close();
partOs.close();
XSLFSlide slide1 = pptx.createSlide();
XSLFPictureShape pv1 = addPreview(pptx, slide1, part, 5, 50, 50);
addVideo(pptx, slide1, part, pv1, 5);
addTimingInfo(slide1, pv1);
XSLFPictureShape pv2 = addPreview(pptx, slide1, part, 9, 50, 250);
addVideo(pptx, slide1, part, pv2, 9);
addTimingInfo(slide1, pv2);
FileOutputStream fos = new FileOutputStream("pptx-with-video.pptx");
pptx.write(fos);
fos.close();
pptx.close();
}
static XSLFPictureShape addPreview(XMLSlideShow pptx, XSLFSlide slide1, PackagePart videoPart, double seconds, int x, int y) throws IOException {
// get preview after 5 sec.
IContainer ic = IContainer.make();
InputOutputStreamHandler iosh = new InputOutputStreamHandler(videoPart.getInputStream());
if (ic.open(iosh, IContainer.Type.READ, null) < 0) return null;
IMediaReader mediaReader = ToolFactory.makeReader(ic);
// stipulate that we want BufferedImages created in BGR 24bit color space
mediaReader.setBufferedImageTypeToGenerate(BufferedImage.TYPE_3BYTE_BGR);
ImageSnapListener isl = new ImageSnapListener(seconds);
mediaReader.addListener(isl);
// read out the contents of the media file and
// dispatch events to the attached listener
while (!isl.hasFired && mediaReader.readPacket() == null) ;
mediaReader.close();
ic.close();
// add snapshot
BufferedImage image1 = isl.image;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ImageIO.write(image1, "jpeg", bos);
XSLFPictureData snap = pptx.addPicture(bos.toByteArray(), PictureType.JPEG);
XSLFPictureShape pic1 = slide1.createPicture(snap);
pic1.setAnchor(new Rectangle(x, y, image1.getWidth(), image1.getHeight()));
return pic1;
}
static void addVideo(XMLSlideShow pptx, XSLFSlide slide1, PackagePart videoPart, XSLFPictureShape pic1, double seconds) throws IOException {
// add video shape
PackagePartName partName = videoPart.getPartName();
PackageRelationship prsEmbed1 = slide1.getPackagePart().addRelationship(partName, TargetMode.INTERNAL, "http://schemas.microsoft.com/office/2007/relationships/media");
PackageRelationship prsExec1 = slide1.getPackagePart().addRelationship(partName, TargetMode.INTERNAL, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/video");
CTPicture xpic1 = (CTPicture)pic1.getXmlObject();
CTHyperlink link1 = xpic1.getNvPicPr().getCNvPr().addNewHlinkClick();
link1.setId("");
link1.setAction("ppaction://media");
// add video relation
CTApplicationNonVisualDrawingProps nvPr = xpic1.getNvPicPr().getNvPr();
nvPr.addNewVideoFile().setLink(prsExec1.getId());
CTExtension ext = nvPr.addNewExtLst().addNewExt();
// see http://msdn.microsoft.com/en-us/library/dd950140(v=office.12).aspx
ext.setUri("{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}");
String p14Ns = "http://schemas.microsoft.com/office/powerpoint/2010/main";
try (XmlCursor cur = ext.newCursor()) {
cur.toEndToken();
cur.beginElement(new QName(p14Ns, "media", "p14"));
cur.insertNamespace("p14", p14Ns);
cur.insertAttributeWithValue(new QName(STRelationshipId.type.getName().getNamespaceURI(), "embed"), prsEmbed1.getId());
cur.beginElement(new QName(p14Ns, "trim", "p14"));
cur.insertAttributeWithValue("st", df_time.format(seconds*1000.0));
}
}
static void addTimingInfo(XSLFSlide slide1, XSLFPictureShape pic1) {
// add slide timing information, so video can be controlled
CTSlide xslide = slide1.getXmlObject();
CTTimeNodeList ctnl;
if (!xslide.isSetTiming()) {
CTTLCommonTimeNodeData ctn = xslide.addNewTiming().addNewTnLst().addNewPar().addNewCTn();
ctn.setDur(STTLTimeIndefinite.INDEFINITE);
ctn.setRestart(STTLTimeNodeRestartType.NEVER);
ctn.setNodeType(STTLTimeNodeType.TM_ROOT);
ctnl = ctn.addNewChildTnLst();
} else {
ctnl = xslide.getTiming().getTnLst().getParArray(0).getCTn().getChildTnLst();
}
CTTLCommonMediaNodeData cmedia = ctnl.addNewVideo().addNewCMediaNode();
cmedia.setVol(80000);
CTTLCommonTimeNodeData ctn = cmedia.addNewCTn();
ctn.setFill(STTLTimeNodeFillType.HOLD);
ctn.setDisplay(false);
ctn.addNewStCondLst().addNewCond().setDelay(STTLTimeIndefinite.INDEFINITE);
cmedia.addNewTgtEl().addNewSpTgt().setSpid(""+pic1.getShapeId());
}
static class ImageSnapListener extends MediaListenerAdapter {
final double SECONDS_BETWEEN_FRAMES;
final long MICRO_SECONDS_BETWEEN_FRAMES;
boolean hasFired = false;
BufferedImage image = null;
// The video stream index, used to ensure we display frames from one and
// only one video stream from the media container.
int mVideoStreamIndex = -1;
// Time of last frame write
long mLastPtsWrite = Global.NO_PTS;
public ImageSnapListener(double seconds) {
SECONDS_BETWEEN_FRAMES = seconds;
MICRO_SECONDS_BETWEEN_FRAMES =
(long)(Global.DEFAULT_PTS_PER_SECOND * SECONDS_BETWEEN_FRAMES);
}
@Override
public void onVideoPicture(IVideoPictureEvent event) {
if (event.getStreamIndex() != mVideoStreamIndex) {
// if the selected video stream id is not yet set, go ahead an
// select this lucky video stream
if (mVideoStreamIndex != -1) return;
mVideoStreamIndex = event.getStreamIndex();
}
long evtTS = event.getTimeStamp();
// if uninitialized, back date mLastPtsWrite to get the very first frame
if (mLastPtsWrite == Global.NO_PTS)
mLastPtsWrite = Math.max(0, evtTS - MICRO_SECONDS_BETWEEN_FRAMES);
// if its time to write the next frame
if (evtTS - mLastPtsWrite >= MICRO_SECONDS_BETWEEN_FRAMES) {
if (!hasFired) {
image = event.getImage();
hasFired = true;
}
// update last write time
mLastPtsWrite += MICRO_SECONDS_BETWEEN_FRAMES;
}
}
}
}

View File

@ -25,7 +25,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
@ -64,7 +64,7 @@ public final class BarChartDemo {
}
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 seriesText = modelReader.readLine();

View File

@ -26,7 +26,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
@ -72,7 +72,7 @@ public final class ChartFromScratch {
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 seriesText = modelReader.readLine();

View File

@ -41,7 +41,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
@ -64,7 +64,7 @@ public final class DoughnutChartFromScratch {
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 seriesText = modelReader.readLine();

View File

@ -25,7 +25,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
@ -61,7 +61,7 @@ public final class PieChartDemo {
}
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
try (XMLSlideShow pptx = new XMLSlideShow(argIS)) {

View File

@ -1,12 +1,12 @@
10 languages with most speakers as first language
countries,speakers,language
58,315,العربية
4,243,বাংলা
38,1299,中文
118,378,English
4,260,हिन्दी
2,128,日本語
15,223,português
6,119,ਪੰਜਾਬੀ
18,154,Русский язык
31,442,español
10 languages with most speakers as first language
countries,speakers,language
58,315,العربية
4,243,বাংলা
38,1299,中文
118,378,English
4,260,हिन्दी
2,128,日本語
15,223,português
6,119,ਪੰਜਾਬੀ
18,154,Русский язык
31,442,español

View File

@ -1,4 +1,4 @@
My Chart
First 1.0
Second 3.0
My Chart
First 1.0
Second 3.0
Third 4.0

View File

@ -26,7 +26,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
@ -63,7 +63,7 @@ public final class BarChartExample {
}
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 seriesText = modelReader.readLine();

View File

@ -24,7 +24,7 @@ import java.io.FileOutputStream;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
@ -67,7 +67,7 @@ public final class ChartFromScratch {
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 seriesText = modelReader.readLine();

View File

@ -1,12 +1,12 @@
10 languages with most speakers as first language
countries,speakers,language
58,315,العربية
4,243,বাংলা
38,1299,中文
118,378,English
4,260,हिन्दी
2,128,日本語
15,223,português
6,119,ਪੰਜਾਬੀ
18,154,Русский язык
31,442,español
10 languages with most speakers as first language
countries,speakers,language
58,315,العربية
4,243,বাংলা
38,1299,中文
118,378,English
4,260,हिन्दी
2,128,日本語
15,223,português
6,119,ਪੰਜਾਬੀ
18,154,Русский язык
31,442,español

View File

@ -63,8 +63,8 @@ tasks.register('compileJava9', JavaCompile) {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceCompatibility = 11
targetCompatibility = 11
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
@ -80,8 +80,8 @@ tasks.register('compileTest9', JavaCompile) {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceCompatibility = 11
targetCompatibility = 11
destinationDirectory = file(TEST9_OUT + VERSIONS9)
source = file(TEST9_SRC)
options.compilerArgs = [
@ -95,7 +95,7 @@ tasks.register('compileTest9', JavaCompile) {
jar {
dependsOn compileJava9
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
manifest {
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
@ -119,7 +119,7 @@ sourcesJar {
// Create a separate jar for test-code to depend on it in other projects
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
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'
// ignore second module-info.class from main
@ -142,13 +142,9 @@ test {
doFirst {
jvmArgs += [
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-excelant-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
]
if (jdkVersion > 8) {
jvmArgs += [
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-excelant-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
]
}
}
}

View File

@ -96,8 +96,8 @@ tasks.register('compileTest9', JavaCompile) {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceCompatibility = 11
targetCompatibility = 11
destinationDirectory = file(TEST9_OUT + VERSIONS9)
source = file(TEST9_SRC)
options.compilerArgs = [
@ -109,7 +109,7 @@ tasks.register('compileTest9', JavaCompile) {
jar {
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
manifest {
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
@ -119,7 +119,7 @@ jar {
// Create a separate jar for test-code to depend on it in other projects
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
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'
// ignore second module-info.class from main
@ -143,29 +143,26 @@ test {
dependsOn { testJar }
systemProperties['junit.jupiter.execution.parallel.enabled'] = 'true'
if (jdkVersion == 8) {
systemProperties['sun.java2d.renderer'] = 'sun.java2d.marlin.MarlinRenderingEngine'
}
doFirst {
jvmArgs += [
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-integration-tests' + File.pathSeparator + files(MODULE_RUNTIME_PATH).asPath,
]
if (jdkVersion > 8) {
jvmArgs += [
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-integration-tests' + File.pathSeparator + files(MODULE_RUNTIME_PATH).asPath,
]
}
if (NO_SCRATCHPAD) {
systemProperty 'scratchpad.ignore', 'true'
}
}
}
javadoc { enabled(false) }
javadoc {
enabled = false
}
sourcesJar { enabled(false) }
sourcesJar {
enabled = false
}
generateMetadataFileForPOIPublication.enabled = false
publishPOIPublicationToMavenLocal.enabled = false

View File

@ -94,9 +94,9 @@ Before running this, you should execute the "jar" target in the main build.gradl
<sort>
<resources>
<fileset dir="${dist}">
<include name="**/poi-5.*.jar"/>
<include name="**/poi-ooxml-5.*.jar"/>
<include name="**/poi-ooxml-lite-5.*.jar"/>
<include name="**/poi-6.*.jar"/>
<include name="**/poi-ooxml-6.*.jar"/>
<include name="**/poi-ooxml-lite-6.*.jar"/>
<exclude name="**/*-javadoc*"/>
<exclude name="**/*-sources*"/>
</fileset>
@ -126,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"/>
<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"
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">
@ -137,10 +137,10 @@ Before running this, you should execute the "jar" target in the main build.gradl
<sort>
<resources>
<fileset dir="${dist}">
<include name="**/poi-5.*.jar"/>
<include name="**/poi-ooxml-5.*.jar"/>
<include name="**/poi-ooxml-lite-5.*.jar"/>
<include name="**/poi-scratchpad-5.*.jar"/>
<include name="**/poi-6.*.jar"/>
<include name="**/poi-ooxml-6.*.jar"/>
<include name="**/poi-ooxml-lite-6.*.jar"/>
<include name="**/poi-scratchpad-6.*.jar"/>
<exclude name="**/*-javadoc*"/>
<exclude name="**/*-sources*"/>
</fileset>
@ -150,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"/>
<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"
classpath="${jarpackagescratchpad}" classpathref="libs">
</javac>

View File

@ -29,6 +29,8 @@ public enum FileHandlerKnown {
HSLF,
HSMF,
HSSF,
HEMF,
HWMF,
HWPF,
OPC,
POIFS,

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -29,6 +29,7 @@ import java.lang.ref.WeakReference;
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
import org.apache.poi.sl.draw.Drawable;
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.PictureData;
import org.apache.poi.sl.usermodel.Shape;
@ -76,8 +77,11 @@ public abstract class SlideShowHandler extends POIFSFileHandler {
}
}
for (Shape<?,?> shape : s.getMasterSheet()) {
readShapes(shape);
MasterSheet<?, ?> masterSheet = s.getMasterSheet();
if (masterSheet != null) {
for (Shape<?,?> shape : masterSheet) {
readShapes(shape);
}
}
}
}

View File

@ -37,6 +37,8 @@ public abstract class SpreadsheetHandler extends AbstractFileHandler {
// try to access some of the content
readContent(wb);
extractEmbedded(wb);
// write out the file
writeToArray(wb);

View File

@ -144,8 +144,14 @@ public class TestAllFiles {
"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"
});
"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(
"document/truncated62886.docx",

View File

@ -78,7 +78,7 @@ public class XSSFBFileHandler extends AbstractFileHandler {
XSSFBEventBasedExcelExtractor ex = new XSSFBEventBasedExcelExtractor(pkg);
String txt = ex.getText();
if (txt.length() < 1) {
throw new RuntimeException("Should have gotten some text.");
throw new IllegalArgumentException("Should have gotten some text.");
}
}

View File

@ -60,8 +60,8 @@ tasks.register('compileJava9', JavaCompile) {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceCompatibility = 11
targetCompatibility = 11
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()

View File

@ -1,39 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:e="http://schemas.microsoft.com/office/2006/encryption" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/encryption" schemaLocation="encryptionInfo.xsd"/>
<xs:simpleType name="ST_PasswordKeyEncryptorUri">
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_CertificateKeyEncryptor">
<xs:attribute name="encryptedKeyValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted form of the intermediate key, which is encrypted with the public key contained within the X509Certificate attribute.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="X509Certificate" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies a DER-encoded X.509 certificate (1) used to encrypt the intermediate key. The certificate (1) MUST contain only the public portion of the public-private key pair.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="certVerifier" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the HMAC of the binary data obtained by base64-decoding the X509Certificate attribute. The hashing algorithm used to derive the HMAC MUST be the hashing algorithm specified for the Encryption.keyData element. The secret key used to derive the HMAC MUST be the intermediate key. If the intermediate key is reset, any CertificateKeyEncryptor elements are also reset to contain the new intermediate key, except that the certVerifier attribute MUST match the value calculated using the current intermediate key, to verify that the CertificateKeyEncryptor element actually encrypted the current intermediate key. If a CertificateKeyEncryptor element does not have a correct certVerifier attribute, it MUST be discarded.</xs:documentation></xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="encryptedKey" type="CT_CertificateKeyEncryptor"/>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:e="http://schemas.microsoft.com/office/2006/encryption" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/encryption" schemaLocation="encryptionInfo.xsd"/>
<xs:simpleType name="ST_PasswordKeyEncryptorUri">
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_CertificateKeyEncryptor">
<xs:attribute name="encryptedKeyValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted form of the intermediate key, which is encrypted with the public key contained within the X509Certificate attribute.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="X509Certificate" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies a DER-encoded X.509 certificate (1) used to encrypt the intermediate key. The certificate (1) MUST contain only the public portion of the public-private key pair.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="certVerifier" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the HMAC of the binary data obtained by base64-decoding the X509Certificate attribute. The hashing algorithm used to derive the HMAC MUST be the hashing algorithm specified for the Encryption.keyData element. The secret key used to derive the HMAC MUST be the intermediate key. If the intermediate key is reset, any CertificateKeyEncryptor elements are also reset to contain the new intermediate key, except that the certVerifier attribute MUST match the value calculated using the current intermediate key, to verify that the CertificateKeyEncryptor element actually encrypted the current intermediate key. If a CertificateKeyEncryptor element does not have a correct certVerifier attribute, it MUST be discarded.</xs:documentation></xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="encryptedKey" type="CT_CertificateKeyEncryptor"/>
</xs:schema>

View File

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate">
<xb:qname name="c:encryptedKey" javaname="EncryptedCertificateKey"/>
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate">
<xb:qname name="c:encryptedKey" javaname="EncryptedCertificateKey"/>
</xb:config>

View File

@ -1,259 +1,259 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/encryption" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/encryption" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/keyEncryptor/password" schemaLocation="encryptionPassword.xsd"/>
<xs:import namespace="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" schemaLocation="encryptionCertificate.xsd"/>
<xs:simpleType name="ST_SaltSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used by a salt. It MUST be at least 1 and no greater than 65,536.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="65536"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_BlockSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used to encrypt one block of data. It MUST be at least 2, no greater than 4096, and a multiple of 2.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="2"/>
<xs:maxInclusive value="4096"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_KeyBits">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bits used by an encryption algorithm. It MUST be at least 8 and a multiple of 8.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="8"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_HashSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used by a hash value. It MUST be at least 1, no greater than 65,536, and the same number of bytes as the hash algorithm emits.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="65536"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_SpinCount">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of times to iterate on a hash of a password. It MUST NOT be greater than 10,000,000.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="10000000"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_CipherAlgorithm">
<xs:annotation>
<xs:appinfo>modified for poi - list is restricted to given list in [ms-offcrypto]</xs:appinfo>
<xs:documentation>A string that specifies the cipher algorithm. Values that are not defined MAY be used, and a compliant implementation is not required to support all defined values. Any algorithm that can be resolved by name by the underlying operating system can be used for hashing or encryption. Only block algorithms are supported for encryption. AES-128 is the default encryption algorithm, and SHA-1 is the default hashing algorithm if no other algorithms have been configured.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="AES">
<xs:annotation>
<xs:documentation>MUST conform to the AES algorithm.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RC2">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC2268] (http://tools.ietf.org/html/rfc2268). The use of RC2 is not recommended. If RC2 is used with a key length of less than 128 bits, documents could interoperate incorrectly across different versions of Windows.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RC4">
<xs:annotation>
<xs:documentation>MUST NOT be used.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="DES">
<xs:annotation>
<xs:documentation>MUST conform to the DES algorithm. The use of DES is not recommended. If DES is used, the key length specified in the KeyBits element is required to be set to 64 for 56-bit encryption, and the key decrypted from encryptedKeyValue of KeyEncryptor is required to include the DES parity bits.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="DESX">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [DRAFT-DESX] (http://tools.ietf.org/html/draft-ietf-ipsec-ciph-desx-00). The use of DESX is not recommended. If DESX is used, documents could interoperate incorrectly across different versions of Windows.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="3DES">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1851] (http://tools.ietf.org/html/rfc1851). If 3DES or 3DES_112 is used, the key length specified in the KeyBits element is required to be set to 192 for 168-bit encryption and 128 for 112-bit encryption, and the key decrypted from encryptedKeyValue of KeyEncryptor is required to include the DES parity bits.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="3DES_112">
<xs:annotation>
<xs:documentation>see 3DES</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_CipherChaining">
<xs:annotation>
<xs:documentation>A string that specifies the chaining mode used by CipherAlgorithm. For more details about chaining modes, see [BCMO800-38A] (http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="ChainingModeCBC">
<xs:annotation>
<xs:documentation>block chaining (CBC)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="ChainingModeCFB">
<xs:annotation>
<xs:documentation>Cipher feedback chaining (CFB), with an 8-bit window</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_HashAlgorithm">
<xs:annotation>
<xs:appinfo>modified for poi - list is restricted to given list in [ms-offcrypto]</xs:appinfo>
<xs:documentation>A string specifying a hashing algorithm. Values that are not defined MAY be used, and a compliant implementation is not required to support all defined values.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="SHA1">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC4634] (http://tools.ietf.org/html/rfc4634).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA256">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA384">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA512">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD5">
<xs:annotation>
<xs:documentation>MUST conform to MD5.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD4">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1320] (http://tools.ietf.org/html/rfc1320).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD2">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1319] (http://tools.ietf.org/html/rfc1319).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RIPEMD-128">
<xs:annotation>
<xs:documentation>MUST conform to the hash functions specified in [ISO/IEC 10118]. (https://en.wikipedia.org/wiki/RIPEMD)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RIPEMD-160">
<xs:annotation>
<xs:documentation>see RIPEMD-128 (https://en.wikipedia.org/wiki/RIPEMD)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="WHIRLPOOL">
<xs:annotation>
<xs:documentation>see RIPEMD-128 (https://en.wikipedia.org/wiki/ISO/IEC_10118-3)</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_KeyData">
<xs:annotation>
<xs:documentation>A complex type that specifies the encryption used within this element. The saltValue attribute is a base64-encoded binary value that is randomly generated. The number of bytes required to decode the saltValue attribute MUST be equal to the value of the saltSize attribute.</xs:documentation>
</xs:annotation>
<xs:attribute name="saltSize" type="ST_SaltSize" use="required"/>
<xs:attribute name="blockSize" type="ST_BlockSize" use="required"/>
<xs:attribute name="keyBits" type="ST_KeyBits" use="required"/>
<xs:attribute name="hashSize" type="ST_HashSize" use="required"/>
<xs:attribute name="cipherAlgorithm" type="ST_CipherAlgorithm" use="required"/>
<xs:attribute name="cipherChaining" type="ST_CipherChaining" use="required"/>
<xs:attribute name="hashAlgorithm" type="ST_HashAlgorithm" use="required"/>
<xs:attribute name="saltValue" type="xs:base64Binary" use="required"/>
</xs:complexType>
<xs:complexType name="CT_DataIntegrity">
<xs:annotation>
<xs:documentation>A complex type that specifies data used to verify whether the encrypted data passes an integrity check. It MUST be generated using the method specified in section 2.3.4.14 (http://msdn.microsoft.com/en-us/library/dd924068(v=office.12).aspx).</xs:documentation>
</xs:annotation>
<xs:attribute name="encryptedHmacKey" type="xs:base64Binary" use="required">
<xs:annotation>
<xs:documentation>A base64-encoded value that specifies an encrypted key used in calculating the encryptedHmacValue.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedHmacValue" type="xs:base64Binary" use="required">
<xs:annotation>
<xs:documentation>A base64-encoded value that specifies an HMAC derived from encryptedHmacKey and the encrypted data.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="CT_KeyEncryptor">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
<xs:documentation>A complex type that specifies the parameters used to encrypt an intermediate key, which is used to perform the final encryption of the document. To ensure extensibility, arbitrary elements can be defined to encrypt the intermediate key. The intermediate key MUST be the same for all KeyEncryptor elements.</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element ref="p:encryptedKey"/>
<xs:element ref="c:encryptedKey"/>
</xs:choice>
<xs:attribute name="uri">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/password"/>
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="CT_KeyEncryptors">
<xs:annotation>
<xs:documentation>A sequence of KeyEncryptor elements. Exactly one KeyEncryptors element MUST be present, and the KeyEncryptors element MUST contain at least one KeyEncryptor.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="keyEncryptor" type="CT_KeyEncryptor" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CT_Encryption">
<xs:sequence>
<xs:element name="keyData" type="CT_KeyData"/>
<xs:element name="dataIntegrity" type="CT_DataIntegrity">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
<xs:documentation>All ECMA-376 documents [ECMA-376] encrypted by Microsoft Office using agile encryption will have a DataIntegrity element present. The schema allows for a DataIntegrity element to not be present because the encryption schema can be used by applications that do not create ECMA-376 documents [ECMA-376].</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="keyEncryptors" type="CT_KeyEncryptors">
<xs:annotation>
<xs:documentation>The KeyEncryptor element, which MUST be used when encrypting password-protected agile encryption documents, is either a PasswordKeyEncryptor or a CertificateKeyEncryptor. Exactly one PasswordKeyEncryptor MUST be present. Zero or more CertificateKeyEncryptor elements are contained within the KeyEncryptors element.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="encryption" type="CT_Encryption"/>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/encryption" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/encryption" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/keyEncryptor/password" schemaLocation="encryptionPassword.xsd"/>
<xs:import namespace="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" schemaLocation="encryptionCertificate.xsd"/>
<xs:simpleType name="ST_SaltSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used by a salt. It MUST be at least 1 and no greater than 65,536.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="65536"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_BlockSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used to encrypt one block of data. It MUST be at least 2, no greater than 4096, and a multiple of 2.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="2"/>
<xs:maxInclusive value="4096"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_KeyBits">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bits used by an encryption algorithm. It MUST be at least 8 and a multiple of 8.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="8"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_HashSize">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of bytes used by a hash value. It MUST be at least 1, no greater than 65,536, and the same number of bytes as the hash algorithm emits.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="65536"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_SpinCount">
<xs:annotation>
<xs:documentation>An unsigned integer that specifies the number of times to iterate on a hash of a password. It MUST NOT be greater than 10,000,000.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="10000000"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_CipherAlgorithm">
<xs:annotation>
<xs:appinfo>modified for poi - list is restricted to given list in [ms-offcrypto]</xs:appinfo>
<xs:documentation>A string that specifies the cipher algorithm. Values that are not defined MAY be used, and a compliant implementation is not required to support all defined values. Any algorithm that can be resolved by name by the underlying operating system can be used for hashing or encryption. Only block algorithms are supported for encryption. AES-128 is the default encryption algorithm, and SHA-1 is the default hashing algorithm if no other algorithms have been configured.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="AES">
<xs:annotation>
<xs:documentation>MUST conform to the AES algorithm.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RC2">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC2268] (http://tools.ietf.org/html/rfc2268). The use of RC2 is not recommended. If RC2 is used with a key length of less than 128 bits, documents could interoperate incorrectly across different versions of Windows.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RC4">
<xs:annotation>
<xs:documentation>MUST NOT be used.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="DES">
<xs:annotation>
<xs:documentation>MUST conform to the DES algorithm. The use of DES is not recommended. If DES is used, the key length specified in the KeyBits element is required to be set to 64 for 56-bit encryption, and the key decrypted from encryptedKeyValue of KeyEncryptor is required to include the DES parity bits.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="DESX">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [DRAFT-DESX] (http://tools.ietf.org/html/draft-ietf-ipsec-ciph-desx-00). The use of DESX is not recommended. If DESX is used, documents could interoperate incorrectly across different versions of Windows.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="3DES">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1851] (http://tools.ietf.org/html/rfc1851). If 3DES or 3DES_112 is used, the key length specified in the KeyBits element is required to be set to 192 for 168-bit encryption and 128 for 112-bit encryption, and the key decrypted from encryptedKeyValue of KeyEncryptor is required to include the DES parity bits.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="3DES_112">
<xs:annotation>
<xs:documentation>see 3DES</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_CipherChaining">
<xs:annotation>
<xs:documentation>A string that specifies the chaining mode used by CipherAlgorithm. For more details about chaining modes, see [BCMO800-38A] (http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf).</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="ChainingModeCBC">
<xs:annotation>
<xs:documentation>block chaining (CBC)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="ChainingModeCFB">
<xs:annotation>
<xs:documentation>Cipher feedback chaining (CFB), with an 8-bit window</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ST_HashAlgorithm">
<xs:annotation>
<xs:appinfo>modified for poi - list is restricted to given list in [ms-offcrypto]</xs:appinfo>
<xs:documentation>A string specifying a hashing algorithm. Values that are not defined MAY be used, and a compliant implementation is not required to support all defined values.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:token">
<xs:enumeration value="SHA1">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC4634] (http://tools.ietf.org/html/rfc4634).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA256">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA384">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="SHA512">
<xs:annotation>
<xs:documentation>see SHA1</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD5">
<xs:annotation>
<xs:documentation>MUST conform to MD5.</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD4">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1320] (http://tools.ietf.org/html/rfc1320).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="MD2">
<xs:annotation>
<xs:documentation>MUST conform to the algorithm as specified in [RFC1319] (http://tools.ietf.org/html/rfc1319).</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RIPEMD-128">
<xs:annotation>
<xs:documentation>MUST conform to the hash functions specified in [ISO/IEC 10118]. (https://en.wikipedia.org/wiki/RIPEMD)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="RIPEMD-160">
<xs:annotation>
<xs:documentation>see RIPEMD-128 (https://en.wikipedia.org/wiki/RIPEMD)</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="WHIRLPOOL">
<xs:annotation>
<xs:documentation>see RIPEMD-128 (https://en.wikipedia.org/wiki/ISO/IEC_10118-3)</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_KeyData">
<xs:annotation>
<xs:documentation>A complex type that specifies the encryption used within this element. The saltValue attribute is a base64-encoded binary value that is randomly generated. The number of bytes required to decode the saltValue attribute MUST be equal to the value of the saltSize attribute.</xs:documentation>
</xs:annotation>
<xs:attribute name="saltSize" type="ST_SaltSize" use="required"/>
<xs:attribute name="blockSize" type="ST_BlockSize" use="required"/>
<xs:attribute name="keyBits" type="ST_KeyBits" use="required"/>
<xs:attribute name="hashSize" type="ST_HashSize" use="required"/>
<xs:attribute name="cipherAlgorithm" type="ST_CipherAlgorithm" use="required"/>
<xs:attribute name="cipherChaining" type="ST_CipherChaining" use="required"/>
<xs:attribute name="hashAlgorithm" type="ST_HashAlgorithm" use="required"/>
<xs:attribute name="saltValue" type="xs:base64Binary" use="required"/>
</xs:complexType>
<xs:complexType name="CT_DataIntegrity">
<xs:annotation>
<xs:documentation>A complex type that specifies data used to verify whether the encrypted data passes an integrity check. It MUST be generated using the method specified in section 2.3.4.14 (http://msdn.microsoft.com/en-us/library/dd924068(v=office.12).aspx).</xs:documentation>
</xs:annotation>
<xs:attribute name="encryptedHmacKey" type="xs:base64Binary" use="required">
<xs:annotation>
<xs:documentation>A base64-encoded value that specifies an encrypted key used in calculating the encryptedHmacValue.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedHmacValue" type="xs:base64Binary" use="required">
<xs:annotation>
<xs:documentation>A base64-encoded value that specifies an HMAC derived from encryptedHmacKey and the encrypted data.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="CT_KeyEncryptor">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
<xs:documentation>A complex type that specifies the parameters used to encrypt an intermediate key, which is used to perform the final encryption of the document. To ensure extensibility, arbitrary elements can be defined to encrypt the intermediate key. The intermediate key MUST be the same for all KeyEncryptor elements.</xs:documentation>
</xs:annotation>
<xs:choice>
<xs:element ref="p:encryptedKey"/>
<xs:element ref="c:encryptedKey"/>
</xs:choice>
<xs:attribute name="uri">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/password"/>
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="CT_KeyEncryptors">
<xs:annotation>
<xs:documentation>A sequence of KeyEncryptor elements. Exactly one KeyEncryptors element MUST be present, and the KeyEncryptors element MUST contain at least one KeyEncryptor.</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="keyEncryptor" type="CT_KeyEncryptor" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="CT_Encryption">
<xs:sequence>
<xs:element name="keyData" type="CT_KeyData"/>
<xs:element name="dataIntegrity" type="CT_DataIntegrity">
<xs:annotation>
<xs:appinfo>modified for POI</xs:appinfo>
<xs:documentation>All ECMA-376 documents [ECMA-376] encrypted by Microsoft Office using agile encryption will have a DataIntegrity element present. The schema allows for a DataIntegrity element to not be present because the encryption schema can be used by applications that do not create ECMA-376 documents [ECMA-376].</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="keyEncryptors" type="CT_KeyEncryptors">
<xs:annotation>
<xs:documentation>The KeyEncryptor element, which MUST be used when encrypting password-protected agile encryption documents, is either a PasswordKeyEncryptor or a CertificateKeyEncryptor. Exactly one PasswordKeyEncryptor MUST be present. Zero or more CertificateKeyEncryptor elements are contained within the KeyEncryptors element.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="encryption" type="CT_Encryption"/>
</xs:schema>

View File

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password">
<xb:qname name="c:encryptedKey" javaname="EncryptedCertificateKey"/>
<xb:qname name="p:encryptedKey" javaname="EncryptedPasswordKey"/>
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:c="http://schemas.microsoft.com/office/2006/keyEncryptor/certificate" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password">
<xb:qname name="c:encryptedKey" javaname="EncryptedCertificateKey"/>
<xb:qname name="p:encryptedKey" javaname="EncryptedPasswordKey"/>
</xb:config>

View File

@ -1,66 +1,66 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/keyEncryptor/password" xmlns:e="http://schemas.microsoft.com/office/2006/encryption" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/keyEncryptor/password" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/encryption" schemaLocation="encryptionInfo.xsd"/>
<xs:simpleType name="ST_PasswordKeyEncryptorUri">
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/password"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_PasswordKeyEncryptor">
<xs:attribute name="saltSize" type="e:ST_SaltSize" use="required">
<xs:annotation><xs:documentation>A SaltSize that specifies the size of the salt for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="blockSize" type="e:ST_BlockSize" use="required">
<xs:annotation><xs:documentation>A BlockSize that specifies the block size for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="keyBits" type="e:ST_KeyBits" use="required">
<xs:annotation><xs:documentation>A KeyBits that specifies the number of bits for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="hashSize" type="e:ST_HashSize" use="required">
<xs:annotation><xs:documentation>A HashSize that specifies the size of the binary form of the hash for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="cipherAlgorithm" type="e:ST_CipherAlgorithm" use="required">
<xs:annotation><xs:documentation>A CipherAlgorithm that specifies the cipher algorithm for a PasswordKeyEncryptor. The cipher algorithm specified MUST be the same as the cipher algorithm specified for the Encryption.keyData element.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="cipherChaining" type="e:ST_CipherChaining" use="required">
<xs:annotation><xs:documentation>A CipherChaining that specifies the cipher chaining mode for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="hashAlgorithm" type="e:ST_HashAlgorithm" use="required">
<xs:annotation><xs:documentation>A HashAlgorithm that specifies the hashing algorithm for a PasswordKeyEncryptor. The hashing algorithm specified MUST be the same as the hashing algorithm specified for the Encryption.keyData element.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="saltValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded binary byte array that specifies the salt value for a PasswordKeyEncryptor. The number of bytes required by the decoded form of this element MUST be saltSize.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="spinCount" type="e:ST_SpinCount" use="required">
<xs:annotation><xs:documentation>A SpinCount that specifies the spin count for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedVerifierHashInput" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted verifier hash input for a PasswordKeyEncryptor used in password verification.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedVerifierHashValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted verifier hash value for a PasswordKeyEncryptor used in password verification.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedKeyValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted form of the intermediate key.</xs:documentation></xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="encryptedKey" type="CT_PasswordKeyEncryptor"/>
</xs:schema>
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xs:schema xmlns="http://schemas.microsoft.com/office/2006/keyEncryptor/password" xmlns:e="http://schemas.microsoft.com/office/2006/encryption" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.microsoft.com/office/2006/keyEncryptor/password" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://schemas.microsoft.com/office/2006/encryption" schemaLocation="encryptionInfo.xsd"/>
<xs:simpleType name="ST_PasswordKeyEncryptorUri">
<xs:restriction base="xs:token">
<xs:enumeration value="http://schemas.microsoft.com/office/2006/keyEncryptor/password"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CT_PasswordKeyEncryptor">
<xs:attribute name="saltSize" type="e:ST_SaltSize" use="required">
<xs:annotation><xs:documentation>A SaltSize that specifies the size of the salt for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="blockSize" type="e:ST_BlockSize" use="required">
<xs:annotation><xs:documentation>A BlockSize that specifies the block size for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="keyBits" type="e:ST_KeyBits" use="required">
<xs:annotation><xs:documentation>A KeyBits that specifies the number of bits for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="hashSize" type="e:ST_HashSize" use="required">
<xs:annotation><xs:documentation>A HashSize that specifies the size of the binary form of the hash for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="cipherAlgorithm" type="e:ST_CipherAlgorithm" use="required">
<xs:annotation><xs:documentation>A CipherAlgorithm that specifies the cipher algorithm for a PasswordKeyEncryptor. The cipher algorithm specified MUST be the same as the cipher algorithm specified for the Encryption.keyData element.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="cipherChaining" type="e:ST_CipherChaining" use="required">
<xs:annotation><xs:documentation>A CipherChaining that specifies the cipher chaining mode for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="hashAlgorithm" type="e:ST_HashAlgorithm" use="required">
<xs:annotation><xs:documentation>A HashAlgorithm that specifies the hashing algorithm for a PasswordKeyEncryptor. The hashing algorithm specified MUST be the same as the hashing algorithm specified for the Encryption.keyData element.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="saltValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded binary byte array that specifies the salt value for a PasswordKeyEncryptor. The number of bytes required by the decoded form of this element MUST be saltSize.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="spinCount" type="e:ST_SpinCount" use="required">
<xs:annotation><xs:documentation>A SpinCount that specifies the spin count for a PasswordKeyEncryptor.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedVerifierHashInput" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted verifier hash input for a PasswordKeyEncryptor used in password verification.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedVerifierHashValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted verifier hash value for a PasswordKeyEncryptor used in password verification.</xs:documentation></xs:annotation>
</xs:attribute>
<xs:attribute name="encryptedKeyValue" type="xs:base64Binary" use="required">
<xs:annotation><xs:documentation>A base64-encoded value that specifies the encrypted form of the intermediate key.</xs:documentation></xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:element name="encryptedKey" type="CT_PasswordKeyEncryptor"/>
</xs:schema>

View File

@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password">
<xb:qname name="p:encryptedKey" javaname="EncryptedPasswordKey"/>
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config" xmlns:p="http://schemas.microsoft.com/office/2006/keyEncryptor/password">
<xb:qname name="p:encryptedKey" javaname="EncryptedPasswordKey"/>
</xb:config>

View File

@ -1,103 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xsd:schema targetNamespace="http://schemas.microsoft.com/office/2006/digsig" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/office/2006/digsig" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="ST_PositiveInteger">
<xsd:restriction base="xsd:int">
<xsd:minExclusive value="0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureComments">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="255"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureProviderUrl">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2083"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureText">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureType">
<xsd:restriction base="xsd:int">
<xsd:enumeration value="1"/>
<xsd:enumeration value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_Version">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="64"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_UniqueIdentifierWithBraces">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\{[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}\}|"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:group name="EG_RequiredChildren">
<xsd:sequence>
<xsd:element name="SetupID" type="ST_UniqueIdentifierWithBraces"/>
<xsd:element name="SignatureText" type="ST_SignatureText"/>
<xsd:element name="SignatureImage" type="xsd:base64Binary"/>
<xsd:element name="SignatureComments" type="ST_SignatureComments"/>
<xsd:element name="WindowsVersion" type="ST_Version"/>
<xsd:element name="OfficeVersion" type="ST_Version"/>
<xsd:element name="ApplicationVersion" type="ST_Version"/>
<xsd:element name="Monitors" type="ST_PositiveInteger"/>
<xsd:element name="HorizontalResolution" type="ST_PositiveInteger"/>
<xsd:element name="VerticalResolution" type="ST_PositiveInteger"/>
<xsd:element name="ColorDepth" type="ST_PositiveInteger"/>
<xsd:element name="SignatureProviderId" type="ST_UniqueIdentifierWithBraces"/>
<xsd:element name="SignatureProviderUrl" type="ST_SignatureProviderUrl"/>
<xsd:element name="SignatureProviderDetails" type="xsd:int"/>
<xsd:element name="SignatureType" type="ST_SignatureType"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="EG_OptionalChildren">
<xsd:sequence>
<xsd:element name="DelegateSuggestedSigner" type="xsd:string"/>
<xsd:element name="DelegateSuggestedSigner2" type="xsd:string"/>
<xsd:element name="DelegateSuggestedSignerEmail" type="xsd:string"/>
<xsd:element name="ManifestHashAlgorithm" type="xsd:anyURI" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="EG_OptionalChildrenV2">
<xsd:sequence>
<xsd:element name="Address1" type="xsd:string"/>
<xsd:element name="Address2" type="xsd:string"/>
</xsd:sequence>
</xsd:group>
<xsd:complexType name="CT_SignatureInfoV1">
<xsd:sequence>
<xsd:group ref="EG_RequiredChildren"/>
<xsd:group ref="EG_OptionalChildren" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CT_SignatureInfoV2">
<xsd:sequence>
<xsd:group ref="EG_OptionalChildrenV2" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SignatureInfoV1" type="CT_SignatureInfoV1"/>
<xsd:element name="SignatureInfoV2" type="CT_SignatureInfoV2"/>
<?xml version="1.0" encoding="utf-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xsd:schema targetNamespace="http://schemas.microsoft.com/office/2006/digsig" elementFormDefault="qualified" xmlns="http://schemas.microsoft.com/office/2006/digsig" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:simpleType name="ST_PositiveInteger">
<xsd:restriction base="xsd:int">
<xsd:minExclusive value="0"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureComments">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="255"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureProviderUrl">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2083"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureText">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="100"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_SignatureType">
<xsd:restriction base="xsd:int">
<xsd:enumeration value="1"/>
<xsd:enumeration value="2"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_Version">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="64"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="ST_UniqueIdentifierWithBraces">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\{[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}\}|"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:group name="EG_RequiredChildren">
<xsd:sequence>
<xsd:element name="SetupID" type="ST_UniqueIdentifierWithBraces"/>
<xsd:element name="SignatureText" type="ST_SignatureText"/>
<xsd:element name="SignatureImage" type="xsd:base64Binary"/>
<xsd:element name="SignatureComments" type="ST_SignatureComments"/>
<xsd:element name="WindowsVersion" type="ST_Version"/>
<xsd:element name="OfficeVersion" type="ST_Version"/>
<xsd:element name="ApplicationVersion" type="ST_Version"/>
<xsd:element name="Monitors" type="ST_PositiveInteger"/>
<xsd:element name="HorizontalResolution" type="ST_PositiveInteger"/>
<xsd:element name="VerticalResolution" type="ST_PositiveInteger"/>
<xsd:element name="ColorDepth" type="ST_PositiveInteger"/>
<xsd:element name="SignatureProviderId" type="ST_UniqueIdentifierWithBraces"/>
<xsd:element name="SignatureProviderUrl" type="ST_SignatureProviderUrl"/>
<xsd:element name="SignatureProviderDetails" type="xsd:int"/>
<xsd:element name="SignatureType" type="ST_SignatureType"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="EG_OptionalChildren">
<xsd:sequence>
<xsd:element name="DelegateSuggestedSigner" type="xsd:string"/>
<xsd:element name="DelegateSuggestedSigner2" type="xsd:string"/>
<xsd:element name="DelegateSuggestedSignerEmail" type="xsd:string"/>
<xsd:element name="ManifestHashAlgorithm" type="xsd:anyURI" minOccurs="0"/>
</xsd:sequence>
</xsd:group>
<xsd:group name="EG_OptionalChildrenV2">
<xsd:sequence>
<xsd:element name="Address1" type="xsd:string"/>
<xsd:element name="Address2" type="xsd:string"/>
</xsd:sequence>
</xsd:group>
<xsd:complexType name="CT_SignatureInfoV1">
<xsd:sequence>
<xsd:group ref="EG_RequiredChildren"/>
<xsd:group ref="EG_OptionalChildren" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CT_SignatureInfoV2">
<xsd:sequence>
<xsd:group ref="EG_OptionalChildrenV2" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SignatureInfoV1" type="CT_SignatureInfoV1"/>
<xsd:element name="SignatureInfoV2" type="CT_SignatureInfoV2"/>
</xsd:schema>

View File

@ -1,466 +1,466 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.3.2#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://uri.etsi.org/01903/v1.3.2#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified">
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>
<!-- Start auxiliary types definitions: AnyType, ObjectIdentifierType,
EncapsulatedPKIDataType and containers for time-stamp tokens -->
<!-- Start AnyType -->
<xsd:element name="Any" type="AnyType"/>
<xsd:complexType name="AnyType" mixed="true">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="##any" processContents="lax"/>
</xsd:sequence>
<xsd:anyAttribute namespace="##any"/>
</xsd:complexType>
<!-- End AnyType -->
<!-- Start ObjectIdentifierType-->
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType"/>
<xsd:complexType name="ObjectIdentifierType">
<xsd:sequence>
<xsd:element name="Identifier" type="IdentifierType"/>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="DocumentationReferences" type="DocumentationReferencesType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IdentifierType">
<xsd:simpleContent>
<xsd:extension base="xsd:anyURI">
<xsd:attribute name="Qualifier" type="QualifierType" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="QualifierType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="OIDAsURI"/>
<xsd:enumeration value="OIDAsURN"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="DocumentationReferencesType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="DocumentationReference" type="xsd:anyURI"/>
</xsd:sequence>
</xsd:complexType>
<!-- End ObjectIdentifierType-->
<!-- Start EncapsulatedPKIDataType-->
<xsd:element name="EncapsulatedPKIData" type="EncapsulatedPKIDataType"/>
<xsd:complexType name="EncapsulatedPKIDataType">
<xsd:simpleContent>
<xsd:extension base="xsd:base64Binary">
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="Encoding" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- End EncapsulatedPKIDataType -->
<!-- Start time-stamp containers types -->
<!-- Start GenericTimeStampType -->
<xsd:element name="Include" type="IncludeType"/>
<xsd:complexType name="IncludeType">
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
<xsd:attribute name="referencedData" type="xsd:boolean" use="optional"/>
</xsd:complexType>
<xsd:element name="ReferenceInfo" type="ReferenceInfoType"/>
<xsd:complexType name="ReferenceInfoType">
<xsd:sequence>
<xsd:element ref="ds:DigestMethod"/>
<xsd:element ref="ds:DigestValue"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="GenericTimeStampType" abstract="true">
<xsd:sequence>
<xsd:choice minOccurs="0">
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
</xsd:choice>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End GenericTimeStampType -->
<!-- Start XAdESTimeStampType -->
<xsd:element name="XAdESTimeStamp" type="XAdESTimeStampType"/>
<xsd:complexType name="XAdESTimeStampType">
<xsd:complexContent>
<xsd:restriction base="GenericTimeStampType">
<xsd:sequence>
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<!-- End XAdESTimeStampType -->
<!-- Start OtherTimeStampType -->
<xsd:element name="OtherTimeStamp" type="OtherTimeStampType"/>
<xsd:complexType name="OtherTimeStampType">
<xsd:complexContent>
<xsd:restriction base="GenericTimeStampType">
<xsd:sequence>
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice>
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<!-- End OtherTimeStampType -->
<!-- End time-stamp containers types -->
<!-- End auxiliary types definitions-->
<!-- Start container types -->
<!-- Start QualifyingProperties -->
<xsd:element name="QualifyingProperties" type="QualifyingPropertiesType"/>
<xsd:complexType name="QualifyingPropertiesType">
<xsd:sequence>
<xsd:element name="SignedProperties" type="SignedPropertiesType" minOccurs="0"/>
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Target" type="xsd:anyURI" use="required"/>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End QualifyingProperties -->
<!-- Start SignedProperties-->
<xsd:element name="SignedProperties" type="SignedPropertiesType"/>
<xsd:complexType name="SignedPropertiesType">
<xsd:sequence>
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType" minOccurs="0"/>
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedProperties-->
<!-- Start UnsignedProperties-->
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType"/>
<xsd:complexType name="UnsignedPropertiesType">
<xsd:sequence>
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType" minOccurs="0"/>
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedProperties-->
<!-- Start SignedSignatureProperties-->
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType"/>
<xsd:complexType name="SignedSignaturePropertiesType">
<xsd:sequence>
<xsd:element name="SigningTime" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="SigningCertificate" type="CertIDListType" minOccurs="0"/>
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType" minOccurs="0"/>
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType" minOccurs="0"/>
<xsd:element name="SignerRole" type="SignerRoleType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedSignatureProperties-->
<!-- Start SignedDataObjectProperties-->
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType"/>
<xsd:complexType name="SignedDataObjectPropertiesType">
<xsd:sequence>
<xsd:element name="DataObjectFormat" type="DataObjectFormatType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedDataObjectProperties-->
<!-- Start UnsignedSignatureProperties-->
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType"/>
<xsd:complexType name="UnsignedSignaturePropertiesType">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
<xsd:any namespace="##other"/>
</xsd:choice>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedSignatureProperties-->
<!-- Start UnsignedDataObjectProperties-->
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType"/>
<xsd:complexType name="UnsignedDataObjectPropertiesType">
<xsd:sequence>
<xsd:element name="UnsignedDataObjectProperty" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedDataObjectProperties-->
<!-- Start QualifyingPropertiesReference-->
<xsd:element name="QualifyingPropertiesReference" type="QualifyingPropertiesReferenceType"/>
<xsd:complexType name="QualifyingPropertiesReferenceType">
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End QualifyingPropertiesReference-->
<!-- End container types -->
<!-- Start SigningTime element -->
<xsd:element name="SigningTime" type="xsd:dateTime"/>
<!-- End SigningTime element -->
<!-- Start SigningCertificate -->
<xsd:element name="SigningCertificate" type="CertIDListType"/>
<xsd:complexType name="CertIDListType">
<xsd:sequence>
<xsd:element name="Cert" type="CertIDType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CertIDType">
<xsd:sequence>
<xsd:element name="CertDigest" type="DigestAlgAndValueType"/>
<xsd:element name="IssuerSerial" type="ds:X509IssuerSerialType"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="DigestAlgAndValueType">
<xsd:sequence>
<xsd:element ref="ds:DigestMethod"/>
<xsd:element ref="ds:DigestValue"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SigningCertificate -->
<!-- Start SignaturePolicyIdentifier -->
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType"/>
<xsd:complexType name="SignaturePolicyIdentifierType">
<xsd:choice>
<xsd:element name="SignaturePolicyId" type="SignaturePolicyIdType"/>
<xsd:element name="SignaturePolicyImplied"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="SignaturePolicyIdType">
<xsd:sequence>
<xsd:element name="SigPolicyId" type="ObjectIdentifierType"/>
<xsd:element ref="ds:Transforms" minOccurs="0"/>
<xsd:element name="SigPolicyHash" type="DigestAlgAndValueType"/>
<xsd:element name="SigPolicyQualifiers" type="SigPolicyQualifiersListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SigPolicyQualifiersListType">
<xsd:sequence>
<xsd:element name="SigPolicyQualifier" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SPURI" type="xsd:anyURI"/>
<xsd:element name="SPUserNotice" type="SPUserNoticeType"/>
<xsd:complexType name="SPUserNoticeType">
<xsd:sequence>
<xsd:element name="NoticeRef" type="NoticeReferenceType" minOccurs="0"/>
<xsd:element name="ExplicitText" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="NoticeReferenceType">
<xsd:sequence>
<xsd:element name="Organization" type="xsd:string"/>
<xsd:element name="NoticeNumbers" type="IntegerListType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IntegerListType">
<xsd:sequence>
<xsd:element name="int" type="xsd:integer" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignaturePolicyIdentifier -->
<!-- Start CounterSignature -->
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
<xsd:complexType name="CounterSignatureType">
<xsd:sequence>
<xsd:element ref="ds:Signature"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CounterSignature -->
<!-- Start DataObjectFormat -->
<xsd:element name="DataObjectFormat" type="DataObjectFormatType"/>
<xsd:complexType name="DataObjectFormatType">
<xsd:sequence>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType" minOccurs="0"/>
<xsd:element name="MimeType" type="xsd:string" minOccurs="0"/>
<xsd:element name="Encoding" type="xsd:anyURI" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="ObjectReference" type="xsd:anyURI" use="required"/>
</xsd:complexType>
<!-- End DataObjectFormat -->
<!-- Start CommitmentTypeIndication -->
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType"/>
<xsd:complexType name="CommitmentTypeIndicationType">
<xsd:sequence>
<xsd:element name="CommitmentTypeId" type="ObjectIdentifierType"/>
<xsd:choice>
<xsd:element name="ObjectReference" type="xsd:anyURI" maxOccurs="unbounded"/>
<xsd:element name="AllSignedDataObjects"/>
</xsd:choice>
<xsd:element name="CommitmentTypeQualifiers" type="CommitmentTypeQualifiersListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CommitmentTypeQualifiersListType">
<xsd:sequence>
<xsd:element name="CommitmentTypeQualifier" type="AnyType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CommitmentTypeIndication -->
<!-- Start SignatureProductionPlace -->
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType"/>
<xsd:complexType name="SignatureProductionPlaceType">
<xsd:sequence>
<xsd:element name="City" type="xsd:string" minOccurs="0"/>
<xsd:element name="StateOrProvince" type="xsd:string" minOccurs="0"/>
<xsd:element name="PostalCode" type="xsd:string" minOccurs="0"/>
<xsd:element name="CountryName" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignatureProductionPlace -->
<!-- Start SignerRole -->
<xsd:element name="SignerRole" type="SignerRoleType"/>
<xsd:complexType name="SignerRoleType">
<xsd:sequence>
<xsd:element name="ClaimedRoles" type="ClaimedRolesListType" minOccurs="0"/>
<xsd:element name="CertifiedRoles" type="CertifiedRolesListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ClaimedRolesListType">
<xsd:sequence>
<xsd:element name="ClaimedRole" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CertifiedRolesListType">
<xsd:sequence>
<xsd:element name="CertifiedRole" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignerRole -->
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
<!-- Start CompleteCertificateRefs -->
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:complexType name="CompleteCertificateRefsType">
<xsd:sequence>
<xsd:element name="CertRefs" type="CertIDListType"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End CompleteCertificateRefs -->
<!-- Start CompleteRevocationRefs-->
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:complexType name="CompleteRevocationRefsType">
<xsd:sequence>
<xsd:element name="CRLRefs" type="CRLRefsType" minOccurs="0"/>
<xsd:element name="OCSPRefs" type="OCSPRefsType" minOccurs="0"/>
<xsd:element name="OtherRefs" type="OtherCertStatusRefsType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CRLRefsType">
<xsd:sequence>
<xsd:element name="CRLRef" type="CRLRefType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CRLRefType">
<xsd:sequence>
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType"/>
<xsd:element name="CRLIdentifier" type="CRLIdentifierType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CRLIdentifierType">
<xsd:sequence>
<xsd:element name="Issuer" type="xsd:string"/>
<xsd:element name="IssueTime" type="xsd:dateTime"/>
<xsd:element name="Number" type="xsd:integer" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="OCSPRefsType">
<xsd:sequence>
<xsd:element name="OCSPRef" type="OCSPRefType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OCSPRefType">
<xsd:sequence>
<xsd:element name="OCSPIdentifier" type="OCSPIdentifierType"/>
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ResponderIDType">
<xsd:choice>
<xsd:element name="ByName" type="xsd:string"/>
<xsd:element name="ByKey" type="xsd:base64Binary"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="OCSPIdentifierType">
<xsd:sequence>
<xsd:element name="ResponderID" type="ResponderIDType"/>
<xsd:element name="ProducedAt" type="xsd:dateTime"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="OtherCertStatusRefsType">
<xsd:sequence>
<xsd:element name="OtherRef" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CompleteRevocationRefs-->
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
<!-- Start CertificateValues -->
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
<xsd:complexType name="CertificateValuesType">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="EncapsulatedX509Certificate" type="EncapsulatedPKIDataType"/>
<xsd:element name="OtherCertificate" type="AnyType"/>
</xsd:choice>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End CertificateValues -->
<!-- Start RevocationValues-->
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
<xsd:complexType name="RevocationValuesType">
<xsd:sequence>
<xsd:element name="CRLValues" type="CRLValuesType" minOccurs="0"/>
<xsd:element name="OCSPValues" type="OCSPValuesType" minOccurs="0"/>
<xsd:element name="OtherValues" type="OtherCertStatusValuesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CRLValuesType">
<xsd:sequence>
<xsd:element name="EncapsulatedCRLValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OCSPValuesType">
<xsd:sequence>
<xsd:element name="EncapsulatedOCSPValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OtherCertStatusValuesType">
<xsd:sequence>
<xsd:element name="OtherValue" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End RevocationValues-->
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
</xsd:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.3.2#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://uri.etsi.org/01903/v1.3.2#" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" elementFormDefault="qualified">
<xsd:import namespace="http://www.w3.org/2000/09/xmldsig#" schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd"/>
<!-- Start auxiliary types definitions: AnyType, ObjectIdentifierType,
EncapsulatedPKIDataType and containers for time-stamp tokens -->
<!-- Start AnyType -->
<xsd:element name="Any" type="AnyType"/>
<xsd:complexType name="AnyType" mixed="true">
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:any namespace="##any" processContents="lax"/>
</xsd:sequence>
<xsd:anyAttribute namespace="##any"/>
</xsd:complexType>
<!-- End AnyType -->
<!-- Start ObjectIdentifierType-->
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType"/>
<xsd:complexType name="ObjectIdentifierType">
<xsd:sequence>
<xsd:element name="Identifier" type="IdentifierType"/>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="DocumentationReferences" type="DocumentationReferencesType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IdentifierType">
<xsd:simpleContent>
<xsd:extension base="xsd:anyURI">
<xsd:attribute name="Qualifier" type="QualifierType" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<xsd:simpleType name="QualifierType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="OIDAsURI"/>
<xsd:enumeration value="OIDAsURN"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="DocumentationReferencesType">
<xsd:sequence maxOccurs="unbounded">
<xsd:element name="DocumentationReference" type="xsd:anyURI"/>
</xsd:sequence>
</xsd:complexType>
<!-- End ObjectIdentifierType-->
<!-- Start EncapsulatedPKIDataType-->
<xsd:element name="EncapsulatedPKIData" type="EncapsulatedPKIDataType"/>
<xsd:complexType name="EncapsulatedPKIDataType">
<xsd:simpleContent>
<xsd:extension base="xsd:base64Binary">
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="Encoding" type="xsd:anyURI" use="optional"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
<!-- End EncapsulatedPKIDataType -->
<!-- Start time-stamp containers types -->
<!-- Start GenericTimeStampType -->
<xsd:element name="Include" type="IncludeType"/>
<xsd:complexType name="IncludeType">
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
<xsd:attribute name="referencedData" type="xsd:boolean" use="optional"/>
</xsd:complexType>
<xsd:element name="ReferenceInfo" type="ReferenceInfoType"/>
<xsd:complexType name="ReferenceInfoType">
<xsd:sequence>
<xsd:element ref="ds:DigestMethod"/>
<xsd:element ref="ds:DigestValue"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="GenericTimeStampType" abstract="true">
<xsd:sequence>
<xsd:choice minOccurs="0">
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
</xsd:choice>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End GenericTimeStampType -->
<!-- Start XAdESTimeStampType -->
<xsd:element name="XAdESTimeStamp" type="XAdESTimeStampType"/>
<xsd:complexType name="XAdESTimeStampType">
<xsd:complexContent>
<xsd:restriction base="GenericTimeStampType">
<xsd:sequence>
<xsd:element ref="Include" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<!-- End XAdESTimeStampType -->
<!-- Start OtherTimeStampType -->
<xsd:element name="OtherTimeStamp" type="OtherTimeStampType"/>
<xsd:complexType name="OtherTimeStampType">
<xsd:complexContent>
<xsd:restriction base="GenericTimeStampType">
<xsd:sequence>
<xsd:element ref="ReferenceInfo" maxOccurs="unbounded"/>
<xsd:element ref="ds:CanonicalizationMethod" minOccurs="0"/>
<xsd:choice>
<xsd:element name="EncapsulatedTimeStamp" type="EncapsulatedPKIDataType"/>
<xsd:element name="XMLTimeStamp" type="AnyType"/>
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
<!-- End OtherTimeStampType -->
<!-- End time-stamp containers types -->
<!-- End auxiliary types definitions-->
<!-- Start container types -->
<!-- Start QualifyingProperties -->
<xsd:element name="QualifyingProperties" type="QualifyingPropertiesType"/>
<xsd:complexType name="QualifyingPropertiesType">
<xsd:sequence>
<xsd:element name="SignedProperties" type="SignedPropertiesType" minOccurs="0"/>
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Target" type="xsd:anyURI" use="required"/>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End QualifyingProperties -->
<!-- Start SignedProperties-->
<xsd:element name="SignedProperties" type="SignedPropertiesType"/>
<xsd:complexType name="SignedPropertiesType">
<xsd:sequence>
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType" minOccurs="0"/>
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedProperties-->
<!-- Start UnsignedProperties-->
<xsd:element name="UnsignedProperties" type="UnsignedPropertiesType"/>
<xsd:complexType name="UnsignedPropertiesType">
<xsd:sequence>
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType" minOccurs="0"/>
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedProperties-->
<!-- Start SignedSignatureProperties-->
<xsd:element name="SignedSignatureProperties" type="SignedSignaturePropertiesType"/>
<xsd:complexType name="SignedSignaturePropertiesType">
<xsd:sequence>
<xsd:element name="SigningTime" type="xsd:dateTime" minOccurs="0"/>
<xsd:element name="SigningCertificate" type="CertIDListType" minOccurs="0"/>
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType" minOccurs="0"/>
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType" minOccurs="0"/>
<xsd:element name="SignerRole" type="SignerRoleType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedSignatureProperties-->
<!-- Start SignedDataObjectProperties-->
<xsd:element name="SignedDataObjectProperties" type="SignedDataObjectPropertiesType"/>
<xsd:complexType name="SignedDataObjectPropertiesType">
<xsd:sequence>
<xsd:element name="DataObjectFormat" type="DataObjectFormatType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End SignedDataObjectProperties-->
<!-- Start UnsignedSignatureProperties-->
<xsd:element name="UnsignedSignatureProperties" type="UnsignedSignaturePropertiesType"/>
<xsd:complexType name="UnsignedSignaturePropertiesType">
<xsd:choice maxOccurs="unbounded">
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
<xsd:any namespace="##other"/>
</xsd:choice>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedSignatureProperties-->
<!-- Start UnsignedDataObjectProperties-->
<xsd:element name="UnsignedDataObjectProperties" type="UnsignedDataObjectPropertiesType"/>
<xsd:complexType name="UnsignedDataObjectPropertiesType">
<xsd:sequence>
<xsd:element name="UnsignedDataObjectProperty" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End UnsignedDataObjectProperties-->
<!-- Start QualifyingPropertiesReference-->
<xsd:element name="QualifyingPropertiesReference" type="QualifyingPropertiesReferenceType"/>
<xsd:complexType name="QualifyingPropertiesReferenceType">
<xsd:attribute name="URI" type="xsd:anyURI" use="required"/>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End QualifyingPropertiesReference-->
<!-- End container types -->
<!-- Start SigningTime element -->
<xsd:element name="SigningTime" type="xsd:dateTime"/>
<!-- End SigningTime element -->
<!-- Start SigningCertificate -->
<xsd:element name="SigningCertificate" type="CertIDListType"/>
<xsd:complexType name="CertIDListType">
<xsd:sequence>
<xsd:element name="Cert" type="CertIDType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CertIDType">
<xsd:sequence>
<xsd:element name="CertDigest" type="DigestAlgAndValueType"/>
<xsd:element name="IssuerSerial" type="ds:X509IssuerSerialType"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="DigestAlgAndValueType">
<xsd:sequence>
<xsd:element ref="ds:DigestMethod"/>
<xsd:element ref="ds:DigestValue"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SigningCertificate -->
<!-- Start SignaturePolicyIdentifier -->
<xsd:element name="SignaturePolicyIdentifier" type="SignaturePolicyIdentifierType"/>
<xsd:complexType name="SignaturePolicyIdentifierType">
<xsd:choice>
<xsd:element name="SignaturePolicyId" type="SignaturePolicyIdType"/>
<xsd:element name="SignaturePolicyImplied"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="SignaturePolicyIdType">
<xsd:sequence>
<xsd:element name="SigPolicyId" type="ObjectIdentifierType"/>
<xsd:element ref="ds:Transforms" minOccurs="0"/>
<xsd:element name="SigPolicyHash" type="DigestAlgAndValueType"/>
<xsd:element name="SigPolicyQualifiers" type="SigPolicyQualifiersListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="SigPolicyQualifiersListType">
<xsd:sequence>
<xsd:element name="SigPolicyQualifier" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="SPURI" type="xsd:anyURI"/>
<xsd:element name="SPUserNotice" type="SPUserNoticeType"/>
<xsd:complexType name="SPUserNoticeType">
<xsd:sequence>
<xsd:element name="NoticeRef" type="NoticeReferenceType" minOccurs="0"/>
<xsd:element name="ExplicitText" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="NoticeReferenceType">
<xsd:sequence>
<xsd:element name="Organization" type="xsd:string"/>
<xsd:element name="NoticeNumbers" type="IntegerListType"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="IntegerListType">
<xsd:sequence>
<xsd:element name="int" type="xsd:integer" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignaturePolicyIdentifier -->
<!-- Start CounterSignature -->
<xsd:element name="CounterSignature" type="CounterSignatureType"/>
<xsd:complexType name="CounterSignatureType">
<xsd:sequence>
<xsd:element ref="ds:Signature"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CounterSignature -->
<!-- Start DataObjectFormat -->
<xsd:element name="DataObjectFormat" type="DataObjectFormatType"/>
<xsd:complexType name="DataObjectFormatType">
<xsd:sequence>
<xsd:element name="Description" type="xsd:string" minOccurs="0"/>
<xsd:element name="ObjectIdentifier" type="ObjectIdentifierType" minOccurs="0"/>
<xsd:element name="MimeType" type="xsd:string" minOccurs="0"/>
<xsd:element name="Encoding" type="xsd:anyURI" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="ObjectReference" type="xsd:anyURI" use="required"/>
</xsd:complexType>
<!-- End DataObjectFormat -->
<!-- Start CommitmentTypeIndication -->
<xsd:element name="CommitmentTypeIndication" type="CommitmentTypeIndicationType"/>
<xsd:complexType name="CommitmentTypeIndicationType">
<xsd:sequence>
<xsd:element name="CommitmentTypeId" type="ObjectIdentifierType"/>
<xsd:choice>
<xsd:element name="ObjectReference" type="xsd:anyURI" maxOccurs="unbounded"/>
<xsd:element name="AllSignedDataObjects"/>
</xsd:choice>
<xsd:element name="CommitmentTypeQualifiers" type="CommitmentTypeQualifiersListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CommitmentTypeQualifiersListType">
<xsd:sequence>
<xsd:element name="CommitmentTypeQualifier" type="AnyType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CommitmentTypeIndication -->
<!-- Start SignatureProductionPlace -->
<xsd:element name="SignatureProductionPlace" type="SignatureProductionPlaceType"/>
<xsd:complexType name="SignatureProductionPlaceType">
<xsd:sequence>
<xsd:element name="City" type="xsd:string" minOccurs="0"/>
<xsd:element name="StateOrProvince" type="xsd:string" minOccurs="0"/>
<xsd:element name="PostalCode" type="xsd:string" minOccurs="0"/>
<xsd:element name="CountryName" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignatureProductionPlace -->
<!-- Start SignerRole -->
<xsd:element name="SignerRole" type="SignerRoleType"/>
<xsd:complexType name="SignerRoleType">
<xsd:sequence>
<xsd:element name="ClaimedRoles" type="ClaimedRolesListType" minOccurs="0"/>
<xsd:element name="CertifiedRoles" type="CertifiedRolesListType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ClaimedRolesListType">
<xsd:sequence>
<xsd:element name="ClaimedRole" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CertifiedRolesListType">
<xsd:sequence>
<xsd:element name="CertifiedRole" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End SignerRole -->
<xsd:element name="AllDataObjectsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="IndividualDataObjectsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="SignatureTimeStamp" type="XAdESTimeStampType"/>
<!-- Start CompleteCertificateRefs -->
<xsd:element name="CompleteCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:complexType name="CompleteCertificateRefsType">
<xsd:sequence>
<xsd:element name="CertRefs" type="CertIDListType"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End CompleteCertificateRefs -->
<!-- Start CompleteRevocationRefs-->
<xsd:element name="CompleteRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:complexType name="CompleteRevocationRefsType">
<xsd:sequence>
<xsd:element name="CRLRefs" type="CRLRefsType" minOccurs="0"/>
<xsd:element name="OCSPRefs" type="OCSPRefsType" minOccurs="0"/>
<xsd:element name="OtherRefs" type="OtherCertStatusRefsType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CRLRefsType">
<xsd:sequence>
<xsd:element name="CRLRef" type="CRLRefType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CRLRefType">
<xsd:sequence>
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType"/>
<xsd:element name="CRLIdentifier" type="CRLIdentifierType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="CRLIdentifierType">
<xsd:sequence>
<xsd:element name="Issuer" type="xsd:string"/>
<xsd:element name="IssueTime" type="xsd:dateTime"/>
<xsd:element name="Number" type="xsd:integer" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="OCSPRefsType">
<xsd:sequence>
<xsd:element name="OCSPRef" type="OCSPRefType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OCSPRefType">
<xsd:sequence>
<xsd:element name="OCSPIdentifier" type="OCSPIdentifierType"/>
<xsd:element name="DigestAlgAndValue" type="DigestAlgAndValueType" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ResponderIDType">
<xsd:choice>
<xsd:element name="ByName" type="xsd:string"/>
<xsd:element name="ByKey" type="xsd:base64Binary"/>
</xsd:choice>
</xsd:complexType>
<xsd:complexType name="OCSPIdentifierType">
<xsd:sequence>
<xsd:element name="ResponderID" type="ResponderIDType"/>
<xsd:element name="ProducedAt" type="xsd:dateTime"/>
</xsd:sequence>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:complexType name="OtherCertStatusRefsType">
<xsd:sequence>
<xsd:element name="OtherRef" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End CompleteRevocationRefs-->
<xsd:element name="AttributeCertificateRefs" type="CompleteCertificateRefsType"/>
<xsd:element name="AttributeRevocationRefs" type="CompleteRevocationRefsType"/>
<xsd:element name="SigAndRefsTimeStamp" type="XAdESTimeStampType"/>
<xsd:element name="RefsOnlyTimeStamp" type="XAdESTimeStampType"/>
<!-- Start CertificateValues -->
<xsd:element name="CertificateValues" type="CertificateValuesType"/>
<xsd:complexType name="CertificateValuesType">
<xsd:choice minOccurs="0" maxOccurs="unbounded">
<xsd:element name="EncapsulatedX509Certificate" type="EncapsulatedPKIDataType"/>
<xsd:element name="OtherCertificate" type="AnyType"/>
</xsd:choice>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<!-- End CertificateValues -->
<!-- Start RevocationValues-->
<xsd:element name="RevocationValues" type="RevocationValuesType"/>
<xsd:complexType name="RevocationValuesType">
<xsd:sequence>
<xsd:element name="CRLValues" type="CRLValuesType" minOccurs="0"/>
<xsd:element name="OCSPValues" type="OCSPValuesType" minOccurs="0"/>
<xsd:element name="OtherValues" type="OtherCertStatusValuesType" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
</xsd:complexType>
<xsd:complexType name="CRLValuesType">
<xsd:sequence>
<xsd:element name="EncapsulatedCRLValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OCSPValuesType">
<xsd:sequence>
<xsd:element name="EncapsulatedOCSPValue" type="EncapsulatedPKIDataType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OtherCertStatusValuesType">
<xsd:sequence>
<xsd:element name="OtherValue" type="AnyType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!-- End RevocationValues-->
<xsd:element name="AttrAuthoritiesCertValues" type="CertificateValuesType"/>
<xsd:element name="AttributeRevocationValues" type="RevocationValuesType"/>
<xsd:element name="ArchiveTimeStamp" type="XAdESTimeStampType"/>
</xsd:schema>

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.4.1#" xmlns="http://uri.etsi.org/01903/v1.4.1#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" elementFormDefault="qualified">
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="http://uri.etsi.org/01903/v1.3.2/XAdES.xsd"/>
<!-- Start CertificateValues -->
<xsd:element name="TimeStampValidationData" type="ValidationDataType"/>
<xsd:complexType name="ValidationDataType">
<xsd:sequence>
<xsd:element ref="xades:CertificateValues" minOccurs="0"/>
<xsd:element ref="xades:RevocationValues" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:element name="ArchiveTimeStamp" type="xades:XAdESTimeStampType"/>
</xsd:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://uri.etsi.org/01903/v1.4.1#" xmlns="http://uri.etsi.org/01903/v1.4.1#" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xades="http://uri.etsi.org/01903/v1.3.2#" elementFormDefault="qualified">
<xsd:import namespace="http://uri.etsi.org/01903/v1.3.2#" schemaLocation="http://uri.etsi.org/01903/v1.3.2/XAdES.xsd"/>
<!-- Start CertificateValues -->
<xsd:element name="TimeStampValidationData" type="ValidationDataType"/>
<xsd:complexType name="ValidationDataType">
<xsd:sequence>
<xsd:element ref="xades:CertificateValues" minOccurs="0"/>
<xsd:element ref="xades:RevocationValues" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID" use="optional"/>
<xsd:attribute name="URI" type="xsd:anyURI" use="optional"/>
</xsd:complexType>
<xsd:element name="ArchiveTimeStamp" type="xades:XAdESTimeStampType"/>
</xsd:schema>

View File

@ -1,50 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">
<xb:namespace uri="urn:schemas-microsoft-com:office:office">
<xb:package>com.microsoft.schemas.office.office</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:excel">
<xb:package>com.microsoft.schemas.office.excel</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:word">
<xb:package>com.microsoft.schemas.office.word</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:powerpoint">
<xb:package>com.microsoft.schemas.office.powerpoint</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:vml">
<xb:package>com.microsoft.schemas.vml</xb:package>
</xb:namespace>
<xb:namespace uri="http://schemas.openxmlformats.org/markup-compatibility/2006">
<xb:package>com.microsoft.schemas.compatibility</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-poi-apache-org:vmldrawing">
<xb:package>org.apache.poi.schemas.vmldrawing</xb:package>
</xb:namespace>
<?xml version="1.0" encoding="UTF-8"?>
<!--
====================================================================
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.
====================================================================
-->
<xb:config xmlns:xb="http://xml.apache.org/xmlbeans/2004/02/xbean/config">
<xb:namespace uri="urn:schemas-microsoft-com:office:office">
<xb:package>com.microsoft.schemas.office.office</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:excel">
<xb:package>com.microsoft.schemas.office.excel</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:word">
<xb:package>com.microsoft.schemas.office.word</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:office:powerpoint">
<xb:package>com.microsoft.schemas.office.powerpoint</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-microsoft-com:vml">
<xb:package>com.microsoft.schemas.vml</xb:package>
</xb:namespace>
<xb:namespace uri="http://schemas.openxmlformats.org/markup-compatibility/2006">
<xb:package>com.microsoft.schemas.compatibility</xb:package>
</xb:namespace>
<xb:namespace uri="urn:schemas-poi-apache-org:vmldrawing">
<xb:package>org.apache.poi.schemas.vmldrawing</xb:package>
</xb:namespace>
</xb:config>

View File

@ -22,8 +22,8 @@ sourceSets {
}
dependencies {
api 'net.bytebuddy:byte-buddy:1.17.7'
api 'net.bytebuddy:byte-buddy-agent:1.17.7'
api 'net.bytebuddy:byte-buddy:1.18.5'
api 'net.bytebuddy:byte-buddy-agent:1.18.5'
api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
}
@ -42,8 +42,8 @@ tasks.register('compileJava9', JavaCompile) {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceCompatibility = 11
targetCompatibility = 11
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
@ -56,7 +56,7 @@ tasks.register('compileJava9', JavaCompile) {
}
jar {
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
manifest {
attributes (

View File

@ -25,7 +25,6 @@ import java.lang.instrument.Instrumentation;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.security.ProtectionDomain;
import java.util.HashSet;
@ -78,7 +77,7 @@ public class OOXMLLiteAgent {
private static final Set<Integer> hashes = new HashSet<>();
static void load(String path) throws IOException {
logPath = Paths.get(path);
logPath = Path.of(path);
if (Files.exists(logPath)) {
try (Stream<String> stream = Files.lines(logPath)) {
stream.forEach((s) -> hashes.add(s.hashCode()));
@ -109,7 +108,7 @@ public class OOXMLLiteAgent {
}
void load(String path) throws IOException {
this.logPath = Paths.get(path);
this.logPath = Path.of(path);
if (Files.exists(this.logPath)) {
try (Stream<String> stream = Files.lines(this.logPath)) {
stream.forEach((s) -> hashes.add(s.hashCode()));

View File

@ -93,8 +93,8 @@ task compileJava9(type: JavaCompile, dependsOn: 'compileJava') {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceCompatibility = 11
targetCompatibility = 11
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
@ -107,7 +107,7 @@ task compileJava9(type: JavaCompile, dependsOn: 'compileJava') {
}
jar {
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
doFirst {
File clazzFile = file("${OOXML_LITE_REPORT}.clazz")

View File

@ -62,7 +62,7 @@ dependencies {
// 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.4.1"
// api "org.apache.poi:poi-ooxml-full:5.5.1"
api "org.apache.xmlbeans:xmlbeans:${xmlbeansVersion}"
api "org.apache.commons:commons-compress:${commonsCompressVersion}"
@ -125,7 +125,7 @@ dependencies {
testImplementation project(path:':poi', configuration:'tests')
testImplementation project(path:':poi-ooxml-lite-agent', configuration: 'archives')
testRuntimeOnly "org.apiguardian:apiguardian-api:${apiGuardianVersion}"
testImplementation 'org.xmlunit:xmlunit-core:2.10.4'
testImplementation 'org.xmlunit:xmlunit-core:2.11.0'
testImplementation 'org.reflections:reflections:0.10.2'
testImplementation 'org.openjdk.jmh:jmh-core:1.36'
testImplementation 'org.openjdk.jmh:jmh-generator-annprocess:1.36'
@ -157,8 +157,8 @@ tasks.register('compileJava9', JavaCompile) {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceCompatibility = 11
targetCompatibility = 11
destinationDirectory = file(JAVA9_OUT + VERSIONS9)
source = file(JAVA9_SRC)
classpath = files()
@ -174,8 +174,8 @@ tasks.register('compileTest9', JavaCompile) {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(Math.max(11, jdkVersion))
}
sourceCompatibility = 1.9
targetCompatibility = 1.9
sourceCompatibility = 11
targetCompatibility = 11
destinationDirectory = file(TEST9_OUT + VERSIONS9)
source = file(TEST9_SRC)
options.compilerArgs = [
@ -187,7 +187,7 @@ tasks.register('compileTest9', JavaCompile) {
jar {
destinationDirectory = file("../build/dist/maven/${project.archivesBaseName}")
destinationDirectory = file("../build/dist/maven/${base.archivesName.get()}")
manifest {
attributes('Automatic-Module-Name': MODULE_NAME, 'Multi-Release': 'true')
@ -197,7 +197,7 @@ jar {
// Create a separate jar for test-code to depend on it in other projects
// See http://stackoverflow.com/questions/5144325/gradle-test-dependency
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'
// ignore second module-info.class from main
@ -214,12 +214,12 @@ javadoc {
failOnError = true
doFirst {
options {
if (jdkVersion > 8) addBooleanOption('html5', true)
addBooleanOption('html5', true)
links 'https://poi.apache.org/apidocs/dev/'
if (jdkVersion >= 23) links 'https://docs.oracle.com/en/java/javase/23/docs/api/' else 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
splitIndex = true
source = "1.8"
source = "11"
classpath += configurations.javadocs.files
}
}
@ -250,9 +250,6 @@ test {
dependsOn { testJar }
systemProperties['junit.jupiter.execution.parallel.enabled'] = 'true'
if (jdkVersion == 8) {
systemProperties['sun.java2d.renderer'] = 'sun.java2d.marlin.MarlinRenderingEngine'
}
if (NO_SCRATCHPAD) {
useJUnitPlatform {
@ -262,16 +259,12 @@ test {
doFirst {
jvmArgs += [
"-Xverify:all",
"-XX:ErrorFile=../build/hs_err_pid%p.log",
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}"
'-Xverify:all',
'-XX:ErrorFile=../build/hs_err_pid%p.log',
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-ooxml-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
]
if (jdkVersion > 8) {
jvmArgs += [
'--add-modules', MODULE_NAME,
'--module-path', '../build/dist/maven/poi-ooxml-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
]
}
}
}

View File

@ -1,44 +1,44 @@
/* ====================================================================
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.PackageRelationshipTypes;
import java.net.URI;
/**
* Represents a hyperlink relationship.
*
* @since POI 5.3.0
*/
public class HyperlinkRelationship extends ReferenceRelationship {
/**
* 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.
*/
protected HyperlinkRelationship(POIXMLDocumentPart container, URI hyperlinkUri, boolean isExternal, String id) {
super(container, hyperlinkUri, isExternal, PackageRelationshipTypes.HYPERLINK_PART, id);
}
@Override
public String getRelationshipType() {
return PackageRelationshipTypes.HYPERLINK_PART;
}
}
/* ====================================================================
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.PackageRelationshipTypes;
import java.net.URI;
/**
* Represents a hyperlink relationship.
*
* @since 5.3.0
*/
public class HyperlinkRelationship extends ReferenceRelationship {
/**
* 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.
*/
protected HyperlinkRelationship(POIXMLDocumentPart container, URI hyperlinkUri, boolean isExternal, String id) {
super(container, hyperlinkUri, isExternal, PackageRelationshipTypes.HYPERLINK_PART, id);
}
@Override
public String getRelationshipType() {
return PackageRelationshipTypes.HYPERLINK_PART;
}
}

View File

@ -155,7 +155,7 @@ public abstract class POIXMLDocument extends POIXMLDocumentPart implements Close
* @return the document's embedded files
*
* @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;

View File

@ -45,6 +45,7 @@ import org.apache.poi.xssf.usermodel.XSSFRelation;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFRelation;
import org.apache.xmlbeans.XmlException;
/**
* Represents an entry of a OOXML package.
@ -167,7 +168,7 @@ public class POIXMLDocumentPart {
*
* @param part - The package part that holds xml data representing this sheet.
* @see #read(POIXMLFactory, Map)
* @since POI 3.14-Beta1
* @since 3.14-Beta1
*/
public POIXMLDocumentPart(PackagePart part) {
this(null, part);
@ -180,7 +181,7 @@ public class POIXMLDocumentPart {
* @param parent - Parent part
* @param part - The package part that holds xml data representing this sheet.
* @see #read(POIXMLFactory, Map)
* @since POI 3.14-Beta1
* @since 3.14-Beta1
*/
public POIXMLDocumentPart(POIXMLDocumentPart parent, PackagePart part) {
this.packagePart = part;
@ -258,7 +259,7 @@ public class POIXMLDocumentPart {
*/
public final POIXMLDocumentPart getRelationById(String id) {
RelationPart rp = getRelationPartById(id);
return (rp == null) ? null : rp.getDocumentPart();
return rp == null ? null : rp.getDocumentPart();
}
/**
@ -668,8 +669,22 @@ public class POIXMLDocumentPart {
POIXMLDocumentPart childPart = context.get(p);
if (childPart == null) {
childPart = factory.createDocumentPart(this, p);
//here we are checking if part if embedded and excel then set it to chart class
try {
childPart = factory.createDocumentPart(this, p);
} 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
if (this instanceof XDDFChart && childPart instanceof XSSFWorkbook) {
((XDDFChart) this).setWorkbook((XSSFWorkbook) childPart);
@ -749,7 +764,7 @@ public class POIXMLDocumentPart {
*
* @param relId the part which is to be removed
* @return true, if the relation was removed
* @since POI 5.3.0
* @since 5.3.0
*/
public final boolean removeReferenceRelationship(String relId) {
ReferenceRelationship existing = referenceRelationships.remove(relId);
@ -766,7 +781,7 @@ public class POIXMLDocumentPart {
*
* @param relId the relation id
* @return the reference relationship or {@code null} if not found
* @since POI 5.3.0
* @since 5.3.0
*/
public final ReferenceRelationship getReferenceRelationship(String relId) {
return referenceRelationships.get(relId);
@ -779,10 +794,10 @@ public class POIXMLDocumentPart {
* @param isExternal true, if the target is an external resource
* @param relId the relation id
* @return the created reference relationship
* @since POI 5.3.0
* @since 5.3.0
*/
public final HyperlinkRelationship createHyperlink(URI uri, boolean isExternal, String relId) {
PackageRelationship pr = packagePart.addRelationship(uri, isExternal ? TargetMode.EXTERNAL : TargetMode.INTERNAL,
packagePart.addRelationship(uri, isExternal ? TargetMode.EXTERNAL : TargetMode.INTERNAL,
PackageRelationshipTypes.HYPERLINK_PART, relId);
HyperlinkRelationship hyperlink = new HyperlinkRelationship(this, uri, isExternal, relId);
referenceRelationships.put(relId, hyperlink);
@ -793,7 +808,7 @@ public class POIXMLDocumentPart {
* Returns an unmodifiable list of reference relationships for this POIXMLDocumentPart.
*
* @return reference relationships
* @since POI 5.3.0
* @since 5.3.0
* @see #getRelationParts() for child relations
*/
public final List<ReferenceRelationship> getReferenceRelationships() {

View File

@ -75,7 +75,7 @@ public abstract class POIXMLFactory {
* @param relationshipType the relationship type of the descriptor
* @return the descriptor or null if type is unknown
*
* @since POI 3.14-Beta1
* @since 3.14-Beta1
*/
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
*
* @since POI 3.14-Beta1
* @since 3.14-Beta1
*/
protected PackageRelationship getPackageRelationship(POIXMLDocumentPart parent, PackagePart part) {
try {

View File

@ -316,11 +316,11 @@ public class POIXMLProperties {
public void setLastPrinted(String date) throws InvalidFormatException {
part.setLastPrintedProperty(date);
}
/** @since POI 3.15 beta 3 */
/** @since 3.15 beta 3 */
public String getLastModifiedByUser() {
return part.getLastModifiedByProperty().orElse(null);
}
/** @since POI 3.15 beta 3 */
/** @since 3.15 beta 3 */
public void setLastModifiedByUser(String user) {
part.setLastModifiedByProperty(user);
}
@ -349,7 +349,7 @@ public class POIXMLProperties {
/**
* Sets the version property.
* @param version property value
* @since POI 5.2.3
* @since 5.2.3
*/
public void setVersion(String version) {
part.setVersionProperty(version);
@ -358,7 +358,7 @@ public class POIXMLProperties {
/**
* Returns the version property value.
* @return version property (can be null)
* @since POI 5.2.3
* @since 5.2.3
*/
public String getVersion() {
return part.getVersionProperty().orElse(null);
@ -399,7 +399,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setTemplate(String template) {
props.getProperties().setTemplate(template);
}
@ -409,7 +409,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setManager(String manager) {
props.getProperties().setManager(manager);
}
@ -419,7 +419,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setCompany(String company) {
props.getProperties().setCompany(company);
}
@ -429,7 +429,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setPresentationFormat(String presentationFormat) {
props.getProperties().setPresentationFormat(presentationFormat);
}
@ -439,7 +439,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setApplication(String application) {
props.getProperties().setApplication(application);
}
@ -449,7 +449,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setAppVersion(String appVersion) {
props.getProperties().setAppVersion(appVersion);
}
@ -460,7 +460,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setPages(int pages) {
props.getProperties().setPages(pages);
}
@ -470,7 +470,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setWords(int words) {
props.getProperties().setWords(words);
}
@ -480,7 +480,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setCharacters(int characters) {
props.getProperties().setCharacters(characters);
}
@ -490,7 +490,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setCharactersWithSpaces(int charactersWithSpaces) {
props.getProperties().setCharactersWithSpaces(charactersWithSpaces);
}
@ -500,7 +500,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setLines(int lines) {
props.getProperties().setLines(lines);
}
@ -510,7 +510,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setParagraphs(int paragraphs) {
props.getProperties().setParagraphs(paragraphs);
}
@ -520,7 +520,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setSlides(int slides) {
props.getProperties().setSlides(slides);
}
@ -530,7 +530,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setNotes(int notes) {
props.getProperties().setNotes(notes);
}
@ -540,7 +540,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setTotalTime(int totalTime) {
props.getProperties().setTotalTime(totalTime);
}
@ -550,7 +550,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setHiddenSlides(int hiddenSlides) {
props.getProperties().setHiddenSlides(hiddenSlides);
}
@ -560,7 +560,7 @@ public class POIXMLProperties {
}
return -1;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setMMClips(int mmClips) {
props.getProperties().setMMClips(mmClips);
}
@ -571,7 +571,7 @@ public class POIXMLProperties {
}
return null;
}
/** @since POI 4.1.1 */
/** @since 4.1.1 */
public void setHyperlinkBase(String hyperlinkBase) {
props.getProperties().setHyperlinkBase(hyperlinkBase);
}

View File

@ -1,79 +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 POI 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;
}
}
/* ====================================================================
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;
}
}

View File

@ -119,7 +119,7 @@ public final class POIXMLExtractorFactory implements ExtractorProvider {
* Clears the setting for this thread made by {@link #setThreadPrefersEventExtractors(boolean) }
*
* @see #setThreadPrefersEventExtractors(boolean)
* @since POI 5.2.4
* @since 5.2.4
*/
public static void removeThreadPrefersEventExtractorsSetting() {
ExtractorFactory.removeThreadPrefersEventExtractorsSetting();

View File

@ -73,14 +73,14 @@ public class POIXMLPropertiesTextExtractor implements POIXMLTextExtractor {
}
private void appendDateIfPresent(StringBuilder text, String thing, Optional<Date> value) {
if (!value.isPresent()) {
if (value.isEmpty()) {
return;
}
appendIfPresent(text, thing, dateFormat.format(value.get()));
}
private void appendIfPresent(StringBuilder text, String thing, Optional<String> value) {
if (!value.isPresent()) {
if (value.isEmpty()) {
return;
}
appendIfPresent(text, thing, value.get());

View File

@ -23,7 +23,7 @@ import org.apache.poi.util.Internal;
* Helper class for number related operations.
* <p>Note: This class is for internal POI usage only.</p>
*
* @since POI 5.5.0
* @since 5.5.0
*/
@Internal
public class NumberHelper {

View File

@ -32,12 +32,10 @@ import org.apache.poi.openxml4j.opc.PackagePartName;
import org.apache.poi.openxml4j.opc.PackageProperties;
import org.apache.poi.openxml4j.opc.PackageRelationship;
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.TargetMode;
import org.apache.poi.openxml4j.opc.internal.InvalidZipException;
import org.apache.poi.util.IOUtils;
import org.apache.poi.util.Removal;
/**
* Provides handy methods to work with OOXML packages
@ -60,7 +58,7 @@ public final class PackageHelper {
* @return OPCPackage
* @throws IOException If reading data from the stream fails
* @throws POIXMLException If the stream is not a valid OPC package
* @since POI 5.2.0
* @since 5.2.0
*/
public static OPCPackage open(InputStream stream, boolean closeStream) throws IOException {
try {
@ -78,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
*/

View File

@ -1,41 +0,0 @@
/* ====================================================================
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 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;
/**
* Provides handy methods for working with SAX parsers and readers
* @deprecated use {@link XMLHelper}
*/
@Deprecated
@Removal(version = "6.0.0")
public final class SAXHelper {
/**
* Creates a new SAX XMLReader, with sensible defaults
*/
public static XMLReader newXMLReader() throws SAXException, ParserConfigurationException {
return XMLHelper.newXMLReader();
}
}

View File

@ -1,36 +0,0 @@
/* ====================================================================
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 javax.xml.transform.TransformerFactory;
import org.apache.poi.util.Removal;
import org.apache.poi.util.XMLHelper;
/**
* @deprecated use {@link XMLHelper}
*/
@Removal(version = "6.0.0")
@Deprecated
public final class TransformerHelper {
private TransformerHelper() {}
public static TransformerFactory getFactory() {
return XMLHelper.getTransformerFactory();
}
}

View File

@ -102,7 +102,7 @@ public final class XPathHelper {
* thrown if the AlternateContent is not allowed by the surrounding element or if the
* extracted object is of the generic type XmlAnyTypeImpl.
*
* @since POI 4.1.2
* @since 4.1.2
*/
@SuppressWarnings("unchecked")
@Internal

View File

@ -24,7 +24,7 @@ package org.apache.poi.openxml4j.opc;
*
* 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 POI 5.4.1
* @since 5.4.1
*/
public class OPCComplianceFlags {

View File

@ -31,7 +31,7 @@ import java.io.OutputStream;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
@ -151,7 +151,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* @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 POI 5.4.1
* @since 5.4.1
*/
OPCPackage(PackageAccess access, OPCComplianceFlags opcComplianceFlags) {
if (getClass() != ZipPackage.class) {
@ -203,7 +203,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* @throws InvalidFormatException
* If the specified file doesn't exist, and a parsing error
* occur.
* @since POI 5.4.1
* @since 5.4.1
*/
public static OPCPackage open(String path, OPCComplianceFlags opcComplianceFlags) throws InvalidFormatException {
return open(path, defaultPackageAccess, opcComplianceFlags);
@ -234,7 +234,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* @throws InvalidFormatException
* If the specified file doesn't exist, and a parsing error
* occur.
* @since POI 5.4.1
* @since 5.4.1
*/
public static OPCPackage open(File file, OPCComplianceFlags opcComplianceFlags) throws InvalidFormatException {
return open(file, defaultPackageAccess, opcComplianceFlags);
@ -265,7 +265,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* The level of OPC compliance to enforce when reading the package
* @return A Package object
* @throws InvalidFormatException if a parsing error occur.
* @since POI 5.4.1
* @since 5.4.1
*/
public static OPCPackage open(ZipEntrySource zipEntry, OPCComplianceFlags opcComplianceFlags) throws InvalidFormatException {
OPCPackage pack = new ZipPackage(zipEntry, PackageAccess.READ, opcComplianceFlags);
@ -317,7 +317,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* occur.
* @throws InvalidOperationException If the zip file cannot be opened.
* @throws InvalidFormatException if the package is not valid.
* @since POI 5.4.1
* @since 5.4.1
*/
public static OPCPackage open(String path, PackageAccess access, OPCComplianceFlags opcComplianceFlags)
throws InvalidFormatException, InvalidOperationException {
@ -378,7 +378,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* If the specified file doesn't exist or is a directory.
* @throws InvalidFormatException
* If a parsing error occurs.
* @since POI 5.4.1
* @since 5.4.1
*/
public static OPCPackage open(File file, PackageAccess access, OPCComplianceFlags opcComplianceFlags)
throws InvalidFormatException {
@ -447,7 +447,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* @throws InvalidFormatException
* Throws if the specified file exist and is not valid.
* @throws IOException If reading the stream fails
* @since POI 5.4.1
* @since 5.4.1
*/
public static OPCPackage open(InputStream in, OPCComplianceFlags opcComplianceFlags) throws InvalidFormatException,
IOException {
@ -484,7 +484,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* @throws InvalidFormatException
* Throws if the specified file exist and is not valid.
* @throws IOException If reading the stream fails
* @since POI 5.2.5
* @since 5.2.5
*/
public static OPCPackage open(InputStream in, boolean closeStream) throws InvalidFormatException,
IOException {
@ -509,7 +509,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* @throws InvalidFormatException
* Throws if the specified file exist and is not valid.
* @throws IOException If reading the stream fails
* @since POI 5.4.1
* @since 5.4.1
*/
public static OPCPackage open(InputStream in, boolean closeStream, OPCComplianceFlags opcComplianceFlags) throws InvalidFormatException,
IOException {
@ -711,7 +711,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
}
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);
}
}
@ -1796,7 +1796,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
* @param oldContentType the content type to be replaced
* @param newContentType the replacement
* @return whether replacement was successful
* @since POI-3.8
* @since -3.8
*/
public boolean replaceContentType(String oldContentType, String newContentType){
boolean success = false;
@ -1861,7 +1861,7 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
/**
* @return true if the package is in Strict OOXML format
* @since POI 5.1.0
* @since 5.1.0
*/
public boolean isStrictOoxmlFormat() {
PackageRelationshipCollection coreDocRelationships = getRelationshipsByType(
@ -1875,7 +1875,10 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
public abstract boolean isClosed();
protected void closeParts() {
partList.closeParts();
// might not be initialized fully yet
if (partList != null) {
partList.closeParts();
}
}
@Override

View File

@ -287,7 +287,7 @@ public final class PackageRelationshipCollection implements Iterable<PackageRela
/**
* Is this collection empty?
* @since POI 5.2.0
* @since 5.2.0
*/
public boolean isEmpty() {
return relationshipsByID.isEmpty();
@ -386,7 +386,7 @@ public final class PackageRelationshipCollection implements Iterable<PackageRela
/**
* Get this collection's spliterator.
*
* @since POI 5.2.0
* @since 5.2.0
*/
@Override
public Spliterator<PackageRelationship> spliterator() {

View File

@ -110,7 +110,7 @@ public final class ZipPackage extends OPCPackage {
* Constructor. Creates a new, empty ZipPackage.
* @param opcComplianceFlags
* The level of OPC compliance to enforce when reading the package
* @since POI 5.4.1
* @since 5.4.1
*/
public ZipPackage(OPCComplianceFlags opcComplianceFlags) {
super(defaultPackageAccess, opcComplianceFlags);
@ -156,7 +156,7 @@ public final class ZipPackage extends OPCPackage {
* ZipInputStream.
* @throws IOException
* if input stream cannot be opened, read, or closed
* @since POI 5.4.1
* @since 5.4.1
*/
ZipPackage(InputStream in, PackageAccess access, OPCComplianceFlags opcComplianceFlags) throws IOException {
super(access, opcComplianceFlags);
@ -180,7 +180,7 @@ public final class ZipPackage extends OPCPackage {
* ZipInputStream.
* @throws IOException
* if input stream cannot be opened, read, or closed
* @since POI 5.2.5
* @since 5.2.5
*/
ZipPackage(InputStream in, PackageAccess access, boolean closeStream) throws IOException {
this(in, access, closeStream, OPCComplianceFlags.enforceAll());
@ -203,7 +203,7 @@ public final class ZipPackage extends OPCPackage {
* ZipInputStream.
* @throws IOException
* if input stream cannot be opened, read, or closed
* @since POI 5.4.1
* @since 5.4.1
*/
ZipPackage(InputStream in, PackageAccess access, boolean closeStream, OPCComplianceFlags opcComplianceFlags) throws IOException {
super(access, opcComplianceFlags);
@ -235,7 +235,7 @@ public final class ZipPackage extends OPCPackage {
* @param opcComplianceFlags
* The level of OPC compliance to enforce when reading the package
* @throws InvalidOperationException If the zip file cannot be opened.
* @since POI 5.4.1
* @since 5.4.1
*/
ZipPackage(String path, PackageAccess access, OPCComplianceFlags opcComplianceFlags) throws InvalidOperationException {
this(new File(path), access, opcComplianceFlags);
@ -264,7 +264,7 @@ public final class ZipPackage extends OPCPackage {
* @param opcComplianceFlags
* The level of OPC compliance to enforce when reading the package
* @throws InvalidOperationException If the zip file cannot be opened.
* @since POI 5.4.1
* @since 5.4.1
*/
ZipPackage(File file, PackageAccess access, OPCComplianceFlags opcComplianceFlags) throws InvalidOperationException {
super(access, opcComplianceFlags);
@ -348,7 +348,7 @@ public final class ZipPackage extends OPCPackage {
* The package access mode.
* @param access
* The package access mode.
* @since POI 5.4.1
* @since 5.4.1
*/
ZipPackage(ZipEntrySource zipEntry, PackageAccess access, OPCComplianceFlags opcComplianceFlags) {
super(access, opcComplianceFlags);

View File

@ -34,7 +34,7 @@ import java.io.*;
/**
* (Experimental) Encrypted Temp File version of a package part.
*
* @since POI 5.1.0
* @since 5.1.0
*/
@Beta
public final class EncryptedTempFilePackagePart extends PackagePart {

View File

@ -22,7 +22,7 @@ import java.io.IOException;
/**
* Thrown if the zip file is invalid.
*
* @since POI 5.4.0
* @since 5.4.0
*/
public class InvalidZipException extends IOException {
public InvalidZipException(String message) {

View File

@ -35,7 +35,7 @@ import java.nio.file.Files;
/**
* (Experimental) Temp File version of a package part.
*
* @since POI 5.1.0
* @since 5.1.0
*/
@Beta
public final class TempFilePackagePart extends PackagePart {

View File

@ -138,7 +138,7 @@ public class PackagePropertiesMarshaller implements PartMarshaller {
}
private Element setElementTextContent(String localName, NamespaceImpl namespace, Optional<?> property, String propertyValue) {
if (!property.isPresent())
if (property.isEmpty())
return null;
Element root = xmlDoc.getDocumentElement();

View File

@ -56,7 +56,7 @@ public final class PackagePropertiesUnmarshaller implements PartUnmarshaller {
/**
* @param opcComplianceFlags Overrides the default OPC compliance settings
* @since POI 5.4.1
* @since 5.4.1
*/
public PackagePropertiesUnmarshaller(OPCComplianceFlags opcComplianceFlags) {
this.opcComplianceFlags = opcComplianceFlags;

View File

@ -124,7 +124,7 @@ public final class ZipArchiveFakeEntry extends ZipArchiveEntry implements Closea
/**
* Deletes any temp files and releases any byte arrays.
* @throws IOException If closing the entry fails.
* @since POI 5.1.0
* @since 5.1.0
*/
@Override
public void close() throws IOException {

View File

@ -41,7 +41,7 @@ public interface ZipEntrySource extends Closeable {
* @param path the path in unix-notation
* @return the entry or {@code null} if not found
*
* @since POI 4.0.0
* @since 4.0.0
*/
ZipArchiveEntry getEntry(String path);

View File

@ -51,7 +51,7 @@ public class ZipInputStreamZipEntrySource implements ZipEntrySource {
* and the data is put in a temp file instead - defaults to -1 meaning temp files are not used
* and that zip entries with more than 2GB of data after decompressing will fail, 0 means all
* zip entries are stored in temp files. A threshold like 50000000 (approx 50Mb is recommended)
* @since POI 5.1.0
* @since 5.1.0
* @see #setEncryptTempFiles(boolean)
*/
public static void setThresholdBytesForTempFiles(int thresholdBytes) {
@ -62,7 +62,7 @@ public class ZipInputStreamZipEntrySource implements ZipEntrySource {
* Get the threshold at which a zip entry is regarded as too large for holding in memory
* and the data is put in a temp file instead (defaults to -1 meaning temp files are not used)
* @return threshold in bytes
* @since POI 5.1.0
* @since 5.1.0
*/
public static int getThresholdBytesForTempFiles() {
return thresholdForTempFiles;
@ -71,7 +71,7 @@ public class ZipInputStreamZipEntrySource implements ZipEntrySource {
/**
* Encrypt temp files when they are used. Only affects temp files related to zip entries.
* @param encrypt whether temp files should be encrypted
* @since POI 5.1.0
* @since 5.1.0
* @see #setThresholdBytesForTempFiles(int)
*/
public static void setEncryptTempFiles(boolean encrypt) {
@ -80,7 +80,7 @@ public class ZipInputStreamZipEntrySource implements ZipEntrySource {
/**
* Whether temp files should be encrypted (default false). Only affects temp files related to zip entries.
* @since POI 5.1.0
* @since 5.1.0
*/
public static boolean shouldEncryptTempFiles() {
return encryptTempFiles;

View File

@ -93,7 +93,7 @@ public class ZipSecureFile extends ZipFile {
* See setMaxFileCount() for details.
*
* @return The max accepted file count (i.e. the max number of files we allow inside zip files that we read - including OOXML files like xlsx, docx, pptx, etc.).
* @since POI 5.2.4
* @since 5.2.4
*/
public static long getMaxFileCount() {
return MAX_FILE_COUNT;
@ -104,7 +104,7 @@ public class ZipSecureFile extends ZipFile {
* including OOXML files like xlsx, docx, pptx, etc. The default is 1000.
*
* @param maxFileCount The max accepted file count
* @since POI 5.2.4
* @since 5.2.4
*/
public static void setMaxFileCount(final long maxFileCount) {
MAX_FILE_COUNT = maxFileCount;
@ -151,7 +151,7 @@ public class ZipSecureFile extends ZipFile {
*
* @param graceEntrySize the grace entry size of a single zip entry
* @throws IllegalArgumentException for negative graceEntrySize
* @since POI 5.2.4
* @since 5.2.4
*/
public static void setGraceEntrySize(long graceEntrySize) {
if (graceEntrySize < 0) {
@ -167,7 +167,7 @@ public class ZipSecureFile extends ZipFile {
* See setGraceEntrySize() for details.
*
* @return The current grace entry size
* @since POI 5.2.4
* @since 5.2.4
*/
public static long getGraceEntrySize() {
return GRACE_ENTRY_SIZE;
@ -249,6 +249,7 @@ public class ZipSecureFile extends ZipFile {
* @return the path name of the ZIP file
* @deprecated there is no need for this method - it will be removed in a future version of POI (deprecated since POI 5.3.0)
*/
@Deprecated(since = "5.3.0", forRemoval = true)
@Removal(version = "7.0.0")
public String getName() {
return fileName;

View File

@ -34,7 +34,6 @@ import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@ -47,7 +46,6 @@ import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.xml.crypto.URIDereferencer;
import javax.xml.crypto.dsig.CanonicalizationMethod;
import javax.xml.crypto.dsig.DigestMethod;
import javax.xml.crypto.dsig.Transform;
@ -70,7 +68,6 @@ import org.apache.poi.poifs.crypt.dsig.services.TimeStampService;
import org.apache.poi.poifs.crypt.dsig.services.TimeStampServiceValidator;
import org.apache.poi.poifs.crypt.dsig.services.TimeStampSimpleHttpClient;
import org.apache.poi.util.LocaleUtil;
import org.apache.poi.util.Removal;
import org.apache.xml.security.signature.XMLSignature;
/**
@ -113,12 +110,12 @@ public class SignatureConfig {
private static final String XMLSEC_SANTUARIO = "org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI";
private static final String XMLSEC_JDK = "org.jcp.xml.dsig.internal.dom.XMLDSigRI";
private static final List<Supplier<SignatureFacet>> DEFAULT_FACETS = Collections.unmodifiableList(Arrays.asList(
OOXMLSignatureFacet::new,
KeyInfoSignatureFacet::new,
XAdESSignatureFacet::new,
Office2010SignatureFacet::new
));
private static final List<Supplier<SignatureFacet>> DEFAULT_FACETS = List.of(
OOXMLSignatureFacet::new,
KeyInfoSignatureFacet::new,
XAdESSignatureFacet::new,
Office2010SignatureFacet::new
);
private List<SignatureFacet> signatureFacets = new ArrayList<>();
private HashAlgorithm digestAlgo = HashAlgorithm.sha256;
@ -130,7 +127,6 @@ public class SignatureConfig {
* the optional signature policy service used for XAdES-EPES.
*/
private SignaturePolicyService signaturePolicyService;
private URIDereferencer uriDereferencer = new OOXMLURIDereferencer();
private String canonicalizationMethod = CanonicalizationMethod.INCLUSIVE;
private boolean includeEntireCertificateChain = true;
@ -236,14 +232,14 @@ public class SignatureConfig {
/**
* if true, the signature is added to the existing signatures
*
* @since POI 4.1.0
* @since 4.1.0
*/
private boolean allowMultipleSignatures = false;
/**
* Switch to enable/disable secure validation - see setter for more information
*
* @since POI 5.2.0
* @since 5.2.0
*/
private boolean secureValidation = true;
@ -253,7 +249,7 @@ public class SignatureConfig {
* Switch to enable/disable automatic CRL download - by default the download is with all https hostname
* and certificate verifications disabled.
*
* @since POI 5.2.1
* @since 5.2.1
*/
private boolean allowCRLDownload = false;
@ -362,7 +358,7 @@ public class SignatureConfig {
/**
* @return the formatted execution time ({@link #SIGNATURE_TIME_FORMAT})
*
* @since POI 4.0.0
* @since 4.0.0
*/
public String formatExecutionTime() {
final DateFormat fmt = new SimpleDateFormat(SIGNATURE_TIME_FORMAT, Locale.ROOT);
@ -374,7 +370,7 @@ public class SignatureConfig {
* Sets the executionTime which is in standard format ({@link #SIGNATURE_TIME_FORMAT})
* @param executionTime the execution time
*
* @since POI 4.0.0
* @since 4.0.0
*/
public void setExecutionTime(String executionTime) {
if (executionTime != null && !executionTime.isEmpty()){
@ -402,28 +398,6 @@ public class SignatureConfig {
this.signaturePolicyService = signaturePolicyService;
}
/**
* @return the dereferencer used for Reference/@URI attributes, defaults to {@link OOXMLURIDereferencer}
*
* @deprecated in POI 5.0.0 - use {@link SignatureInfo#getUriDereferencer()} instead
*/
@Deprecated
@Removal(version = "5.0.0")
public URIDereferencer getUriDereferencer() {
return uriDereferencer;
}
/**
* @param uriDereferencer the dereferencer used for Reference/@URI attributes
*
* @deprecated in POI 5.0.0 - use {@link SignatureInfo#setUriDereferencer(URIDereferencer)} instead
*/
@Deprecated
@Removal(version = "5.0.0")
public void setUriDereferencer(URIDereferencer uriDereferencer) {
this.uriDereferencer = uriDereferencer;
}
/**
* @return Gives back the human-readable description of what the citizen
* will be signing. The default value is "Office OpenXML Document".
@ -598,7 +572,7 @@ public class SignatureConfig {
/**
* @return the http client used for timestamp server connections
*
* @since POI 5.2.1
* @since 5.2.1
*/
public TimeStampHttpClient getTspHttpClient() {
return tspHttpClient;
@ -607,7 +581,7 @@ public class SignatureConfig {
/**
* @param tspHttpClient the http client used for timestamp server connections
*
* @since POI 5.2.1
* @since 5.2.1
*/
public void setTspHttpClient(TimeStampHttpClient tspHttpClient) {
this.tspHttpClient = tspHttpClient;
@ -690,7 +664,7 @@ public class SignatureConfig {
* @param xadesDigestAlgo hash algorithm used for XAdES.
* When {@code null}, defaults to {@link #getDigestAlgo()}
*
* @since POI 4.0.0
* @since 4.0.0
*/
public void setXadesDigestAlgo(String xadesDigestAlgo) {
this.xadesDigestAlgo = getDigestMethodAlgo(xadesDigestAlgo);
@ -951,7 +925,7 @@ public class SignatureConfig {
*
* @param signatureMethodUri the method uri
*
* @since POI 4.0.0
* @since 4.0.0
*/
public void setSignatureMethodFromUri(final String signatureMethodUri) {
switch (signatureMethodUri) {
@ -1018,7 +992,7 @@ public class SignatureConfig {
/**
* @return true, if the signature config is to be updated based on the successful validated document
*
* @since POI 4.0.0
* @since 4.0.0
*/
public boolean isUpdateConfigOnValidate() {
return updateConfigOnValidate;
@ -1031,7 +1005,7 @@ public class SignatureConfig {
*
* @param updateConfigOnValidate if true, update config on validate
*
* @since POI 4.0.0
* @since 4.0.0
*/
public void setUpdateConfigOnValidate(boolean updateConfigOnValidate) {
this.updateConfigOnValidate = updateConfigOnValidate;
@ -1040,7 +1014,7 @@ public class SignatureConfig {
/**
* @return true, if multiple signatures can be attached
*
* @since POI 4.1.0
* @since 4.1.0
*/
public boolean isAllowMultipleSignatures() {
return allowMultipleSignatures;
@ -1052,7 +1026,7 @@ public class SignatureConfig {
* @param allowMultipleSignatures if true, the signature will be added,
* otherwise all existing signatures will be replaced by the current
*
* @since POI 4.1.0
* @since 4.1.0
*/
public void setAllowMultipleSignatures(boolean allowMultipleSignatures) {
this.allowMultipleSignatures = allowMultipleSignatures;
@ -1061,7 +1035,7 @@ public class SignatureConfig {
/**
* @return is secure validation enabled?
*
* @since POI 5.2.0
* @since 5.2.0
*/
public boolean isSecureValidation() {
return secureValidation;
@ -1087,7 +1061,7 @@ public class SignatureConfig {
*
* @see <a href="https://santuario.apache.org/faq.html#faq-4.SecureValidation">XmlSec SecureValidation</a>
*
* @since POI 5.2.0
* @since 5.2.0
*/
public void setSecureValidation(boolean secureValidation) {
this.secureValidation = secureValidation;

View File

@ -37,7 +37,7 @@ public class XDDFLineProperties {
/**
* @param fill
* fill properties to set on the new line properties.
* @since POI 4.0.2
* @since 4.0.2
*/
public XDDFLineProperties(XDDFFillProperties fill) {
this();

View File

@ -151,7 +151,7 @@ public class XDDFArea3DChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTAreaSer getCTAreaSer() {
return series;

View File

@ -127,7 +127,7 @@ public class XDDFAreaChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTAreaSer getCTAreaSer() {
return series;

View File

@ -198,7 +198,7 @@ public class XDDFBar3DChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTBarSer getCTBarSer() {
return series;

View File

@ -188,7 +188,7 @@ public class XDDFBarChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTBarSer getCTBarSer() {
return series;

View File

@ -32,7 +32,7 @@ import org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumData;
/**
* @since POI 5.2.3
* @since 5.2.3
*/
@Beta
public class XDDFBubbleChartData extends XDDFChartData {
@ -125,7 +125,7 @@ public class XDDFBubbleChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTBubbleSer getCTBubbleSer() {
return series;

View File

@ -81,7 +81,7 @@ public class XDDFCategoryAxis extends XDDFChartAxis {
}
/**
* @since POI 4.0.2
* @since 4.0.2
*/
@Override
public XDDFRunProperties getOrAddTextProperties() {

View File

@ -143,7 +143,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* the package part holding the chart data, the content type must
* be
* {@code application/vnd.openxmlformats-officedocument.drawingml.chart+xml}
* @since POI 3.14-Beta1
* @since 3.14-Beta1
*/
protected XDDFChart(PackagePart part) throws IOException, XmlException {
super(part);
@ -186,7 +186,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
/**
* Clear all properties, as if a new instance had just been created.
* @since POI 4.1.2
* @since 4.1.2
*/
public void clear() {
axes.clear();
@ -322,7 +322,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
/**
* Remove the chart title.
* @since POI 5.0.0
* @since 5.0.0
*/
public void removeTitle() {
setAutoTitleDeleted(true);
@ -500,7 +500,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
/**
* Clear all chart series, as if a new instance had just been created.
* @since POI 4.1.2
* @since 4.1.2
*/
public void clearChartSeries() {
CTPlotArea plotArea = getCTPlotArea();
@ -758,7 +758,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* index used to suffix on file
* @return return relation part which used to write relation in .rels file
* and get relation id
* @since POI 4.0.0
* @since 4.0.0
*/
public PackageRelationship createRelationshipInChart(POIXMLRelation chartRelation, POIXMLFactory chartFactory,
int chartIndex) {
@ -775,7 +775,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* @param chartFactory
* factory object of POIXMLFactory (XWPFFactory/XSLFFactory)
* @return return the new package part
* @since POI 4.0.0
* @since 4.0.0
*/
private PackagePart createWorksheetPart(POIXMLRelation chartWorkbookRelation, POIXMLFactory chartFactory)
throws InvalidFormatException {
@ -788,7 +788,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* this method write the XSSFWorkbook object data into embedded excel file
*
* @param workbook XSSFworkbook object
* @since POI 4.0.0
* @since 4.0.0
*/
public void saveWorkbook(XSSFWorkbook workbook) throws IOException, InvalidFormatException {
PackagePart worksheetPart = getWorksheetPart();
@ -810,21 +810,21 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
/**
*
* @return the chart relation in the implementing subclass.
* @since POI 4.0.0
* @since 4.0.0
*/
protected abstract POIXMLRelation getChartRelation();
/**
*
* @return the chart workbook relation in the implementing subclass.
* @since POI 4.0.0
* @since 4.0.0
*/
protected abstract POIXMLRelation getChartWorkbookRelation();
/**
*
* @return the chart factory in the implementing subclass.
* @since POI 4.0.0
* @since 4.0.0
*/
protected abstract POIXMLFactory getChartFactory();
@ -837,7 +837,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* category values
* @param valuesData
* data values
* @since POI 4.0.0
* @since 4.0.0
*/
protected void fillSheet(XSSFSheet sheet, XDDFDataSource<?> categoryData, XDDFNumericalDataSource<?> valuesData) {
int numOfPoints = categoryData.getPointCount();
@ -862,7 +862,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* @param index
* index of current row
* @return this method return sheet row on given index
* @since POI 4.0.0
* @since 4.0.0
*/
private XSSFRow getRow(XSSFSheet sheet, int index) {
XSSFRow row = sheet.getRow(index);
@ -882,7 +882,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* @param index
* index of current cell
* @return this method return sheet cell on given index
* @since POI 4.0.0
* @since 4.0.0
*/
private XSSFCell getCell(XSSFRow row, int index) {
XSSFCell cell = row.getCell(index);
@ -898,7 +898,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
*
* @param other
* chart object
* @since POI 4.0.0
* @since 4.0.0
*/
public void importContent(XDDFChart other) {
getCTChartSpace().set(other.getCTChartSpace());
@ -935,7 +935,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* @param column
* column index
* @return return cell reference
* @since POI 4.0.0
* @since 4.0.0
*/
public CellReference setSheetTitle(String title, int column) {
XSSFSheet sheet = getSheet();
@ -950,7 +950,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
}
/**
* @since POI 4.0.0
* @since 4.0.0
*/
public String formatRange(CellRangeAddress range) {
final XSSFSheet sheet = getSheet();
@ -961,7 +961,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* get sheet object of embedded excel file
*
* @return excel sheet object
* @since POI 4.0.0
* @since 4.0.0
*/
private XSSFSheet getSheet() {
try {
@ -977,7 +977,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* writing xssfworkbook object into output stream of embedded part
*
* @return returns the packagepart of embedded file
* @since POI 4.0.0
* @since 4.0.0
*/
private PackagePart getWorksheetPart() throws InvalidFormatException {
for (RelationPart part : getRelationParts()) {
@ -999,7 +999,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
/**
* @return returns the workbook object of embedded excel file
* @since POI 4.0.0
* @since 4.0.0
*/
public XSSFWorkbook getWorkbook() throws IOException, InvalidFormatException {
if (workbook == null) {
@ -1028,7 +1028,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
*
* @param workbook
* workbook object which we read from chart embedded part
* @since POI 4.0.0
* @since 4.0.0
*/
public void setWorkbook(XSSFWorkbook workbook) {
this.workbook = workbook;
@ -1041,7 +1041,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* @param id
* relation id of embedded excel relation id into external data
* relation tag
* @since POI 4.0.0
* @since 4.0.0
*/
public void setExternalId(String id) {
CTChartSpace ctChartSpace = getCTChartSpace();
@ -1053,7 +1053,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
/**
* @return method return chart index
* @since POI 4.0.0
* @since 4.0.0
*/
protected int getChartIndex() {
return chartIndex;
@ -1075,7 +1075,7 @@ public abstract class XDDFChart extends POIXMLDocumentPart implements TextContai
* @param newSheet
* sheet to be used in the data references.
*
* @since POI 5.1.0
* @since 5.1.0
*/
public void replaceReferences(XSSFSheet newSheet) {
for (XDDFChartData data : getChartSeries()) {

View File

@ -65,7 +65,7 @@ public abstract class XDDFChartAxis implements HasShapeProperties {
public abstract XDDFShapeProperties getOrAddMinorGridProperties();
/**
* @since POI 4.0.2
* @since 4.0.2
*/
public abstract XDDFRunProperties getOrAddTextProperties();
@ -357,7 +357,7 @@ public abstract class XDDFChartAxis implements HasShapeProperties {
/**
* @return tick label position.
* @since POI 4.0.2
* @since 4.0.2
*/
public AxisTickLabelPosition getTickLabelPosition() {
return AxisTickLabelPosition.valueOf(getCTTickLblPos().getVal());
@ -366,7 +366,7 @@ public abstract class XDDFChartAxis implements HasShapeProperties {
/**
* @param labelPosition
* tick label position.
* @since POI 4.0.2
* @since 4.0.2
*/
public void setTickLabelPosition(AxisTickLabelPosition labelPosition) {
getCTTickLblPos().setVal(labelPosition.underlying);

View File

@ -159,7 +159,7 @@ public abstract class XDDFChartData {
/**
* Set the Chart Series title.
* @param title chart series title
* @since POI 5.2.3
* @since 5.2.3
*/
public void setTitle(String title) {
setTitle(title, null);
@ -224,7 +224,7 @@ public abstract class XDDFChartData {
/**
* @param fill
* fill property for the shape representing the series.
* @since POI 4.1.1
* @since 4.1.1
*/
public void setFillProperties(XDDFFillProperties fill) {
XDDFShapeProperties properties = getShapeProperties();
@ -238,7 +238,7 @@ public abstract class XDDFChartData {
/**
* @param line
* line property for the shape representing the series.
* @since POI 4.1.1
* @since 4.1.1
*/
public void setLineProperties(XDDFLineProperties line) {
XDDFShapeProperties properties = getShapeProperties();
@ -255,7 +255,7 @@ public abstract class XDDFChartData {
*
* @param index
* data point index.
* @since POI 5.1.0
* @since 5.1.0
*/
public void clearDataPoint(long index) {
List<CTDPt> points = getDPtList();
@ -275,7 +275,7 @@ public abstract class XDDFChartData {
* data point index.
* @return
* the data point with the given {@code index}.
* @since POI 5.1.0
* @since 5.1.0
*/
public XDDFDataPoint getDataPoint(long index) {
List<CTDPt> points = getDPtList();

View File

@ -33,12 +33,12 @@ public interface XDDFDataSource<T> {
T getPointAt(int index);
/**
* @since POI 4.0.2
* @since 4.0.2
*/
boolean isLiteral();
/**
* @since POI 4.1.2
* @since 4.1.2
*/
boolean isCellRange();
@ -57,7 +57,7 @@ public interface XDDFDataSource<T> {
String getFormatCode();
/**
* @since POI 5.0.0
* @since 5.0.0
*/
@Internal
default void fillNumericalCache(CTNumData cache) {
@ -95,7 +95,7 @@ public interface XDDFDataSource<T> {
}
/**
* @since POI 4.1.2
* @since 4.1.2
*/
@Internal
default void fillStringCache(CTStrData cache) {

View File

@ -85,7 +85,7 @@ public class XDDFDateAxis extends XDDFChartAxis {
}
/**
* @since POI 4.0.2
* @since 4.0.2
*/
@Override
public XDDFRunProperties getOrAddTextProperties() {

View File

@ -138,7 +138,7 @@ public class XDDFDoughnutChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTPieSer getCTPieSer() {
return series;

View File

@ -27,7 +27,7 @@ import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource;
import org.openxmlformats.schemas.drawingml.x2006.chart.CTNumRef;
/**
* @since POI 4.1.2
* @since 4.1.2
*/
@Beta
public class XDDFErrorBars {

View File

@ -142,7 +142,7 @@ public class XDDFLine3DChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTLineSer getCTLineSer() {
return series;

View File

@ -117,7 +117,7 @@ public class XDDFLineChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTLineSer getCTLineSer() {
return series;

View File

@ -87,7 +87,7 @@ public class XDDFPie3DChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTPieSer getCTPieSer() {
return series;

View File

@ -117,7 +117,7 @@ public class XDDFPieChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTPieSer getCTPieSer() {
return series;

View File

@ -117,7 +117,7 @@ public class XDDFRadarChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTRadarSer getCTRadarSer() {
return series;

View File

@ -122,7 +122,7 @@ public class XDDFScatterChartData extends XDDFChartData {
}
/**
* @since POI 5.2.3
* @since 5.2.3
*/
public CTScatterSer getCTScatterSer() {
return series;
@ -205,35 +205,35 @@ public class XDDFScatterChartData extends XDDFChartData {
}
/**
* @since POI 4.1.2
* @since 4.1.2
*/
public int getErrorBarsCount() {
return series.sizeOfErrBarsArray();
}
/**
* @since POI 4.1.2
* @since 4.1.2
*/
public XDDFErrorBars getErrorBars(int index) {
return new XDDFErrorBars(series.getErrBarsArray(index));
}
/**
* @since POI 4.1.2
* @since 4.1.2
*/
public XDDFErrorBars addNewErrorBars() {
return new XDDFErrorBars(series.addNewErrBars());
}
/**
* @since POI 4.1.2
* @since 4.1.2
*/
public XDDFErrorBars insertNewErrorBars(int index) {
return new XDDFErrorBars(series.insertNewErrBars(index));
}
/**
* @since POI 4.1.2
* @since 4.1.2
*/
public void removeErrorBars(int index) {
series.removeErrBars(index);

Some files were not shown because too many files have changed in this diff Show More