mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
Compare commits
192 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfb713df29 | ||
|
|
44598bd030 | ||
|
|
23369586da | ||
|
|
9d9865c9b8 | ||
|
|
e9e9612a1f | ||
|
|
1594baf696 | ||
|
|
839ce4a0f4 | ||
|
|
260b22fb09 | ||
|
|
ac4e3c199e | ||
|
|
a1f6f2786f | ||
|
|
b923655b43 | ||
|
|
6b72a2dff3 | ||
|
|
c7976440c3 | ||
|
|
811eb4a4a8 | ||
|
|
6ba4a1b050 | ||
|
|
4efa2b7162 | ||
|
|
139321c5e9 | ||
|
|
6a9224385e | ||
|
|
df5604a1d7 | ||
|
|
eafd6c04b8 | ||
|
|
e340f313bc | ||
|
|
bc02ef0703 | ||
|
|
692caf0f36 | ||
|
|
e96c9e17c0 | ||
|
|
55c1608a2d | ||
|
|
5338b17a8f | ||
|
|
c92c533d7a | ||
|
|
8d53613bcf | ||
|
|
62ae400993 | ||
|
|
ae3ed57baa | ||
|
|
8f149f51d0 | ||
|
|
ab196a7441 | ||
|
|
da3d64d9e3 | ||
|
|
04f4c1fa74 | ||
|
|
513a805c25 | ||
|
|
0ae15edb2c | ||
|
|
5eba199642 | ||
|
|
0de8ecd6a0 | ||
|
|
d1f3f9489f | ||
|
|
d1f0a88ea1 | ||
|
|
beab88fb0e | ||
|
|
66109187d1 | ||
|
|
c9b37678cc | ||
|
|
e54ba888e2 | ||
|
|
8df367310c | ||
|
|
58ac8d05f0 | ||
|
|
372388b7ed | ||
|
|
e3e04a641f | ||
|
|
d72e3a608c | ||
|
|
1910fff53e | ||
|
|
22531fe638 | ||
|
|
9c2f487c98 | ||
|
|
b09bf904d7 | ||
|
|
2acb5cf66a | ||
|
|
d60edd21a3 | ||
|
|
fd4d143d44 | ||
|
|
df2d5d62d9 | ||
|
|
8cdcda2873 | ||
|
|
18ef01295d | ||
|
|
ac4295deac | ||
|
|
d93a29ae67 | ||
|
|
1fc4f9e3b7 | ||
|
|
b401b92aea | ||
|
|
a5f5f4294e | ||
|
|
ba04c61188 | ||
|
|
f8a8189230 | ||
|
|
95b2a1cf1d | ||
|
|
017ff5f8f8 | ||
|
|
cc8b6d7591 | ||
|
|
6670c48c30 | ||
|
|
aead782eb2 | ||
|
|
c94e795f35 | ||
|
|
e9b33c0b08 | ||
|
|
befc941dcf | ||
|
|
ac989335d7 | ||
|
|
0ec4434f59 | ||
|
|
c28aec61d4 | ||
|
|
b195a3b9ed | ||
|
|
ddf71d0984 | ||
|
|
fb75600872 | ||
|
|
4dadb9d6cc | ||
|
|
e7515ba5e6 | ||
|
|
c1fac56998 | ||
|
|
3a56bbd73b | ||
|
|
6d42ff955a | ||
|
|
528591ba11 | ||
|
|
c703d00300 | ||
|
|
9e1afbbab1 | ||
|
|
3ac160b57d | ||
|
|
f2c52141c7 | ||
|
|
fd66689944 | ||
|
|
97a97bd75c | ||
|
|
338882ac88 | ||
|
|
2dd124eb42 | ||
|
|
fe3359bd79 | ||
|
|
6762b5a9fb | ||
|
|
037a001719 | ||
|
|
3a69605f4c | ||
|
|
08e9bb00d4 | ||
|
|
4fb34ebeae | ||
|
|
f476c64179 | ||
|
|
a9bc28a4bb | ||
|
|
0eb7135f2b | ||
|
|
4b3c688d51 | ||
|
|
e4e4582689 | ||
|
|
027927bfad | ||
|
|
2098df7467 | ||
|
|
40ca9bd085 | ||
|
|
88836e1614 | ||
|
|
e7620b7ce7 | ||
|
|
6d6089eee5 | ||
|
|
57ffd3aa12 | ||
|
|
2428265d35 | ||
|
|
3d9c243943 | ||
|
|
236784371b | ||
|
|
47d0e956b8 | ||
|
|
74bdee9c0d | ||
|
|
e5336586a9 | ||
|
|
2805093da6 | ||
|
|
2a2e4f095e | ||
|
|
5d8d3e77bf | ||
|
|
006e49765c | ||
|
|
c953a8ff22 | ||
|
|
f44ece137f | ||
|
|
97cef0a3e3 | ||
|
|
73d1fc53f5 | ||
|
|
614d7c7002 | ||
|
|
c51dadf703 | ||
|
|
c5c2540abb | ||
|
|
97ea97b5a2 | ||
|
|
6b6735a3c4 | ||
|
|
1dbfba9225 | ||
|
|
c4e0cde59c | ||
|
|
32d7a45b50 | ||
|
|
528b72d347 | ||
|
|
ccacd1540c | ||
|
|
22ff9e34b6 | ||
|
|
775da74dee | ||
|
|
b4326363d6 | ||
|
|
ed156e63c6 | ||
|
|
5a7cd39393 | ||
|
|
8f1cfa2eb3 | ||
|
|
2cb8c4020e | ||
|
|
4b38ab5401 | ||
|
|
e7c0389865 | ||
|
|
d83039cca7 | ||
|
|
62e12fdb1b | ||
|
|
53ceff13b2 | ||
|
|
fa95a3e522 | ||
|
|
031793ddaf | ||
|
|
e73c419a37 | ||
|
|
540f0e5617 | ||
|
|
9fb2c4b03e | ||
|
|
cb520e8046 | ||
|
|
ae0a17765e | ||
|
|
71b4b62a6d | ||
|
|
a2ed8fda3a | ||
|
|
2f5ec43601 | ||
|
|
b45b7095c0 | ||
|
|
9b7938bf81 | ||
|
|
789fcc29bb | ||
|
|
1c4f68f262 | ||
|
|
7ec1fc01d4 | ||
|
|
ad925ac0d1 | ||
|
|
7a36dfe031 | ||
|
|
a5d43073a6 | ||
|
|
c840e660b7 | ||
|
|
f258b2b26d | ||
|
|
90e5d5d998 | ||
|
|
7631eae9b2 | ||
|
|
3116668737 | ||
|
|
b770a35aba | ||
|
|
59e595b844 | ||
|
|
c6a621edc6 | ||
|
|
f774a638cb | ||
|
|
73b904f16d | ||
|
|
cd22293975 | ||
|
|
d486e50822 | ||
|
|
89fa331beb | ||
|
|
1604c410d1 | ||
|
|
61203972a5 | ||
|
|
709bfd4305 | ||
|
|
3b69442907 | ||
|
|
1d4f5d34bd | ||
|
|
bc2b1b0422 | ||
|
|
7b5fe9c42b | ||
|
|
dd0d6deb81 | ||
|
|
16ecbc7d48 | ||
|
|
323b5c8c6b | ||
|
|
41f4570c8f | ||
|
|
58ee3f732b | ||
|
|
7ec830f892 |
@ -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
|
||||
|
||||
6
.github/workflows/test-gradle.yml
vendored
6
.github/workflows/test-gradle.yml
vendored
@ -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
|
||||
|
||||
@ -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/
|
||||
63
build.gradle
63
build.gradle
@ -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,7 +421,6 @@ subprojects {
|
||||
systemProperties['java.locale.providers'] = 'JRE,CLDR'
|
||||
|
||||
doFirst {
|
||||
if (jdkVersion > 8) {
|
||||
// some options were removed in JDK 18
|
||||
if (jdkVersion < 18) {
|
||||
jvmArgs += [
|
||||
@ -435,7 +441,6 @@ subprojects {
|
||||
'-Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true',
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
jacoco {
|
||||
excludes = [
|
||||
@ -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
|
||||
|
||||
85
build.xml
85
build.xml
@ -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}"/>
|
||||
|
||||
14
doap_POI.rdf
14
doap_POI.rdf
@ -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>
|
||||
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
9
gradlew
vendored
9
gradlew
vendored
@ -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.
|
||||
|
||||
4
gradlew.bat
vendored
4
gradlew.bat
vendored
@ -70,11 +70,11 @@ goto fail
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
set CLASSPATH=
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
|
||||
@ -1,3 +1,20 @@
|
||||
/* ====================================================================
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
==================================================================== */
|
||||
|
||||
// This script is used as input to the Jenkins Job DSL plugin to create all the build-jobs that
|
||||
// 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',
|
||||
|
||||
@ -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/).
|
||||
|
||||
@ -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:
|
||||
|
||||
10
osgi/pom.xml
10
osgi/pom.xml
@ -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>
|
||||
|
||||
@ -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')
|
||||
|
||||
@ -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"));
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
}
|
||||
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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)) {
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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,14 +142,10 @@ test {
|
||||
doFirst {
|
||||
jvmArgs += [
|
||||
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}",
|
||||
]
|
||||
if (jdkVersion > 8) {
|
||||
jvmArgs += [
|
||||
'--add-modules', MODULE_NAME,
|
||||
'--module-path', '../build/dist/maven/poi-excelant-tests' + File.pathSeparator + files(TEST_MODULE_PATH).asPath,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
||||
@ -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}",
|
||||
]
|
||||
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
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -29,6 +29,8 @@ public enum FileHandlerKnown {
|
||||
HSLF,
|
||||
HSMF,
|
||||
HSSF,
|
||||
HEMF,
|
||||
HWMF,
|
||||
HWPF,
|
||||
OPC,
|
||||
POIFS,
|
||||
|
||||
@ -0,0 +1,85 @@
|
||||
/* ====================================================================
|
||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
(the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
==================================================================== */
|
||||
package org.apache.poi.stress;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertInstanceOf;
|
||||
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import org.apache.poi.hemf.record.emf.HemfRecord;
|
||||
import org.apache.poi.hemf.record.emf.HemfRecordType;
|
||||
import org.apache.poi.hemf.record.emf.HemfText;
|
||||
import org.apache.poi.hemf.usermodel.HemfPicture;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
public class HEMFFileHandler implements FileHandler {
|
||||
|
||||
@Override
|
||||
public void handleExtracting(File file) throws Exception {
|
||||
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
|
||||
HemfPicture picture = new HemfPicture(stream);
|
||||
|
||||
// mimic a bit what e.g. Tika does to extract some information from .emf files
|
||||
for (HemfRecord record : picture.getRecords()) {
|
||||
if (record.getEmfRecordType().equals(HemfRecordType.extTextOutW)) {
|
||||
assertInstanceOf(HemfText.EmfExtTextOutW.class, record);
|
||||
HemfText.EmfExtTextOutW textOut = (HemfText.EmfExtTextOutW) record;
|
||||
textOut.getText(StandardCharsets.UTF_16LE);
|
||||
} else if (record.getEmfRecordType().equals(HemfRecordType.extTextOutA)) {
|
||||
assertInstanceOf(HemfText.EmfExtTextOutA.class, record);
|
||||
HemfText.EmfExtTextOutA textOut = (HemfText.EmfExtTextOutA) record;
|
||||
textOut.getText(StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleAdditional(File file) throws Exception {
|
||||
// no additional checks for now
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleFile(InputStream stream, String path) throws Exception {
|
||||
HemfPicture picture = new HemfPicture(stream);
|
||||
|
||||
for (HemfRecord record : picture.getRecords()) {
|
||||
record.getEmfRecordType();
|
||||
record.getGenericRecordType();
|
||||
}
|
||||
|
||||
BufferedImage dest = new BufferedImage(256, 256, BufferedImage.TYPE_INT_ARGB);
|
||||
picture.draw(dest.createGraphics(), new Rectangle2D.Double(0, 0, 256, 256));
|
||||
}
|
||||
|
||||
@Test
|
||||
void test() throws Exception {
|
||||
String file = "test-data/slideshow/wrench.emf";
|
||||
|
||||
try (InputStream stream = new BufferedInputStream(new FileInputStream(file))) {
|
||||
handleFile(stream, file);
|
||||
}
|
||||
|
||||
handleExtracting(new File(file));
|
||||
}
|
||||
}
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
@ -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,11 +77,14 @@ public abstract class SlideShowHandler extends POIFSFileHandler {
|
||||
}
|
||||
}
|
||||
|
||||
for (Shape<?,?> shape : s.getMasterSheet()) {
|
||||
MasterSheet<?, ?> masterSheet = s.getMasterSheet();
|
||||
if (masterSheet != null) {
|
||||
for (Shape<?,?> shape : masterSheet) {
|
||||
readShapes(shape);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void readShapes(Shape<?,?> s) {
|
||||
// recursively walk group-shapes
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -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.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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 (
|
||||
|
||||
@ -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()));
|
||||
|
||||
@ -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")
|
||||
|
||||
@ -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,17 +259,13 @@ test {
|
||||
|
||||
doFirst {
|
||||
jvmArgs += [
|
||||
"-Xverify:all",
|
||||
"-XX:ErrorFile=../build/hs_err_pid%p.log",
|
||||
"-javaagent:${OOXML_LITE_AGENT}=${OOXML_LITE_REPORT}|${OOXML_LITE_INCLUDES}"
|
||||
]
|
||||
if (jdkVersion > 8) {
|
||||
jvmArgs += [
|
||||
'-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,
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
||||
@ -23,7 +23,7 @@ import java.net.URI;
|
||||
/**
|
||||
* Represents a hyperlink relationship.
|
||||
*
|
||||
* @since POI 5.3.0
|
||||
* @since 5.3.0
|
||||
*/
|
||||
public class HyperlinkRelationship extends ReferenceRelationship {
|
||||
/**
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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) {
|
||||
try {
|
||||
childPart = factory.createDocumentPart(this, p);
|
||||
//here we are checking if part if embedded and excel then set it to chart class
|
||||
} catch (POIXMLException e) {
|
||||
if (e.getCause() instanceof XmlException
|
||||
&& XSSFRelation.CHART.getRelation().equals(rel.getRelationshipType())) {
|
||||
// https://github.com/apache/poi/pull/982
|
||||
// only allow this skipping event for charts
|
||||
// we need to be careful about not catching every exception here because
|
||||
// issues like zip bomb exceptions need to thrown and not ignored
|
||||
LOG.atWarn().log("Skipped unsupported part: {}", e.getMessage());
|
||||
continue;
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
//here we are checking if part is embedded and excel then set it to chart class
|
||||
//so that at the time to writing we can also write updated embedded part
|
||||
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() {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ import java.net.URI;
|
||||
/**
|
||||
* Defines a reference relationship. A reference relationship can be internal or external.
|
||||
*
|
||||
* @since POI 5.3.0
|
||||
* @since 5.3.0
|
||||
*/
|
||||
public abstract class ReferenceRelationship {
|
||||
private POIXMLDocumentPart container;
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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
|
||||
*/
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
@ -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
|
||||
|
||||
@ -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 {
|
||||
|
||||
|
||||
@ -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,8 +1875,11 @@ public abstract class OPCPackage implements RelationshipSource, Closeable {
|
||||
public abstract boolean isClosed();
|
||||
|
||||
protected void closeParts() {
|
||||
// might not be initialized fully yet
|
||||
if (partList != null) {
|
||||
partList.closeParts();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
@ -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() {
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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(
|
||||
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;
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -151,7 +151,7 @@ public class XDDFArea3DChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTAreaSer getCTAreaSer() {
|
||||
return series;
|
||||
|
||||
@ -127,7 +127,7 @@ public class XDDFAreaChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTAreaSer getCTAreaSer() {
|
||||
return series;
|
||||
|
||||
@ -198,7 +198,7 @@ public class XDDFBar3DChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTBarSer getCTBarSer() {
|
||||
return series;
|
||||
|
||||
@ -188,7 +188,7 @@ public class XDDFBarChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTBarSer getCTBarSer() {
|
||||
return series;
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -81,7 +81,7 @@ public class XDDFCategoryAxis extends XDDFChartAxis {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 4.0.2
|
||||
* @since 4.0.2
|
||||
*/
|
||||
@Override
|
||||
public XDDFRunProperties getOrAddTextProperties() {
|
||||
|
||||
@ -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()) {
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -85,7 +85,7 @@ public class XDDFDateAxis extends XDDFChartAxis {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 4.0.2
|
||||
* @since 4.0.2
|
||||
*/
|
||||
@Override
|
||||
public XDDFRunProperties getOrAddTextProperties() {
|
||||
|
||||
@ -138,7 +138,7 @@ public class XDDFDoughnutChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTPieSer getCTPieSer() {
|
||||
return series;
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -142,7 +142,7 @@ public class XDDFLine3DChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTLineSer getCTLineSer() {
|
||||
return series;
|
||||
|
||||
@ -117,7 +117,7 @@ public class XDDFLineChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTLineSer getCTLineSer() {
|
||||
return series;
|
||||
|
||||
@ -87,7 +87,7 @@ public class XDDFPie3DChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTPieSer getCTPieSer() {
|
||||
return series;
|
||||
|
||||
@ -117,7 +117,7 @@ public class XDDFPieChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTPieSer getCTPieSer() {
|
||||
return series;
|
||||
|
||||
@ -117,7 +117,7 @@ public class XDDFRadarChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTRadarSer getCTRadarSer() {
|
||||
return series;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -81,7 +81,7 @@ public class XDDFSeriesAxis extends XDDFChartAxis {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 4.0.2
|
||||
* @since 4.0.2
|
||||
*/
|
||||
@Override
|
||||
public XDDFRunProperties getOrAddTextProperties() {
|
||||
|
||||
@ -124,7 +124,7 @@ public class XDDFSurface3DChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTSurfaceSer getCTSurfaceSer() {
|
||||
return series;
|
||||
|
||||
@ -129,7 +129,7 @@ public class XDDFSurfaceChartData extends XDDFChartData {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.3
|
||||
* @since 5.2.3
|
||||
*/
|
||||
public CTSurfaceSer getCTSurfaceSer() {
|
||||
return series;
|
||||
|
||||
@ -85,7 +85,7 @@ public class XDDFTitle {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 4.1.2
|
||||
* @since 4.1.2
|
||||
*/
|
||||
public XDDFRunProperties getOrAddTextProperties() {
|
||||
CTTextBody text;
|
||||
|
||||
@ -81,7 +81,7 @@ public class XDDFValueAxis extends XDDFChartAxis {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 4.0.2
|
||||
* @since 4.0.2
|
||||
*/
|
||||
@Override
|
||||
public XDDFRunProperties getOrAddTextProperties() {
|
||||
|
||||
@ -122,7 +122,7 @@ public class XDDFTextParagraph implements Iterable<XDDFTextRun> {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 5.2.0
|
||||
* @since 5.2.0
|
||||
*/
|
||||
@Override
|
||||
public Spliterator<XDDFTextRun> spliterator() {
|
||||
|
||||
@ -52,7 +52,7 @@ public class XDGFBaseContents extends XDGFXMLDocumentPart {
|
||||
protected List<XDGFConnection> _connections = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @since POI 3.14-Beta1
|
||||
* @since 3.14-Beta1
|
||||
*/
|
||||
public XDGFBaseContents(PackagePart part) {
|
||||
super(part);
|
||||
|
||||
@ -35,7 +35,7 @@ public class XDGFFactory extends POIXMLFactory {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since POI 3.14-Beta1
|
||||
* @since 3.14-Beta1
|
||||
*/
|
||||
protected POIXMLRelation getDescriptor(String relationshipType) {
|
||||
return XDGFRelation.getInstance(relationshipType);
|
||||
|
||||
@ -34,7 +34,7 @@ public class XDGFMasterContents extends XDGFBaseContents {
|
||||
protected XDGFMaster _master;
|
||||
|
||||
/**
|
||||
* @since POI 3.14-Beta1
|
||||
* @since 3.14-Beta1
|
||||
*/
|
||||
public XDGFMasterContents(PackagePart part) {
|
||||
super(part);
|
||||
|
||||
@ -48,7 +48,7 @@ public class XDGFMasters extends XDGFXMLDocumentPart {
|
||||
protected Map<Long, XDGFMaster> _masters = new HashMap<>();
|
||||
|
||||
/**
|
||||
* @since POI 3.14-Beta1
|
||||
* @since 3.14-Beta1
|
||||
*/
|
||||
public XDGFMasters(PackagePart part) {
|
||||
super(part);
|
||||
|
||||
@ -35,7 +35,7 @@ public class XDGFPageContents extends XDGFBaseContents {
|
||||
protected XDGFPage _page;
|
||||
|
||||
/**
|
||||
* @since POI 3.14-Beta1
|
||||
* @since 3.14-Beta1
|
||||
*/
|
||||
public XDGFPageContents(PackagePart part) {
|
||||
super(part);
|
||||
|
||||
@ -47,7 +47,7 @@ public class XDGFPages extends XDGFXMLDocumentPart {
|
||||
List<XDGFPage> _pages = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @since POI 3.14-Beta1
|
||||
* @since 3.14-Beta1
|
||||
*/
|
||||
public XDGFPages(PackagePart part) {
|
||||
super(part);
|
||||
|
||||
@ -93,7 +93,7 @@ public class XmlVisioDocument extends POIXMLDocument {
|
||||
* @param stream InputStream
|
||||
* @param closeStream Whether to close the InputStream
|
||||
* @throws IOException If parsing the document fails
|
||||
* @since POI 5.2.5
|
||||
* @since 5.2.5
|
||||
*/
|
||||
public XmlVisioDocument(InputStream stream, boolean closeStream) throws IOException {
|
||||
this(PackageHelper.open(stream, closeStream));
|
||||
|
||||
@ -47,6 +47,10 @@ public class RelLineTo implements GeometryRow {
|
||||
for (CellType cell : row.getCellArray()) {
|
||||
String cellName = cell.getN();
|
||||
|
||||
if (cellName == null) {
|
||||
throw new IllegalStateException("Cannot create a ReLineTo object without a cell-name indicating 'X' or 'Y' direction");
|
||||
}
|
||||
|
||||
if (cellName.equals("X")) {
|
||||
x = XDGFCell.parseDoubleValue(cell);
|
||||
} else if (cellName.equals("Y")) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user