package co.hp.zy.thread;
import java.io.*;
public class ShangC extends Thread {
public static void main(String[] args) {
Aa a = new Aa();
a.start();
}
//创建子线程对象
static class Aa extends Thread {
@Override
public void run() {
System.out.println("图片开始上传");
for (int i = 1; i <=5; i++) {
fileA();
System.out.println(i*20 + "%");
try {
Aa.sleep(1);
} catch (Exception e) {
e.printStackTrace();
}
}
System.out.println("图片上传完毕");
}
}
public static void fileA() {
File file = new File("E:/img");
File file2 = new File("E:/img2");
FileInputStream fi = null;
FileOutputStream fo = null;
File[] f1 = file.listFiles();
f