zip4j icon indicating copy to clipboard operation
zip4j copied to clipboard

the getFileHeaders() method throws UnbufferedIoViolation

Open simmiggrwl19 opened this issue 1 year ago • 0 comments

The getFileHeaders() method in the code below results in an UnbufferedIoViolation:

    try (ZipFile zipFile = ZipFileHelper.createZipFile(file)) {
      zipFile.setCharset(charset);
      List<FileHeader> fileHeaders = zipFile.getFileHeaders();
      for (FileHeader fileHeader : fileHeaders) {
        ZipFileEntryWrapper entry = new ZipFileEntryFromFileHeader(this, fileHeader);
        if (entry.isEncrypted()) {
          isEncrypted = true;
        }
        try {
          entry.getValidatedName();
        } catch (ZipException zipex) {
          throw new InvalidZipFileException("Zip file contains entry with invalid name.");
        }
      }
    }
    
  

simmiggrwl19 avatar Aug 26 '24 15:08 simmiggrwl19