惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
V
V2EX
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Register - Security
The Register - Security
MongoDB | Blog
MongoDB | Blog
P
Privacy International News Feed
The Last Watchdog
The Last Watchdog
Security Archives - TechRepublic
Security Archives - TechRepublic
美团技术团队
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
K
Kaspersky official blog
S
Secure Thoughts
T
Tenable Blog
Security Latest
Security Latest
The Cloudflare Blog
S
Security @ Cisco Blogs
H
Heimdal Security Blog
aimingoo的专栏
aimingoo的专栏
TaoSecurity Blog
TaoSecurity Blog
Blog — PlanetScale
Blog — PlanetScale
Microsoft Security Blog
Microsoft Security Blog
Schneier on Security
Schneier on Security
Webroot Blog
Webroot Blog
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
IT之家
IT之家
Latest news
Latest news
The Hacker News
The Hacker News
C
Check Point Blog
T
The Exploit Database - CXSecurity.com
H
Hackread – Cybersecurity News, Data Breaches, AI and More
腾讯CDC
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
N
News | PayPal Newsroom
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
S
Security Affairs
S
Securelist
Google Online Security Blog
Google Online Security Blog
WordPress大学
WordPress大学
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
A
About on SuperTechFans

博客园 - 重粒子

文件在线预览doc,docx转换pdf(一) vue中集成pdfjs自定义分页 使用 vs code 搭建vue项目(一) post文件下载 css 文本超出2行就隐藏并且显示省略号 js监听全屏下的esc事件 js实现全屏和缩放 ionic 侧栏菜单用法 weblogic获取应用目录路径(war包) 使用pdf.js预览实现读取服务器外部文件 js禁用浏览器后退 Angularjs自定义指令计算浏览器高度 AngularJS封装webupload实现文件夹上传 jquery监听滚动条 pdf预览(pdf.js) (钉钉)第三方WEB网站扫码登录 $q的基本用法 Jersey RESTful WebService框架学习(八)文件下载防乱码 巧用 Jersey RESTful WebService框架解决文件上传乱码
java批量将多文件打包成zip格式
重粒子 · 2018-03-28 · via 博客园 - 重粒子
public void createzip(){
		List<File> nFileList = new ArrayList<File>();
		nFileList.add(new File("C:\\Users\\Administrator\\Desktop\\测试移动到\\0001+国务院办公厅关于积极推进供应链创新与应用的指导意见.doc"));
		nFileList.add(new File("C:\\Users\\Administrator\\Desktop\\测试移动到\\0001+国务院办公厅关于积极推进供应链创新与应用的指导意见.pdf"));
		nFileList.add(new File("C:\\Users\\Administrator\\Desktop\\zenith.product.fms.main.js"));
		String strZipName = "C:\\Users\\Administrator\\Desktop\\lx.zip"; 
		FileInputStream nFileInputStream = null;
		ZipOutputStream nZipOutputStream = null;
		try {
			nZipOutputStream = new ZipOutputStream(new FileOutputStream(strZipName));
			for (File file : nFileList) {
				nFileInputStream = new FileInputStream(file);
				nZipOutputStream.putNextEntry(new ZipEntry(file.getName()));
				int len;
				while ((len = nFileInputStream.read()) != -1) {
					nZipOutputStream.write(len);
					nZipOutputStream.flush();
				}
			}
			nZipOutputStream.close();
			nFileInputStream.close();
			System.out.println("生成lx.zip成功");   
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}