Skip to content

Commit

Permalink
Remove duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
srikanth-lingala committed Mar 23, 2022
1 parent 985d8c5 commit be88df4
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/main/java/net/lingala/zip4j/headers/HeaderReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import net.lingala.zip4j.exception.ZipException;
import net.lingala.zip4j.io.inputstream.NumberedSplitRandomAccessFile;
import net.lingala.zip4j.model.AESExtraDataRecord;
import net.lingala.zip4j.model.AbstractFileHeader;
import net.lingala.zip4j.model.CentralDirectory;
import net.lingala.zip4j.model.DataDescriptor;
import net.lingala.zip4j.model.DigitalSignature;
Expand Down Expand Up @@ -612,7 +613,7 @@ public DataDescriptor readDataDescriptor(InputStream inputStream, boolean isZip6
return dataDescriptor;
}

private void readAesExtraDataRecord(FileHeader fileHeader, RawIO rawIO) throws ZipException {
private void readAesExtraDataRecord(AbstractFileHeader fileHeader, RawIO rawIO) throws ZipException {
if (fileHeader.getExtraDataRecords() == null || fileHeader.getExtraDataRecords().size() <= 0) {
return;
}
Expand All @@ -624,18 +625,6 @@ private void readAesExtraDataRecord(FileHeader fileHeader, RawIO rawIO) throws Z
}
}

private void readAesExtraDataRecord(LocalFileHeader localFileHeader, RawIO rawIO) throws ZipException {
if (localFileHeader.getExtraDataRecords() == null || localFileHeader.getExtraDataRecords().size() <= 0) {
return;
}

AESExtraDataRecord aesExtraDataRecord = readAesExtraDataRecord(localFileHeader.getExtraDataRecords(), rawIO);
if (aesExtraDataRecord != null) {
localFileHeader.setAesExtraDataRecord(aesExtraDataRecord);
localFileHeader.setEncryptionMethod(EncryptionMethod.AES);
}
}

private AESExtraDataRecord readAesExtraDataRecord(List<ExtraDataRecord> extraDataRecords, RawIO rawIO)
throws ZipException {

Expand Down

0 comments on commit be88df4

Please sign in to comment.