java

时间:2015-05-16 20:26:20   收藏:0   阅读:167

1. 多级目录下创建文件

	File file = new File("aa/bb/cc.txt");
	File pf = file.getParentFile();
	if(!pf.exists()){
		pf.mkdirs();
	}
	try {
		file.createNewFile();
	} catch (IOException e) {
		e.printStackTrace();
	}

  

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!