作者:乔山办公网日期:
返回目录:excel表格制作
首先你百这个Excel文件是从哪里来的,很可能是从一个页面上下载来的,而这度个页面做的功能就是导出Excel,但做偷懒知了,没有用jxl和POI等库,而是用直接用道jsp生成html写的。
因此你上传时就版要要判断了,如果是真的excel就要用jxl或POI解析,如果只是html,就要用HTML的解析方权法了。
抽象Java类实现。所有的知具体工厂必须实现这个Java接口或继承这个抽象的Java类。道
- 具体工厂(Factory)角色:这个角色直接在客户端的调用下创建产品的内实例,这个角色含容有选择合适的产品对象的逻辑,而这个逻辑是
Biff8EncryptionKey.setCurrentUserPassword("pass");
NPOIFSFileSystem fs = new NPOIFSFileSystem(new File("file.xls"), true);
HSSFWorkbook hwb = new HSSFWorkbook(fs.getRoot(), true);
Biff8EncryptionKey.setCurrentUserPassword(null);
// RC4 CryptoApi support ppt - decryption
Biff8EncryptionKey.setCurrentUserPassword("pass");
NPOIFSFileSystem fs = new NPOIFSFileSystem(new File("file.ppt"), true);
HSLFSlideShow hss = new HSLFSlideShow(fs);
...
// Option 1: remove password
Biff8EncryptionKey.setCurrentUserPassword(null);
OutputStream os = new FileOutputStream("decrypted.ppt");
hss.write(os);
os.close();
...
// Option 2: change encryption settings (experimental)
// need to cache data (i.e. read all data) before changing the key size
PictureData picsExpected[] = hss.getPictures();
hss.getDocumentSummaryInformation();
EncryptionInfo ei = hss.getDocumentEncryptionAtom().getEncryptionInfo();
((CryptoAPIEncryptionHeader)ei.getHeader()).setKeySize(0x78);
OutputStream os = new FileOutputStream("file_120bit.ppt");
hss.write(os);
os.close();