当前位置: 首页 > news >正文

做传感器交易的网站/如何在网站上推广自己的产品

做传感器交易的网站,如何在网站上推广自己的产品,网站的优化和推广方案,宿州做网站的公司有哪些网上有关压缩和解压zip包的博文一大堆,我随便找了一个。看了看,依照自己的须要改动了一下,与各位分享一下,希望各位大神指正: package com.wangpeng.utill;import java.io.File; import java.io.FileInputStream; impo…

网上有关压缩和解压zip包的博文一大堆,我随便找了一个。看了看,依照自己的须要改动了一下,与各位分享一下,希望各位大神指正:

package com.wangpeng.utill;import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipException;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;/*** @author wangpeng*/
public class ToolOfZip {/*** 解压zip包* @param inputPath 被解压的zip包的路径* @param targetPath 被解压到的文件夹* @param isClear 是否清楚已有文件夹*/public static void unZip(String inputPath,String targetPath, boolean isClear) {try {if (null == targetPath || "".equals(targetPath)) {targetPath = inputPath.substring(0,inputPath.lastIndexOf("."));} ZipFile zipFile = new ZipFile(new File(inputPath));Enumeration<? extends ZipEntry> entrys = zipFile.entries();while (entrys.hasMoreElements()) {ZipEntry entry = entrys.nextElement();String name = entry.getName();// aaa\testdir\xxxxx\eee.txtString strTargetPath=targetPath+"/"+name;String strTargetDir=strTargetPath.substring(0, strTargetPath.lastIndexOf(File.separator));if (entry.isDirectory()) {File dir = new File(strTargetPath);if (!dir.exists()) {dir.mkdirs();}} else {File dir = new File(strTargetDir);if (!dir.exists()) {dir.mkdirs();}File file = new File(strTargetPath);if (file.exists() && isClear) {file.delete();}if (!file.exists()) {InputStream in = zipFile.getInputStream(entry);ToolOfFile.copyFile(in, file.getAbsolutePath());}}}} catch (ZipException ex) {ex.printStackTrace();} catch (IOException ex) {ex.printStackTrace();} catch (Exception e) {e.printStackTrace();}}/*** 创建ZIP文件* * @param sourcePath*            文件或文件夹路径* @param zipPath*            生成的zip文件存在路径(包含文件名称)*/public static void createZip(String sourcePath, String zipPath) {FileOutputStream fos = null;ZipOutputStream zos = null;try {fos = new FileOutputStream(zipPath);zos = new ZipOutputStream(fos);writeZip(new File(sourcePath), "", zos);} catch (FileNotFoundException e) {e.printStackTrace();} finally {try {if (zos != null) {zos.close();}} catch (IOException e) {e.printStackTrace();}}}private static void writeZip(File inFile, String parentPath,ZipOutputStream zipOutStream) {if (inFile.exists()) {if (inFile.isDirectory()) {parentPath += inFile.getName() + File.separator;File[] files = inFile.listFiles();for (File file : files) {writeZip(file, parentPath, zipOutStream);}} else {FileInputStream fileInStream = null;try {fileInStream = new FileInputStream(inFile);ZipEntry entry = new ZipEntry(parentPath + inFile.getName());zipOutStream.putNextEntry(entry);byte[] buff = new byte[1024];int len;while ((len = fileInStream.read(buff)) != -1) {zipOutStream.write(buff, 0, len);zipOutStream.flush();}} catch (FileNotFoundException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();} finally {try {if (fileInStream != null) {fileInStream.close();}} catch (IOException e) {e.printStackTrace();}}}}}public static void main(String[] args) {String oldPath = "F:/test/ddd/";String newPath = "F:/test/ccc.zip";// ToolOfZip.createZip(oldPath, newPath);//ToolOfZip.unZip(newPath, null, false);System.out.println();System.out.println("---------ok----------");}
}


 

http://www.lbrq.cn/news/1357273.html

相关文章:

  • 建筑工地网站有哪些/购买链接怎么买
  • 不同的网站 做301/网页设计排版布局技巧
  • 建设商务公司网站/大作设计网站
  • 揭阳 网站建设/视频号怎么推广流量
  • 怎么建网站手机版/北京seo顾问外包
  • 廊坊市做网站/什么是营销渠道
  • 做网站数据库怎么整/西安网站建设维护
  • 网站开发个人简介范文/域名解析ip
  • 网站开发服务承诺书/推广员是做什么的
  • 武汉新闻网/网站首页的优化
  • asp网站开发人员招聘/如何申请一个网站域名
  • 大访问量的网站怎么做优化/网站接广告平台
  • 网站建设基本流程心得/网络营销的基本流程
  • 深圳品牌网站设计推广/网站设计与网页制作
  • 平台网站怎么做的好/b站怎么推广
  • phpnow wordpress/网络推广优化
  • 史上最强大的搜索神器/seo整站优化多少钱
  • 做相册网站/网络营销的手段有哪些
  • 目前最好的免费网站/哈尔滨seo推广优化
  • 聊城冠县网站建设/三叶草gw9356
  • 化州网站建设/网络营销特点
  • 深圳网站建设 贴吧/百度收录快速提交
  • 海口模板建站平台/真实有效的优化排名
  • 重庆市建设工程造价站/网络推广怎么找客户资源
  • 网站建设公司yu/电商网站卷烟订货流程
  • 辽宁做网站和优化哪家好/免费线上培训平台
  • 高端网站制作价格/营销型网站建设企业
  • 自己做的网站只能用谷歌浏览器打开/怎么设置自己的网站
  • 免费的源码分享网站/google下载官网
  • 做芯片代理哪个网站推广/百度竞价推广的技巧
  • docker-compose快速部署启动file beat+ELK
  • 基于 Jenkins Pipeline 实现 DITA 文档自动化构建与发布(开源方案)
  • 【数据结构与算法-Day 12】深入浅出栈:从“后进先出”原理到数组与链表双实现
  • 短剧小程序系统开发:技术驱动下的内容创新之路
  • vue3 vite 使用vitest 单元测试 组件测试
  • 【springcloud的配置文件不生效】