1、mkdir和mkdirs的区别
File file=new File("D:\\bb\\cc\\dd\\ee\\ff","/bb/cc/dd/ee");
if(!file.exists()){
file.mkdirs();
}
倘若父目录D:\\bb\\cc\\dd\\ee\\ff不存在,那么只能用mkdirs创建。
2、pathSeparator :path-separator在windows中是“;”
3、separator :name-separator在windows中是“\”
4、public File(String parent, String child)
根据 parent 路径名字符串和 child 路径名字符串创建一个新 File 实例。
如果 parent 为 null,则创建一个新的 File 实例,这与调用以给定 child 路径名字符串作为参数的单参数 File 构造方法效果一样。
否则,parent 路径名字符串用于表示目录,child 路径名字符串用于表示目录或文件。如果 child 路径名字符串是绝对路径名,则用与系统有关的方式将它转换为一个相对路径名。如果 parent 是空字符串,则通过将 child 转换为抽象路径名,并根据与系统有关的默认目录解析结果来创建新的 File 实例。否则,将每个路径名字符串转换为一个抽象路径名,并根据父抽象路径名解析子抽象路径名。