Skip to content

Commit

Permalink
try to fix compile issues due to commons-compress upgrade
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1913865 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pjfanning committed Nov 16, 2023
1 parent e9710ea commit 386b2fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more

package org.apache.poi.xssf.streaming;

import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;

import java.io.IOException;
Expand All @@ -36,9 +36,8 @@ public void setLevel(int level) {
out.setLevel(level);
}


@Override
public void putArchiveEntry(ArchiveEntry archiveEntry) throws IOException {
public void putArchiveEntry(ZipArchiveEntry archiveEntry) throws IOException {
out.putNextEntry(archiveEntry.getName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Licensed to the Apache Software Foundation (ASF) under one or more
import java.io.IOException;
import java.io.OutputStream;

import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
import org.apache.commons.io.output.NullOutputStream;
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
Expand Down Expand Up @@ -63,7 +63,7 @@ void withZipOutputStream() throws Exception {
void ioException() {
ZipArchiveOutputStream zos = new ZipArchiveOutputStream(UnsynchronizedByteArrayOutputStream.builder().get()) {
@Override
public void putArchiveEntry(final ArchiveEntry archiveEntry) throws IOException {
public void putArchiveEntry(final ZipArchiveEntry archiveEntry) throws IOException {
throw new IOException("TestException");
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ Licensed to the Apache Software Foundation (ASF) under one or more

package org.apache.poi.xssf.usermodel;

import org.apache.commons.compress.archivers.ArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveEntry;
import org.apache.commons.compress.archivers.zip.ZipArchiveInputStream;
import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream;
Expand Down Expand Up @@ -1480,13 +1479,13 @@ void readFromZipStream() throws IOException {
try (ZipArchiveOutputStream zos = new ZipArchiveOutputStream(tempFile)) {
File f1 = getSampleFile("github-321.xlsx");
File f2 = getSampleFile("48495.xlsx");
ArchiveEntry e1 = zos.createArchiveEntry(f1, "github-321.xlsx");
ZipArchiveEntry e1 = zos.createArchiveEntry(f1, "github-321.xlsx");
zos.putArchiveEntry(e1);
try (InputStream s = Files.newInputStream(f1.toPath())) {
IOUtils.copy(s, zos);
}
zos.closeArchiveEntry();
ArchiveEntry e2 = zos.createArchiveEntry(f2, "48495.xlsx");
ZipArchiveEntry e2 = zos.createArchiveEntry(f2, "48495.xlsx");
zos.putArchiveEntry(e2);
try (InputStream s = Files.newInputStream(f2.toPath())) {
IOUtils.copy(s, zos);
Expand Down

0 comments on commit 386b2fc

Please sign in to comment.