Dubbo 3 深度剖析 - 透过源码认识你完结无密
download:Dubbo 3 深度剖析 - 透过源码认识你
import java.io.*;
import java.util.*;
import java.util.zip.*;
public class FolderUnzip {
private static String sourcepath="D:\tmp";
private static ListfolderList=new ArrayList(Arrays.asList(sourcepath));
private static ListfolderList2=new ArrayList(Arrays.asList("E:\tt"+File.separator+sourcepath.substring(sourcepath.lastIndexOf(File.separator))));
private static FileInputStream fis = null;
private static FileOutputStream fos = null;
private static ZipInputStream zipin = null;
public static void main(String[] args) {
for (int j = 0;
j < folderList.size();
j++) {
new File(folderList2.get(j)).mkdirs();
String[] file = new File(folderList.get(j)).list();
File temp = null;
for (int i = 0;
i < file.length;
i++) {
if (folderList.get(j).endsWith(File.separator))
temp = new File(folderList.get(j), file[i]);
else
temp = new File(folderList.get(j), file[i]);
File originalFile = null;
if (temp.getName().endsWith(".zip"))
originalFile = new File(folderList2.get(j), temp.getName()
.substring(0, temp.getName().lastIndexOf('.')));
if (temp.isFile() && !originalFile.exists()) {
try {
fis = new FileInputStream(temp);
zipin = new ZipInputStream(fis);
ZipEntry entry = zipin.getNextEntry();
fos = new FileOutputStream(new File(folderList2.get(j),entry.getName()));
byte[] buffer = new byte[20480];
int nNumber;
while ((nNumber = zipin.read(buffer, 0, buffer.length)) != -1)
fos.write(buffer, 0, nNumber);
fos.flush();
} catch (IOException e) {
continue;
} finally {
try {
zipin.close();
fos.close();
fis.close();
} catch (IOException e) {
}
}
} else if (temp.isDirectory()) {
folderList.add(folderList.get(j) + File.separator + file[i]);
folderList2.add(folderList2.get(j) + File.separator+ file[i]);
}
}
}
}
【Dubbo 3 深度剖析 - 透过源码认识你完结无密】}
推荐阅读
- dubbo基本认识
- 《深度倾听》第5天──「RIA学习力」便签输出第16期
- Spring|Spring 框架之 AOP 原理剖析已经出炉!!!预定的童鞋可以识别下发二维码去看了
- Dubbo引用服务
- 深度解读(《秘密》(八)—健康的秘密)
- 影响深度思考的9种思维定式
- 为Google|为Google Cloud配置深度学习环境(CUDA、cuDNN、Tensorflow2、VScode远程ssh等)
- 深度学习-入门
- 养好一塘鱼——《深度思维》(三)
- OpenCV|OpenCV-Python实战(18)——深度学习简介与入门示例