package com.borland.samples.welcome;
import java.io.FileNotFoundException;
import java.io.File;
public class ReadFile {
/**
* @param delpath String
* @throws IOException
*/
IOException {
File file = new File(delpath);
System.out.println("1");
}
System.out.println("2");
for (int i = 0; i < filelist.length; i++) {
if (!delfile.isDirectory()) {
System.out.println("absolutepath=" + delfile.getAbsolutePath());
delfile.delete();
}
deletefile(delpath + """" + filelist[i]);
}
}
}
System.out.println("deletefile() Exception:" + e.getMessage());
return true;
/**
* @param delpath String
* @throws IOException
*/
IOException {
File file = new File(filepath);
System.out.println("文件");
System.out.println("absolutepath=" + file.getAbsolutePath());
}
System.out.println("文件夹");
for (int i = 0; i < filelist.length; i++) {
if (!readfile.isDirectory()) {
System.out.println("absolutepath=" + readfile.getAbsolutePath());
}
readfile(filepath + """" + filelist[i]);
}
}
}
System.out.println("readfile() Exception:" + e.getMessage());
return true;
public static void main(String args) {
readfile("D:/file");
}
}
}
}
|
点击加载更多评论>>