diff options
author | PJ Fanning <fanningpj@apache.org> | 2024-06-05 16:45:46 +0000 |
---|---|---|
committer | PJ Fanning <fanningpj@apache.org> | 2024-06-05 16:45:46 +0000 |
commit | 41ccb6fe3009f12c28fe51bcb4b4269687d50ee8 (patch) | |
tree | aaf333ca2332edc26dcec115b2ea93c85f1e35c2 /poi-ooxml/src | |
parent | a1a982a2fbb3b976c2bb5da728363f68262f4d28 (diff) | |
download | poi-41ccb6fe3009f12c28fe51bcb4b4269687d50ee8.tar.gz poi-41ccb6fe3009f12c28fe51bcb4b4269687d50ee8.zip |
getNextZipEntry deprecation warnings
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1918177 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-ooxml/src')
3 files changed, 5 insertions, 5 deletions
diff --git a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/temp/AesZipFileZipEntrySource.java b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/temp/AesZipFileZipEntrySource.java index b8e3bcba9d..4384f0f6dc 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/temp/AesZipFileZipEntrySource.java +++ b/poi-ooxml/src/main/java/org/apache/poi/poifs/crypt/temp/AesZipFileZipEntrySource.java @@ -135,7 +135,7 @@ public final class AesZipFileZipEntrySource implements ZipEntrySource { ZipArchiveOutputStream zos = new ZipArchiveOutputStream(fos)) { ZipArchiveEntry ze; - while ((ze = zis.getNextZipEntry()) != null) { + while ((ze = zis.getNextEntry()) != null) { // the cipher output stream pads the data, therefore we can't reuse the ZipEntry with set sizes // as those will be validated upon close() ZipArchiveEntry zeNew = new ZipArchiveEntry(ze.getName()); diff --git a/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/tests/TestDecryptor.java b/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/tests/TestDecryptor.java index c6d10af2b7..2a48f12a17 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/tests/TestDecryptor.java +++ b/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/tests/TestDecryptor.java @@ -84,7 +84,7 @@ class TestDecryptor { try (ZipArchiveInputStream zin = new ZipArchiveInputStream(d.getDataStream(root))) { while (true) { - ZipArchiveEntry entry = zin.getNextZipEntry(); + ZipArchiveEntry entry = zin.getNextEntry(); if (entry == null) { break; } @@ -120,7 +120,7 @@ class TestDecryptor { ZipArchiveInputStream zin = new ZipArchiveInputStream(new ByteArrayInputStream(buf)); while (true) { - ZipArchiveEntry entry = zin.getNextZipEntry(); + ZipArchiveEntry entry = zin.getNextEntry(); if (entry==null) { break; } @@ -146,7 +146,7 @@ class TestDecryptor { try (final ZipArchiveInputStream zis = new ZipArchiveInputStream(d.getDataStream(fs))) { int[] sizes = { 3711, 1155, 445, 9376, 450, 588, 1337, 2593, 304, 7910 }; for (int size : sizes) { - final ZipArchiveEntry ze = zis.getNextZipEntry(); + final ZipArchiveEntry ze = zis.getNextEntry(); assertNotNull(ze); IOUtils.copy(zis, bos); assertEquals(size, bos.size()); diff --git a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java index 35460bf6de..744887ff40 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xssf/usermodel/TestXSSFWorkbook.java @@ -1496,7 +1496,7 @@ public final class TestXSSFWorkbook extends BaseTestXWorkbook { int count = 0; try (ZipArchiveInputStream zis = new ZipArchiveInputStream(Files.newInputStream(tempFile.toPath()))) { ZipArchiveEntry entry; - while ((entry = zis.getNextZipEntry()) != null) { + while ((entry = zis.getNextEntry()) != null) { // Since POI 5.2.5, you can stop XSSFWorkbook closing the InputStream by using this new constructor XSSFWorkbook wb = new XSSFWorkbook(zis, false); assertNotNull(wb); |