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

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

博客园 - 重粒子

文件在线预览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();
		}
	}