reformat ZipFileZipEntrySource.java

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1918799 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2024-07-01 21:30:07 +00:00
parent 527f26aac9
commit d879a94a15
1 changed files with 48 additions and 47 deletions

View File

@ -30,13 +30,14 @@ import org.apache.commons.compress.archivers.zip.ZipFile;
*/ */
public class ZipFileZipEntrySource implements ZipEntrySource { public class ZipFileZipEntrySource implements ZipEntrySource {
private ZipFile zipArchive; private ZipFile zipArchive;
public ZipFileZipEntrySource(ZipFile zipFile) { public ZipFileZipEntrySource(ZipFile zipFile) {
this.zipArchive = zipFile; this.zipArchive = zipFile;
} }
@Override @Override
public void close() throws IOException { public void close() throws IOException {
if(zipArchive != null) { if (zipArchive != null) {
zipArchive.close(); zipArchive.close();
} }
zipArchive = null; zipArchive = null;
@ -76,7 +77,7 @@ public class ZipFileZipEntrySource implements ZipEntrySource {
final Enumeration<ZipArchiveEntry> zipArchiveEntryEnumeration = zipArchive.getEntries(); final Enumeration<ZipArchiveEntry> zipArchiveEntryEnumeration = zipArchive.getEntries();
while (zipArchiveEntryEnumeration.hasMoreElements()) { while (zipArchiveEntryEnumeration.hasMoreElements()) {
ZipArchiveEntry ze = zipArchiveEntryEnumeration.nextElement(); ZipArchiveEntry ze = zipArchiveEntryEnumeration.nextElement();
if (normalizedPath.equalsIgnoreCase(ze.getName().replace('\\','/'))) { if (normalizedPath.equalsIgnoreCase(ze.getName().replace('\\', '/'))) {
return ze; return ze;
} }
} }