斑驳。
codeing or artist ?
String excelPath = "Excel文件路徑";
String password = "Excel文件密碼";
 
Workbook workbook;
InputStream inp = new FileInputStream(excelPath);
//解密
POIFSFileSystem pfs = new POIFSFileSystem(inp);
inp.close();
EncryptionInfo encInfo = new EncryptionInfo(pfs);
Decryptor decryptor = Decryptor.getInstance(encInfo);
decryptor.verifyPassword(password);
workbook = new XSSFWorkbook(decryptor.getDataStream(pfs));

 

posted on 2018-11-21 16:38  斑驳。  阅读(6398)  评论(0编辑  收藏  举报