How to password protect a zipped Excel file in Java?

后端 未结 3 535
说谎
说谎 2021-01-06 00:27

I have a question about password protecting an Excel file.

The situation is that, I have a zip file, that has an Excel file in it. I need to write a Java program, to

3条回答
  •  误落风尘
    2021-01-06 00:55

    • Use java.util.zip or zip4j to decompress file to some temp direcotry or to memory, if you know it's small.
    • Then use HSSFWorkbook.writeProtectWorkbook from Apache POI library
    • Compress Excel workbook again.

提交回复
热议问题