getNextZipEntry deprecation warnings

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1918177 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2024-06-05 16:45:46 +00:00
parent a1a982a2fb
commit 41ccb6fe30
4 changed files with 6 additions and 6 deletions

View File

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

View File

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

View File

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

View File

@ -29,6 +29,7 @@ import javax.crypto.CipherInputStream;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import org.apache.commons.io.input.BoundedInputStream;
import org.apache.poi.EncryptedDocumentException;
import org.apache.poi.poifs.crypt.ChainingMode;
import org.apache.poi.poifs.crypt.CryptoFunctions;
@ -38,7 +39,6 @@ import org.apache.poi.poifs.crypt.EncryptionVerifier;
import org.apache.poi.poifs.crypt.HashAlgorithm;
import org.apache.poi.poifs.filesystem.DirectoryNode;
import org.apache.poi.poifs.filesystem.DocumentInputStream;
import org.apache.commons.io.input.BoundedInputStream;
import org.apache.poi.util.LittleEndian;
/**